pub struct IcmBuilder<TRANSPORT, DELAY> { /* private fields */ }Expand description
Implementations§
Source§impl<BUS, DELAY> IcmBuilder<I2cDevice<BUS>, DELAY>
impl<BUS, DELAY> IcmBuilder<I2cDevice<BUS>, DELAY>
Sourcepub fn new_i2c(bus: BUS, delay: DELAY) -> IcmBuilder<I2cDevice<BUS>, DELAY>
pub fn new_i2c(bus: BUS, delay: DELAY) -> IcmBuilder<I2cDevice<BUS>, DELAY>
Creates an uninitialized IMU struct with a default config.
Sourcepub fn set_address(
self,
address: impl Into<I2cAddress>,
) -> IcmBuilder<I2cDevice<BUS>, DELAY>
pub fn set_address( self, address: impl Into<I2cAddress>, ) -> IcmBuilder<I2cDevice<BUS>, DELAY>
Set I2C address of ICM module. See I2cAddress for defaults, otherwise u8 implements Into<I2cAddress>
Note: This will not change the actual address, only the address used by this driver.
Source§impl<SPI, DELAY> IcmBuilder<SpiDevice<SPI>, DELAY>
impl<SPI, DELAY> IcmBuilder<SpiDevice<SPI>, DELAY>
Sourcepub fn new_spi(spi: SPI, delay: DELAY) -> IcmBuilder<SpiDevice<SPI>, DELAY>
pub fn new_spi(spi: SPI, delay: DELAY) -> IcmBuilder<SpiDevice<SPI>, DELAY>
Creates an uninitialized IMU struct with a default config.
Source§impl<TRANPORT, DELAY> IcmBuilder<TRANPORT, DELAY>where
TRANPORT: Icm20948Transport,
DELAY: DelayNs,
impl<TRANPORT, DELAY> IcmBuilder<TRANPORT, DELAY>where
TRANPORT: Icm20948Transport,
DELAY: DelayNs,
Sourcepub fn with_config(self, config: Config) -> IcmBuilder<TRANPORT, DELAY>
pub fn with_config(self, config: Config) -> IcmBuilder<TRANPORT, DELAY>
Set the whole IMU config at once
Sourcepub fn acc_range(self, acc_range: AccRange) -> IcmBuilder<TRANPORT, DELAY>
pub fn acc_range(self, acc_range: AccRange) -> IcmBuilder<TRANPORT, DELAY>
Set accelerometer measuring range, choises are 2G, 4G, 8G or 16G
Sourcepub fn acc_dlp(self, acc_dlp: AccDlp) -> IcmBuilder<TRANPORT, DELAY>
pub fn acc_dlp(self, acc_dlp: AccDlp) -> IcmBuilder<TRANPORT, DELAY>
Set accelerometer digital lowpass filter frequency
Sourcepub fn acc_unit(self, acc_unit: AccUnit) -> IcmBuilder<TRANPORT, DELAY>
pub fn acc_unit(self, acc_unit: AccUnit) -> IcmBuilder<TRANPORT, DELAY>
Set returned unit of accelerometer measurement, choises are Gs or m/s^2
Sourcepub fn acc_odr(self, acc_odr: u16) -> IcmBuilder<TRANPORT, DELAY>
pub fn acc_odr(self, acc_odr: u16) -> IcmBuilder<TRANPORT, DELAY>
Set accelerometer output data rate
Sourcepub fn gyr_range(self, gyr_range: GyrRange) -> IcmBuilder<TRANPORT, DELAY>
pub fn gyr_range(self, gyr_range: GyrRange) -> IcmBuilder<TRANPORT, DELAY>
Set gyroscope measuring range, choises are 250Dps, 500Dps, 1000Dps and 2000Dps
Sourcepub fn gyr_dlp(self, gyr_dlp: GyrDlp) -> IcmBuilder<TRANPORT, DELAY>
pub fn gyr_dlp(self, gyr_dlp: GyrDlp) -> IcmBuilder<TRANPORT, DELAY>
Set gyroscope digital low pass filter frequency
Sourcepub fn gyr_unit(self, gyr_unit: GyrUnit) -> IcmBuilder<TRANPORT, DELAY>
pub fn gyr_unit(self, gyr_unit: GyrUnit) -> IcmBuilder<TRANPORT, DELAY>
Set returned unit of gyroscope measurement, choises are degrees/s or radians/s
Sourcepub fn gyr_odr(self, gyr_odr: u8) -> IcmBuilder<TRANPORT, DELAY>
pub fn gyr_odr(self, gyr_odr: u8) -> IcmBuilder<TRANPORT, DELAY>
Set gyroscope output data rate
Sourcepub async fn initialize_6dof(
self,
) -> Result<Icm20948<TRANPORT, MagDisabled>, SetupError<TRANPORT::Error>>
pub async fn initialize_6dof( self, ) -> Result<Icm20948<TRANPORT, MagDisabled>, SetupError<TRANPORT::Error>>
Initializes the IMU with accelerometer and gyroscope
Sourcepub async fn initialize_9dof(
self,
) -> Result<Icm20948<TRANPORT, MagEnabled>, SetupError<TRANPORT::Error>>
pub async fn initialize_9dof( self, ) -> Result<Icm20948<TRANPORT, MagEnabled>, SetupError<TRANPORT::Error>>
Initializes the IMU with accelerometer, gyroscope and magnetometer