pub struct Bma222e<I2C> { /* private fields */ }
Expand description
Create an instance of the accelerometer
Implementations
sourceimpl<I2C, E> Bma222e<I2C>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<I2C, E> Bma222e<I2C>where
I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn temperature(&mut self) -> Result<u8, E>
pub fn temperature(&mut self) -> Result<u8, E>
Read the temperature of the chip
sourcepub fn who_am_i(&mut self) -> Result<u8, E>
pub fn who_am_i(&mut self) -> Result<u8, E>
Return the chip’s identifier. While there are many devices in this family, this crate was written for the BMA222E and you should compare this value to REG_CHIPID.
sourcepub fn fifo_set_mode(&mut self, mode: FIFOConfig) -> Result<(), E>
pub fn fifo_set_mode(&mut self, mode: FIFOConfig) -> Result<(), E>
Set the FIFO mode for events
sourcepub fn fifo_overflow(&mut self) -> Result<bool, E>
pub fn fifo_overflow(&mut self) -> Result<bool, E>
Did the event FIFO overflow?
sourcepub fn fifo_get(&mut self, data: &mut [AxisData]) -> Result<(), E>
pub fn fifo_get(&mut self, data: &mut [AxisData]) -> Result<(), E>
Pull accelerometer data from the FIFO.
sourcepub fn element_get(&mut self, register: u8) -> Result<AxisData, E>
pub fn element_get(&mut self, register: u8) -> Result<AxisData, E>
Grab an axis and create an AxisData
sourcepub fn eeprom_writes_remaining(&mut self) -> Result<u8, E>
pub fn eeprom_writes_remaining(&mut self) -> Result<u8, E>
How many writes are left in the device’s EEPROM. Each write will decrement this counter and the chip will deny writes at zero, so use any writes sparingly. The counter is only four bits wide (16 total writes)
sourcepub fn eeprom_data(&mut self) -> Result<[u8; 5], E>
pub fn eeprom_data(&mut self) -> Result<[u8; 5], E>
Pull values from internal EEPROM
Auto Trait Implementations
impl<I2C> RefUnwindSafe for Bma222e<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for Bma222e<I2C>where
I2C: Send,
impl<I2C> Sync for Bma222e<I2C>where
I2C: Sync,
impl<I2C> Unpin for Bma222e<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for Bma222e<I2C>where
I2C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more