modm API documentation
modm::Ixm42xxx< Transport > Struct Template Reference

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

Public Typedefs

typedef modm::Configuration< RegBankSel_t, BankSel, Bit2|Bit1|Bit0 > BankSel_t
 
typedef modm::Configuration< DeviceConfig_t, DataMode, Bit4 > DataMode_t
 
typedef modm::Configuration< DeviceConfig_t, SoftResetConfig, Bit0 > SoftResetConfig_t
 
typedef modm::Configuration< DriveConfig_t, SlewRate, Bit2|Bit1|Bit0, 3 > I2cSlewRate_t
 
typedef modm::Configuration< DriveConfig_t, SlewRate, Bit2|Bit1|Bit0, 0 > SpiSlewRate_t
 
typedef modm::Configuration< FifoConfig_t, FifoMode, Bit7|Bit6 > FifoMode_t
 
typedef modm::Configuration< IntfConfig0_t, UiSifsCfg, Bit1|Bit0 > UiSifsCfg_t
 
typedef modm::Configuration< IntfConfig1_t, ClkSel, Bit1|Bit0 > ClkSel_t
 
typedef modm::Configuration< PwrMgmt0_t, GyroMode, Bit3|Bit2 > GyroMode_t
 
typedef modm::Configuration< PwrMgmt0_t, AccelMode, Bit1|Bit0 > AccelMode_t
 
typedef modm::Configuration< GyroConfig0_t, GyroFs, Bit2|Bit1|Bit0, 5 > GyroFs_t
 
typedef modm::Configuration< GyroConfig0_t, GyroOdr, Bit3|Bit2|Bit1|Bit0 > GyroOdr_t
 
typedef modm::Configuration< AccelConfig0_t, AccelFs, Bit2|Bit1|Bit0, 5 > AccelFs_t
 
typedef modm::Configuration< AccelConfig0_t, AccelOdr, Bit3|Bit2|Bit1|Bit0 > AccelOdr_t
 
typedef modm::Configuration< GyroConfig1_t, TempFiltBw, Bit2|Bit1|Bit0, 5 > TempFiltBw_t
 
typedef modm::Configuration< GyroConfig1_t, GyroUiFiltOrd, Bit3|Bit2 > GyroUiFiltOrd_t
 
typedef modm::Configuration< GyroConfig1_t, GyroDec2M2Ord, Bit1|Bit0 > GyroDec2M2Ord_t
 
typedef modm::Configuration< GyroAccelCongfig0_t, UiFiltBw, Bit3|Bit2|Bit1|Bit0, 4 > AccelUiFiltBw_t
 
typedef modm::Configuration< GyroAccelCongfig0_t, UiFiltBw, Bit3|Bit2|Bit1|Bit0, 0 > GyroUiFiltBw_t
 
typedef modm::Configuration< AccelConfig1_t, AccelUiFiltOrd, Bit3|Bit2 > AccelUiFiltOrd_t
 
typedef modm::Configuration< AccelConfig1_t, AccelDec2M2Ord, Bit1|Bit0 > AccelDec2M2Ord_t
 
typedef modm::Configuration< ApexConfig0_t, DmpOdr, Bit1|Bit0 > DmpOdr_t
 
typedef modm::Configuration< SmdConfig_t, SmdMode, Bit1|Bit0 > SmdMode_t
 
typedef modm::Configuration< FsyncConfig_t, FsyncUiSel, Bit2|Bit1|Bit0, 4 > FsyncUiSel_t
 
typedef modm::Configuration< IntConfig0_t, UiDrdyIntClear, Bit5|Bit4 > UiDrdyIntClear_t
 
typedef modm::Configuration< IntConfig0_t, FifoThsIntClear, Bit3|Bit2 > FifoThsIntClear_t
 
typedef modm::Configuration< IntConfig0_t, FifoFullIntClear, Bit3|Bit2 > FifoFullIntClear_t
 
using Register_t = FlagsGroup< RegBankSel_t, DeviceConfig_t, DriveConfig_t, IntConfig_t, FifoConfig_t, SignalPathReset_t, IntfConfig0_t, IntfConfig1_t, PwrMgmt0_t, GyroConfig0_t, AccelConfig0_t, GyroConfig1_t, GyroAccelCongfig0_t, AccelConfig1_t, TmstConfig_t, ApexConfig0_t, SmdConfig_t, FifoConfig1_t, FsyncConfig_t, IntConfig0_t, IntConfig1_t, IntSource0_t, IntSource1_t, IntSource3_t, IntSource4_t, SelfTestConfig_t >
 

Public Types

enum  Register : uint16_t
 
enum  RegBankSel : uint8_t
 REG_BANK_SEL reset value is 0x00.
 
enum  BankSel : uint8_t
 
enum  DeviceConfig : uint8_t
 DEVICE_CONFIG reset value is 0x00.
 
enum  DataMode : uint8_t
 
enum  SoftResetConfig : uint8_t
 
enum  DriveConfig : uint8_t
 DRIVE_CONFIG reset value is 0x05.
 
