pub struct Bmi270<I2C> { /* private fields */ }Implementations§
Source§impl<I2C> Bmi270<I2C>
impl<I2C> Bmi270<I2C>
pub const fn new(i2c: I2C) -> Self
pub fn set_accel_offset(&mut self, offset: Vector3)
pub fn set_gyro_offset(&mut self, offset: Vector3)
pub fn release(self) -> I2C
Source§impl<I2C, Error> Bmi270<I2C>where
I2C: I2c<Error = Error>,
impl<I2C, Error> Bmi270<I2C>where
I2C: I2c<Error = Error>,
Sourcepub fn init(&mut self, config: Bmi270Config) -> Result<(), Error>
pub fn init(&mut self, config: Bmi270Config) -> Result<(), Error>
Initializes the BMI270 register settings that do not require a delay provider.
CoreS3 firmware should prefer Self::init_with_delay because BMI270
requires delays while resetting and loading its mandatory configuration file.
pub fn init_with_delay( &mut self, config: Bmi270Config, delay: &mut impl DelayNs, ) -> Result<(), Error>
pub fn configure(&mut self, config: Bmi270Config) -> Result<(), Error>
pub fn chip_id(&mut self) -> Result<u8, Error>
pub fn is_expected_chip(&mut self) -> Result<bool, Error>
Sourcepub fn internal_status(&mut self) -> Result<u8, Error>
pub fn internal_status(&mut self) -> Result<u8, Error>
Returns the BMI270 internal status register.
After a successful config upload the lower nibble should report 0x01
(init_ok). Other values indicate that acceleration/gyro data may stay
invalid or zero.
Sourcepub fn interrupt_status_1(&mut self) -> Result<u8, Error>
pub fn interrupt_status_1(&mut self) -> Result<u8, Error>
Returns the BMI270 interrupt/status register used to observe data-ready bits.
Sourcepub fn power_control(&mut self) -> Result<u8, Error>
pub fn power_control(&mut self) -> Result<u8, Error>
Returns the BMI270 power-control register.
Sourcepub fn init_bmm150_aux(&mut self, delay: &mut impl DelayNs) -> Result<u8, Error>
pub fn init_bmm150_aux(&mut self, delay: &mut impl DelayNs) -> Result<u8, Error>
Initializes the CoreS3 BMM150 magnetometer through the BMI270 auxiliary I2C bus.
CoreS3 wires BMM150 behind BMI270’s AUX sensor-hub interface, so it is not reachable as a normal device on the board internal I2C bus.
Sourcepub fn bmm150_aux_magnetic_raw(&mut self) -> Result<Vector3, Error>
pub fn bmm150_aux_magnetic_raw(&mut self) -> Result<Vector3, Error>
Reads BMM150 raw magnetic data from BMI270’s auxiliary data window.
Sourcepub fn bmm150_aux_magnetic_raw_manual(
&mut self,
delay: &mut impl DelayNs,
) -> Result<Vector3, Error>
pub fn bmm150_aux_magnetic_raw_manual( &mut self, delay: &mut impl DelayNs, ) -> Result<Vector3, Error>
Performs an explicit BMM150 data-register burst read through BMI270’s AUX bus.
This is useful for hardware validation because it does not depend on the BMI270 sensor-hub shadow window updating automatically between samples.