modm API documentation
modm::bmi088< Transport > Class Template Reference

#include <modm/driver/inertial/bmi088.hpp>

Inheritance diagram for modm::bmi088< Transport >:

Classes

struct  AccData
 
struct  GyroData
 

Public Types

enum  AccRange : uint8_t { Range3g = 0x00, Range6g = 0x01, Range12g = 0x02, Range24g = 0x03 }
 
enum  GyroRange : uint8_t {
  Range2000dps = 0x00, Range1000dps = 0x01, Range500dps = 0x02, Range250dps = 0x03,
  Range125dps = 0x04
}
 
enum  AccRate : uint8_t {
  Rate12Hz_Bw5Hz = 0x5 | 0xA0, Rate12Hz_Bw2Hz = 0x5 | 0x90, Rate12Hz_Bw1Hz = 0x5 | 0x80, Rate25Hz_Bw10Hz = 0x6 | 0xA0,
  Rate25Hz_Bw5Hz = 0x6 | 0x90, Rate25Hz_Bw3Hz = 0x6 | 0x80, Rate50Hz_Bw20Hz = 0x7 | 0xA0, Rate50Hz_Bw9Hz = 0x7 | 0x90,
  Rate50Hz_Bw5Hz = 0x7 | 0x80, Rate100Hz_Bw40Hz = 0x8 | 0xA0, Rate100Hz_Bw19Hz = 0x8 | 0x90, Rate100Hz_Bw10Hz = 0x8 | 0x80,
  Rate200Hz_Bw80Hz = 0x9 | 0xA0, Rate200Hz_Bw38Hz = 0x9 | 0x90, Rate200Hz_Bw20Hz = 0x9 | 0x80, Rate400Hz_Bw145Hz = 0xA | 0xA0,
  Rate400Hz_Bw75Hz = 0xA | 0x90, Rate400Hz_Bw40Hz = 0xA | 0x80, Rate800Hz_Bw230Hz = 0xB | 0xA0, Rate800Hz_Bw140Hz = 0xB | 0x90,
  Rate800Hz_Bw80Hz = 0xB | 0x80, Rate1600Hz_Bw280Hz = 0xC | 0xA0, Rate1600Hz_Bw234Hz = 0xC | 0x90, Rate1600Hz_Bw145Hz = 0xC | 0x80
}
 Accelerometer data rate and filter bandwidth config.
 
enum  AccGpioConfig : uint8_t { ActiveHigh = Bit1, OpenDrain = Bit2, EnableOutput = Bit3, EnableInput = Bit4 }
 
enum  AccGpioMap : uint8_t {
  Int1FifoFull = Bit0, Int1FifoWatermark = Bit1, Int1DataReady = Bit2, Int2FifoFull = Bit4,
  Int2FifoWatermark = Bit5, Int2DataReady = Bit6
}
 Configuration flags to map accelerometer interrupt signal to GPIO.
 
enum  AccStatus : uint8_t { DataReady = Bit7 }
 
enum  AccPowerConf : uint8_t { Active = 0x00, Suspend = 0x03 }
 
enum  AccPowerControl : uint8_t { Off = 0x00, On = 0x04 }
 
enum  AccSelfTest : uint8_t { Off = 0x00, Positive = 0x0D, Negative = 0x09 }
 
enum  GyroRate : uint8_t {
  Rate2000Hz_Bw532Hz = 0x00, Rate2000Hz_Bw230Hz = 0x01, Rate1000Hz_Bw116Hz = 0x02, Rate400Hz_Bw47Hz = 0x03,
  Rate200Hz_Bw23Hz = 0x04, Rate100Hz_Bw12Hz = 0x05, Rate200Hz_Bw64Hz = 0x06, Rate100Hz_Bw32Hz = 0x07
}
 Gyroscope data rate and filter bandwidth config.
 