enum  SlewRate : uint8_t
 
enum  IntConfig : uint8_t
 INT_CONFIG reset value is 0x00.
 
enum  FifoConfig : uint8_t
 FIFO_CONFIG reset value is 0x00.
 
enum  FifoMode : uint8_t
 
enum  IntStatus : uint8_t
 INT_STATUS reset value is 0x10.
 
enum  IntStatus2 : uint8_t
 INT_STATUS2 reset value is 0x00.
 
enum  IntStatus3 : uint8_t
 INT_STATUS3 reset value is 0x00.
 
enum  SignalPathReset : uint8_t
 SIGNAL_PATH_RESET reset value is 0x00.
 
enum  IntfConfig0 : uint8_t
 INTF_CONFIG0 reset value is 0x30.
 
enum  UiSifsCfg : uint8_t
 
enum  IntfConfig1 : uint8_t
 INTF_CONFIG1 reset value is 0x91.
 
enum  ClkSel : uint8_t
 
enum  PwrMgmt0 : uint8_t
 PWR_MGMT0 reset value is 0x00.
 
enum  GyroMode : uint8_t
 
enum  AccelMode : uint8_t
 
enum  GyroConfig0 : uint8_t
 GYRO_CONFIG0 reset value is 0x06.
 
enum  GyroFs : uint8_t
 
enum  GyroOdr : uint8_t
 
enum  AccelConfig0 : uint8_t
 ACCEL_CONFIG0 reset value is 0x06.
 
enum  AccelFs : uint8_t
 
enum  AccelOdr : uint8_t
 
enum  GyroConfig1 : uint8_t
 GYRO_CONFIG1 reset value is 0x16.
 
enum  TempFiltBw : uint8_t
 
enum  GyroUiFiltOrd : uint8_t
 
enum  GyroDec2M2Ord : uint8_t
 
enum  GyroAccelCongfig0 : uint8_t
 GYRO_ACCEL_CONFIG0 reset value is 0x11.
 
enum  UiFiltBw : uint8_t
 
enum  AccelConfig1 : uint8_t
 ACCEL_CONFIG1 reset value is 0x0D.
 
enum  AccelUiFiltOrd : uint8_t
 
enum  AccelDec2M2Ord : uint8_t
 
enum  TmstConfig : uint8_t
 TMST_CONFIG reset value is 0x23.
 
enum  ApexConfig0 : uint8_t
 APEX_CONFIG0 reset value is 0x82.
 
enum  DmpOdr : uint8_t
 
enum  SmdConfig : uint8_t
 SMD_CONFIG reset value is 0x00.
 
enum  SmdMode : uint8_t
 
enum  FifoConfig1 : uint8_t
 FIFO_CONFIG1 reset value is 0x00.
 
enum  FsyncConfig : uint8_t
 FSYNC_CONFIG reset value is 0x10.
 
enum  FsyncUiSel : uint8_t
 
enum  IntConfig0 : uint8_t
 INT_CONFIG0 reset value is 0x00.
 
enum  UiDrdyIntClear : uint8_t
 
enum  FifoThsIntClear : uint8_t
 
enum  FifoFullIntClear : uint8_t
 
enum  IntConfig1 : uint8_t
 INT_CONFIG1 reset value is 0x10.
 
enum  IntSource0 : uint8_t
 INT_SOURCE0 reset value is 0x10.
 
enum  IntSource1 : uint8_t
 INT_SOURCE1 reset value is 0x00.
 
enum  IntSource3 : uint8_t
 INT_SOURCE3 reset value is 0x00.
 
enum  IntSource4 : uint8_t
 INT_SOURCE4 reset value is 0x00.
 
enum  SelfTestConfig : uint8_t
 SELF_TEST_CONFIG reset value is 0x00.
 

Public Member Functions

 Ixm42xxx (Data &data, uint8_t address=0b11010000)
 Constructor. More...
 
modm::ResumableResult< void > initialize ()
 Initialize the device to use default settings and the endianess of the microcontroller. More...
 
modm::ResumableResult< bool > readTempData ()
 Read the temperature data from the device. More...
 
modm::ResumableResult< bool > readAccelData ()
 Read the accel data from the device. More...
 
modm::ResumableResult< bool > readGyroData ()
 Read the gyro data from the device. More...
 
modm::ResumableResult< bool > readSensorData ()
 Read the sensor data from the device. More...
 
modm::ResumableResult< bool > readFsyncTimestamp (uint16_t *timestamp)
 Read the FSYNC timestamp from the device. More...
 
modm::ResumableResult< bool > readFifoCount (uint16_t *count)
 Read the FIFO count from the device. More...
 
modm::ResumableResult< bool > readFifoData ()
 Read the FIFO data from the device. More...
 
modm::ResumableResult< bool > writeFifoWatermark (uint16_t watermark)
 Set the FIFO watermark used to generate FIFO_WM_GT interrupt. More...
 
modm::ResumableResult< bool > updateRegister (Register reg, Register_t setMask, Register_t clearMask=Register_t (0xff))
 update a single register. More...
 
