pub struct Bmi270<I2C> { /* private fields */ }Expand description
BMI270 driver.
Implementations§
Source§impl<I2C: I2c> Bmi270<I2C>
impl<I2C: I2c> Bmi270<I2C>
Sourcepub async fn init(
&mut self,
config: Config,
delay: &mut impl DelayNs,
) -> Result<(), Error<I2C::Error>>
pub async fn init( &mut self, config: Config, delay: &mut impl DelayNs, ) -> Result<(), Error<I2C::Error>>
Resets the chip, uploads CONFIG_FILE, and starts both sensors
with config. Takes roughly 250 ms at 400 kHz, mostly the upload.
Sourcepub async fn configure(
&mut self,
config: Config,
) -> Result<(), Error<I2C::Error>>
pub async fn configure( &mut self, config: Config, ) -> Result<(), Error<I2C::Error>>
Changes ranges and rate. The chip must already be initialised.
Sourcepub async fn read_raw(&mut self) -> Result<RawSample, I2C::Error>
pub async fn read_raw(&mut self) -> Result<RawSample, I2C::Error>
Reads both sensors in one 12-byte burst.
Sourcepub async fn read(&mut self) -> Result<Sample, I2C::Error>
pub async fn read(&mut self) -> Result<Sample, I2C::Error>
Reads both sensors, scaled to g and °/s.
Sourcepub async fn temperature(&mut self) -> Result<Option<f32>, I2C::Error>
pub async fn temperature(&mut self) -> Result<Option<f32>, I2C::Error>
Die temperature in °C, or None while no valid reading exists yet.