modm API documentation
modm::Bmi088I2cTransport< I2cMaster > Class Template Reference

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

Inheritance diagram for modm::Bmi088I2cTransport< I2cMaster >:
modm::Bmi088TransportBase modm::I2cDevice< I2cMaster >

Public Types

enum  AccRegister : uint8_t {
  ChipId = 0x00, Error = 0x02, Status = 0x03, DataXLow = 0x12,
  DataXHigh = 0x13, DataYLow = 0x14, DataYHigh = 0x15, DataZLow = 0x16,
  DataZHigh = 0x17, SensorTime0 = 0x18, SensorTime1 = 0x19, SensorTime2 = 0x1A,
  InterruptStatus = 0x1D, TempHigh = 0x22, TempLow = 0x23, FifoLength0 = 0x24,
  FifoLength1 = 0x25, FifoData = 0x26, Config = 0x40, Range = 0x41,
  FifoDownsampling = 0x45, FifoWatermark0 = 0x46, FifoWatermark1 = 0x47, FifoConfig0 = 0x48,
  FifoConfig1 = 0x49, Int1Control = 0x53, Int2Control = 0x54, IntMap = 0x58,
  SelfTest = 0x6D, PowerConfig = 0x7C, PowerControl = 0x7D, SoftReset = 0x7E
}
 
enum  GyroRegister : uint8_t {
  ChipId = 0x00, RateXLow = 0x02, RateXHigh = 0x03, RateYLow = 0x04,
  RateYHigh = 0x05, RateZLow = 0x06, RateZHigh = 0x07, InterruptStatus = 0x0A,
  FifoStatus = 0x0E, Range = 0x0F, Bandwidth = 0x10, LowPowerMode1 = 0x11,
  SoftReset = 0x14, InterruptControl = 0x15, Int3Int4Conf = 0x16, Int3Int4Map = 0x18,
  FifoWatermark = 0x1E, FifoExtInt = 0x34, SelfTest = 0x3C, FifoConfig0 = 0x3D,
  FifoConfig1 = 0x3E, FifoData = 0x3F
}
 

Public Member Functions

 Bmi088I2cTransport (uint8_t accAddress, uint8_t gyroAddress)
 
 Bmi088I2cTransport (const Bmi088I2cTransport &) = delete
 
Bmi088I2cTransport & operator= (const Bmi088I2cTransport &) = delete
 
void initialize ()
 
std::span< uint8_t > readRegisters (AccRegister startReg, uint8_t count)
 
std::span< uint8_t > readRegisters (GyroRegister startReg, uint8_t count)
 
bool writeRegister (AccRegister reg, uint8_t data)
 
bool writeRegister (GyroRegister reg, uint8_t data)
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 
bool ping ()
 
bool read (uint8_t *buffer, std::size_t size)
 Starts a write transaction and waits until finished.
 
void setAddress (uint8_t address)
 
bool write (const uint8_t *buffer, std::size_t size)
 Starts a write transaction and waits until finished.
 
bool writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize)
 Starts a write-read transaction and waits until finished.
 

Static Public Attributes

static constexpr uint8_t MaxRegisterSequence {6}
 

Protected Member Functions

bool isTransactionRunning ()
 
bool runTransaction ()
 Starts our own transaction and waits until finished.
 
bool startTransaction ()
 Starts the transaction with our own transaction object.
 
bool startTransaction (modm::I2cTransaction *transaction)
 Starts the transaction with a separate transaction object.
 
bool wasTransactionSuccessful ()
 

Protected Attributes

I2cWriteReadTransaction transaction
 

Detailed Description

template<typename I2cMaster>
class modm::Bmi088I2cTransport< I2cMaster >

BMI088 I2C transport. Pass as template parameter to Bmi088 driver class to use the driver with I2C.

Template Parameters
I2cMasterI2c master the device is connected to

Member Function Documentation

void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::attachConfigurationHandler ( I2c::ConfigurationHandler  handler)
inheritedinline

Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.

bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::isTransactionRunning ( )
inheritedinlineprotected
Returns
true when transaction is busy.
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::ping ( )
inheritedinline
Return Values
truedevice responds to address
falseno device with address found
void modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::setAddress ( uint8_t  address)
inheritedinline

Sets a new address of the slave device.

Parameters
addressthe slave address not yet shifted left (address < 128).
bool modm::I2cDevice< I2cMaster, 10 , I2cWriteReadTransaction >::wasTransactionSuccessful ( )
inheritedinlineprotected
Returns
true when transaction did not return an error.

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