enum  GyroGpioConfig : uint8_t { Int3ActiveHigh = Bit0, Int3OpenDrain = Bit1, Int4ActiveHigh = Bit2, Int4OpenDrain = Bit3 }
 
enum  GyroGpioMap : uint8_t { Int3DataReady = Bit0, Int3FifoInterrupt = Bit2, Int4FifoInterrupt = Bit5, Int4DataReady = Bit7 }
 
enum  GyroSelfTest : uint8_t { RateOk = Bit4, Fail = Bit2, Ready = Bit1, Trigger = Bit0 }
 
enum  GyroStatus : uint8_t { DataReady = Bit7, FifoInterrupt = Bit4 }
 
enum  GyroInterruptControl : uint8_t { Fifo = Bit6, DataReady = Bit7 }
 

Public Member Functions

 MODM_FLAGS8 (AccGpioConfig)
 
 MODM_FLAGS8 (AccGpioMap)
 
 MODM_FLAGS8 (AccStatus)
 
 MODM_FLAGS8 (GyroGpioConfig)
 
 MODM_FLAGS8 (GyroGpioMap)
 
 MODM_FLAGS8 (GyroSelfTest)
 
 MODM_FLAGS8 (GyroStatus)
 
 MODM_FLAGS8 (GyroInterruptControl)
 
template<typename... Args>
 Bmi088 (Args...transportArgs)
 
bool initialize (bool runSelfTest)
 
std::optional< AccDatareadAccData ()
 
bool readAccDataReady ()
 Read data ready flag from ACC_STATUS register. Cleared on data read.
 
bool clearAccDataReadyInterrupt ()
 Read and clear data ready flag in ACC_INT_STAT_1 register. Not cleared on data read.
 
bool setAccRate (AccRate config)
 
bool setAccRange (AccRange range)
 
bool setAccInt1GpioConfig (AccGpioConfig_t config)
 
bool setAccInt2GpioConfig (AccGpioConfig_t config)
 
bool setAccGpioMap (AccGpioMap_t map)
 
std::optional< GyroDatareadGyroData ()
 
bool readGyroDataReady ()
 
bool setGyroRate (GyroRate config)
 
bool setGyroRange (GyroRange range)
 
bool setGyroGpioConfig (GyroGpioConfig_t config)
 
bool setGyroGpioMap (GyroGpioMap_t map)
 

Detailed Description

template<Bmi088Transport Transport>
class modm::bmi088< Transport >

Bosch BMI088 IMU

The device contains an accelerometer and a gyroscope which operate independently.

The device supports both I2C and SPI. For applications with high data rates or strict timing requirements SPI is recommended.

The "MM Feature Set" accelerometer functions are not supported yet.

Template Parameters
TransportTransport layer (use Bmi088SpiTransport or Bmi088I2cTransport)

Member Function Documentation

template<Bmi088Transport Transport>
template<typename... Args>
modm::bmi088< Transport >::Bmi088 ( Args...  transportArgs)
  • transportArgs Arguments to transport layer. Pass addresses for I2C, none for SPI.
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::initialize ( bool  runSelfTest)

Initialize device. Call before any other member function.

Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::readGyroDataReady ( )

Read Data ready interrupt status.

Warning
The interrupt is cleared automatically after 280-400 μs.
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setAccGpioMap ( AccGpioMap_t  map)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setAccInt1GpioConfig ( AccGpioConfig_t  config)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setAccInt2GpioConfig ( AccGpioConfig_t  config)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setAccRange ( AccRange  range)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setAccRate ( AccRate  config)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setGyroGpioConfig ( GyroGpioConfig_t  config)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setGyroGpioMap ( GyroGpioMap_t  map)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setGyroRange ( GyroRange  range)
Returns
true on success, false on error
template<Bmi088Transport Transport>
bool modm::bmi088< Transport >::setGyroRate ( GyroRate  config)
Returns
true on success, false on error

The documentation for this class was generated from the following file: