pub struct AS5600Driver<I2C> { /* private fields */ }Expand description
Main driver for the AS5600 sensor.
Implementations§
Source§impl<I2C: I2c<SevenBitAddress>> AS5600Driver<I2C>
impl<I2C: I2c<SevenBitAddress>> AS5600Driver<I2C>
Sourcepub fn new(i2c: I2C) -> Self
pub fn new(i2c: I2C) -> Self
Creates a new driver instance with the default I2C address (0x36).
Sourcepub fn with_address(i2c: I2C, address: u8) -> Self
pub fn with_address(i2c: I2C, address: u8) -> Self
Creates a new driver instance with a custom I2C address.
Trait Implementations§
Source§impl<I2C: I2c<SevenBitAddress>> AS5600Interface for AS5600Driver<I2C>
impl<I2C: I2c<SevenBitAddress>> AS5600Interface for AS5600Driver<I2C>
Source§fn read_raw_angle(&mut self) -> Result<u16, AS56Error<Self::Error>>
fn read_raw_angle(&mut self) -> Result<u16, AS56Error<Self::Error>>
Reads the raw 12-bit angle from the Hall sensors.
Source§fn read_angle(&mut self) -> Result<u16, AS56Error<Self::Error>>
fn read_angle(&mut self) -> Result<u16, AS56Error<Self::Error>>
Reads the 12-bit angle after applying all settings.
Source§fn get_burn_count(&mut self) -> Result<u8, AS56Error<Self::Error>>
fn get_burn_count(&mut self) -> Result<u8, AS56Error<Self::Error>>
Returns the number of times the settings have been permanently burned to the chip.
Source§fn get_status_raw(&mut self) -> Result<u8, AS56Error<Self::Error>>
fn get_status_raw(&mut self) -> Result<u8, AS56Error<Self::Error>>
Returns the raw value of the status register.
Source§fn get_magnet_status(&mut self) -> Result<MagnetStatus, AS56Error<Self::Error>>
fn get_magnet_status(&mut self) -> Result<MagnetStatus, AS56Error<Self::Error>>
Returns the current magnet status and field strength health.
Source§fn get_magnitude(&mut self) -> Result<u16, AS56Error<Self::Error>>
fn get_magnitude(&mut self) -> Result<u16, AS56Error<Self::Error>>
Returns the magnitude value from the Hall sensors.
Source§fn get_agc(&mut self) -> Result<u8, AS56Error<Self::Error>>
fn get_agc(&mut self) -> Result<u8, AS56Error<Self::Error>>
Returns the current Automatic Gain Control (AGC) value.
Source§fn get_config(&mut self) -> Result<Configuration, AS56Error<Self::Error>>
fn get_config(&mut self) -> Result<Configuration, AS56Error<Self::Error>>
Reads the current full configuration from the chip.
Source§fn set_config(
&mut self,
config: Configuration,
) -> Result<(), AS56Error<Self::Error>>
fn set_config( &mut self, config: Configuration, ) -> Result<(), AS56Error<Self::Error>>
Writes a new configuration to the chip’s volatile memory.
Source§fn get_zero_position(&mut self) -> Result<u16, AS56Error<Self::Error>>
fn get_zero_position(&mut self) -> Result<u16, AS56Error<Self::Error>>
Gets the current zero position (ZPOS).
Source§fn set_zero_position(
&mut self,
angle: u16,
) -> Result<(), AS56Error<Self::Error>>
fn set_zero_position( &mut self, angle: u16, ) -> Result<(), AS56Error<Self::Error>>
Sets the zero position (ZPOS) in volatile memory.
Source§fn get_max_position(&mut self) -> Result<u16, AS56Error<Self::Error>>
fn get_max_position(&mut self) -> Result<u16, AS56Error<Self::Error>>
Gets the current maximum position (MPOS).
Source§fn set_max_position(&mut self, angle: u16) -> Result<(), AS56Error<Self::Error>>
fn set_max_position(&mut self, angle: u16) -> Result<(), AS56Error<Self::Error>>
Sets the maximum position (MPOS) in volatile memory.
Auto Trait Implementations§
impl<I2C> Freeze for AS5600Driver<I2C>where
I2C: Freeze,
impl<I2C> RefUnwindSafe for AS5600Driver<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for AS5600Driver<I2C>where
I2C: Send,
impl<I2C> Sync for AS5600Driver<I2C>where
I2C: Sync,
impl<I2C> Unpin for AS5600Driver<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for AS5600Driver<I2C>where
I2C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more