pub struct Icm20948<TRANSPORT, MAG> { /* private fields */ }Expand description
An initialized IMU. Use the IcmBuilder to construct a new instance.
Implementations§
Source§impl<TRANSPORT, MAG> Icm20948<TRANSPORT, MAG>where
TRANSPORT: Icm20948Transport,
impl<TRANSPORT, MAG> Icm20948<TRANSPORT, MAG>where
TRANSPORT: Icm20948Transport,
Sourcepub async fn device_reset(
&mut self,
delay: &mut impl DelayNs,
) -> Result<(), TRANSPORT::Error>
pub async fn device_reset( &mut self, delay: &mut impl DelayNs, ) -> Result<(), TRANSPORT::Error>
Reset accelerometer / gyroscope module
Sourcepub async fn set_acc_range(
&mut self,
range: AccRange,
) -> Result<(), TRANSPORT::Error>
pub async fn set_acc_range( &mut self, range: AccRange, ) -> Result<(), TRANSPORT::Error>
Configure acceleromter to measure with given range
Sourcepub async fn set_gyr_range(
&mut self,
range: GyrRange,
) -> Result<(), TRANSPORT::Error>
pub async fn set_gyr_range( &mut self, range: GyrRange, ) -> Result<(), TRANSPORT::Error>
Configure gyroscope to measure with given range
Sourcepub fn set_acc_unit(&mut self, unit: AccUnit)
pub fn set_acc_unit(&mut self, unit: AccUnit)
Set returned unit of accelerometer
Sourcepub fn set_gyr_unit(&mut self, unit: GyrUnit)
pub fn set_gyr_unit(&mut self, unit: GyrUnit)
Set returned unit of gyroscope
Sourcepub async fn set_acc_dlp(
&mut self,
acc_dlp: AccDlp,
) -> Result<(), TRANSPORT::Error>
pub async fn set_acc_dlp( &mut self, acc_dlp: AccDlp, ) -> Result<(), TRANSPORT::Error>
Set (or disable) accelerometer digital low-pass filter
Sourcepub async fn set_gyr_dlp(
&mut self,
gyr_dlp: GyrDlp,
) -> Result<(), TRANSPORT::Error>
pub async fn set_gyr_dlp( &mut self, gyr_dlp: GyrDlp, ) -> Result<(), TRANSPORT::Error>
Set (or disable) gyroscope digital low-pass filter
Source§impl<TRANSPORT> Icm20948<TRANSPORT, MagEnabled>where
TRANSPORT: Icm20948Transport,
impl<TRANSPORT> Icm20948<TRANSPORT, MagEnabled>where
TRANSPORT: Icm20948Transport,
Sourcepub async fn read_mag(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
pub async fn read_mag(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
Get vector of scaled magnetometer values
Sourcepub async fn read_mag_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
pub async fn read_mag_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
Get array of unscaled accelerometer values
Source§impl<TRANSPORT, MAG> Icm20948<TRANSPORT, MAG>where
TRANSPORT: Icm20948Transport,
impl<TRANSPORT, MAG> Icm20948<TRANSPORT, MAG>where
TRANSPORT: Icm20948Transport,
Sourcepub async fn read_acc_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
pub async fn read_acc_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
Get array of unscaled accelerometer values
Sourcepub async fn read_acc(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
pub async fn read_acc(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
Get array of scaled accelerometer values
Sourcepub async fn read_gyr_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
pub async fn read_gyr_unscaled(&mut self) -> Result<[i16; 3], TRANSPORT::Error>
Get array of unscaled gyroscope values
Sourcepub async fn read_gyr(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
pub async fn read_gyr(&mut self) -> Result<[f32; 3], TRANSPORT::Error>
Get array of scaled gyroscope values
Sourcepub async fn read_6dof(&mut self) -> Result<Data6Dof<f32>, TRANSPORT::Error>
pub async fn read_6dof(&mut self) -> Result<Data6Dof<f32>, TRANSPORT::Error>
Get scaled measurements for accelerometer and gyroscope, and temperature
Sourcepub async fn read_6dof_unscaled(
&mut self,
) -> Result<Data6Dof<i16>, TRANSPORT::Error>
pub async fn read_6dof_unscaled( &mut self, ) -> Result<Data6Dof<i16>, TRANSPORT::Error>
Get unscaled measurements for accelerometer and gyroscope, and temperature
Sourcepub async fn set_gyr_offsets(
&mut self,
offsets: [i16; 3],
) -> Result<(), TRANSPORT::Error>
pub async fn set_gyr_offsets( &mut self, offsets: [i16; 3], ) -> Result<(), TRANSPORT::Error>
Set gyroscope calibration offsets by writing them to the IMU
Sourcepub async fn set_acc_offsets(
&mut self,
offsets: [i16; 3],
) -> Result<(), TRANSPORT::Error>
pub async fn set_acc_offsets( &mut self, offsets: [i16; 3], ) -> Result<(), TRANSPORT::Error>
Set accelerometer calibration offsets by writing them to the IMU
Sourcepub async fn new_data_ready(&mut self) -> u8
pub async fn new_data_ready(&mut self) -> u8
Returns the number of new readings in FIFO buffer
Sourcepub const fn acc_scalar(&self) -> f32
pub const fn acc_scalar(&self) -> f32
Returns the scalar corresponding to the unit and range configured
Sourcepub const fn gyr_scalar(&self) -> f32
pub const fn gyr_scalar(&self) -> f32
Returns the scalar corresponding to the unit and range configured