modm::ResumableResult< bool > writeRegister (Register reg, uint8_t value)
 Write a single register. More...
 
modm::ResumableResult< bool > readRegister (Register reg, uint8_t *value)
 Read a single register. More...
 
modm::ResumableResult< bool > readRegister (Register reg, uint8_t *buffer, std::size_t length)
 Read consecutive registers. More...
 
DatagetData ()
 Get the data object for this sensor.
 
 MODM_FLAGS8 (RegBankSel)
 
 MODM_FLAGS8 (DeviceConfig)
 
 MODM_FLAGS8 (DriveConfig)
 
 MODM_FLAGS8 (IntConfig)
 
 MODM_FLAGS8 (FifoConfig)
 
 MODM_FLAGS8 (IntStatus)
 
 MODM_FLAGS8 (IntStatus2)
 
 MODM_FLAGS8 (IntStatus3)
 
 MODM_FLAGS8 (SignalPathReset)
 
 MODM_FLAGS8 (IntfConfig0)
 
 MODM_FLAGS8 (IntfConfig1)
 
 MODM_FLAGS8 (PwrMgmt0)
 
 MODM_FLAGS8 (GyroConfig0)
 
 MODM_FLAGS8 (AccelConfig0)
 
 MODM_FLAGS8 (GyroConfig1)
 
 MODM_FLAGS8 (GyroAccelCongfig0)
 
 MODM_FLAGS8 (AccelConfig1)
 
 MODM_FLAGS8 (TmstConfig)
 
 MODM_FLAGS8 (ApexConfig0)
 
 MODM_FLAGS8 (SmdConfig)
 
 MODM_FLAGS8 (FifoConfig1)
 
 MODM_FLAGS8 (FsyncConfig)
 
 MODM_FLAGS8 (IntConfig0)
 
 MODM_FLAGS8 (IntConfig1)
 
 MODM_FLAGS8 (IntSource0)
 
 MODM_FLAGS8 (IntSource1)
 
 MODM_FLAGS8 (IntSource3)
 
 MODM_FLAGS8 (IntSource4)
 
 MODM_FLAGS8 (SelfTestConfig)
 

Protected Member Functions

modm::ResumableResult< bool > setRegisterBank (Register regi)
 

Detailed Description

template<class Transport>
struct modm::Ixm42xxx< Transport >

Template Parameters
TransportEither the I2C or SPI Transport Layer.
See also
Ixm42xxxTransportI2c
Ixm42xxxTransportSpi
Author
Rasmus Kleist Hørlyck Sørensen

Constructor & Destructor Documentation

template<class Transport >
modm::Ixm42xxx< Transport >::Ixm42xxx ( Data data,
uint8_t  address = 0b11010000 
)

Constructor.

Parameters
dataA ixm42xxx::data object
addressthe I2C address of the device

Member Function Documentation

template<class Transport >
modm::ResumableResult<void> modm::Ixm42xxx< Transport >::initialize ( )

Initialize the device to use default settings and the endianess of the microcontroller.

Warning
Calling this functions resets the device and blocks for 1 ms
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readAccelData ( )

Read the accel data from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readFifoCount ( uint16_t *  count)

Read the FIFO count from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readFifoData ( )

Read the FIFO data from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readFsyncTimestamp ( uint16_t *  timestamp)

Read the FSYNC timestamp from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readGyroData ( )

Read the gyro data from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readRegister ( Register  reg,
uint8_t *  buffer,
std::size_t  length 
)

Read consecutive registers.

Parameters
regThe register to start reading from
dataThe placeholder for the read values to be stored
Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readRegister ( Register  reg,
uint8_t *  value 
)

Read a single register.

Parameters
regThe register to be read
valueThe placeholder for the read value to be stored
Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readSensorData ( )

Read the sensor data from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::readTempData ( )

Read the temperature data from the device.

Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::updateRegister ( Register  reg,
Register_t  setMask,
Register_t  clearMask = Register_t (0xff) 
)

update a single register.

Parameters
regThe register to be updated
setMaskThe bits to be setted in the register
clearMaskThe bits to be cleared in the register.
Returns
False in case of any error, e.g. if some register access is not permitted.
Warning
Only the registers GYRO_CONFIG0, ACCEL_CONFIG0 and PWR_MGMT0 can be modified during sensor operation
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::writeFifoWatermark ( uint16_t  watermark)

Set the FIFO watermark used to generate FIFO_WM_GT interrupt.

Warning
The FIFO watermarkl should be set, before choosing this interrupt source.
Returns
False in case of any error, e.g. if some register access is not permitted.
template<class Transport >
modm::ResumableResult<bool> modm::Ixm42xxx< Transport >::writeRegister ( Register  reg,
uint8_t  value 
)

Write a single register.

Parameters
regThe register to be read
valueThe value to write to the register
Returns
False in case of any error, e.g. if some register access is not permitted.
Warning
Only the registers GYRO_CONFIG0, ACCEL_CONFIG0 and PWR_MGMT0 can be modified during sensor operation

The documentation for this struct was generated from the following files: