TR-mbed 1.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ISM330 Class Reference

Interface class for ISM330DHCX IMU using SPI. More...

#include <ISM330.h>

Inheritance diagram for ISM330:
IMU

Classes

struct  ISM330_DATA_TypeDef
 
struct  ISM330_RAW_DATA_TypeDef
 
struct  ISM330_VECTOR_TypeDef
 

Public Member Functions

 ISM330 (I2C &i2c, uint8_t address) noexcept
 
bool begin (float prop_gain=0.1f, float int_gain=0.0f) noexcept
 Initialize communication with the device.
 
uint8_t whoAmI () noexcept
 Read the WHO_AM_I register value.
 
void reset () noexcept
 Issue a software reset to the device.
 
void calibrate () noexcept
 
IMU::EulerAngles getImuAngles () override
 
IMU::EulerAngles read () override
 
ISM330_RAW_DATA_TypeDef readAGraw () noexcept
 
ISM330_DATA_TypeDef readAG () noexcept
 
float readTemperature () noexcept
 
float accelTempScale (float temp)
 
float accelTempOffset (float temp)
 
float gyroTempScale (float temp)
 
float gyroTempOffset (float temp)
 
void getAGVectors (ISM330_VECTOR_TypeDef &accel, ISM330_VECTOR_TypeDef &gyro)
 
void computeAnglesMah (IMU::EulerAngles &angles)
 
void computeAnglesMadgwick (IMU::EulerAngles &angles)
 
void mahonyStart (float prop_gain, float int_gain)
 
void initQuaternionFromAccel ()
 
void mahonyUpdate (float mx, float my, float mz, float dt)
 
void mahonyUpdateIMU (float dt)
 
void madgwickStart (float gain)
 
void madgwickUpdate (float mx, float my, float mz, float dt)
 
void madgwickUpdateIMU (float dt)
 
ISM330_VECTOR_TypeDef readAccel () noexcept
 
ISM330_VECTOR_TypeDef readGyro () noexcept
 
- Public Member Functions inherited from IMU
void init ()
 
void reset ()
 

Detailed Description

Interface class for ISM330DHCX IMU using SPI.

Constructor & Destructor Documentation

◆ ISM330()

ISM330::ISM330 ( I2C &  i2c,
uint8_t  address 
)
noexcept

Member Function Documentation

◆ accelTempOffset()

float ISM330::accelTempOffset ( float  temp)

◆ accelTempScale()

float ISM330::accelTempScale ( float  temp)

◆ begin()

bool ISM330::begin ( float  prop_gain = 0.1f,
float  int_gain = 0.0f 
)
noexcept

Initialize communication with the device.

Performs basic SPI setup and verifies device presence using the WHO_AM_I register.

Returns
true if the device identifier matches the expected chip ID.
false if device detection fails.

◆ calibrate()

void ISM330::calibrate ( )
noexcept

◆ computeAnglesMadgwick()

void ISM330::computeAnglesMadgwick ( IMU::EulerAngles angles)

◆ computeAnglesMah()

void ISM330::computeAnglesMah ( IMU::EulerAngles angles)

◆ getAGVectors()

void ISM330::getAGVectors ( ISM330_VECTOR_TypeDef accel,
ISM330_VECTOR_TypeDef gyro 
)

◆ getImuAngles()

IMU::EulerAngles ISM330::getImuAngles ( )
overridevirtual

Reimplemented from IMU.

◆ gyroTempOffset()

float ISM330::gyroTempOffset ( float  temp)

◆ gyroTempScale()

float ISM330::gyroTempScale ( float  temp)

◆ initQuaternionFromAccel()

void ISM330::initQuaternionFromAccel ( )

◆ madgwickStart()

void ISM330::madgwickStart ( float  gain)

◆ madgwickUpdate()

void ISM330::madgwickUpdate ( float  mx,
float  my,
float  mz,
float  dt 
)

◆ madgwickUpdateIMU()

void ISM330::madgwickUpdateIMU ( float  dt)

◆ mahonyStart()

void ISM330::mahonyStart ( float  prop_gain,
float  int_gain 
)

◆ mahonyUpdate()

void ISM330::mahonyUpdate ( float  mx,
float  my,
float  mz,
float  dt 
)

◆ mahonyUpdateIMU()

void ISM330::mahonyUpdateIMU ( float  dt)

◆ read()

IMU::EulerAngles ISM330::read ( )
inlineoverridevirtual

Reimplemented from IMU.

◆ readAccel()

ISM330::ISM330_VECTOR_TypeDef ISM330::readAccel ( )
noexcept

◆ readAG()

ISM330::ISM330_DATA_TypeDef ISM330::readAG ( )
noexcept

◆ readAGraw()

ISM330::ISM330_RAW_DATA_TypeDef ISM330::readAGraw ( )
noexcept

◆ readGyro()

ISM330::ISM330_VECTOR_TypeDef ISM330::readGyro ( )
noexcept

◆ readTemperature()

float ISM330::readTemperature ( )
noexcept

◆ reset()

void ISM330::reset ( void  )
noexcept

Issue a software reset to the device.

Triggers a soft reset and blocks briefly to allow the device to restart.

◆ whoAmI()

uint8_t ISM330::whoAmI ( )
noexcept

Read the WHO_AM_I register value.

This value should match the documented device ID. Mainly useful for diagnostics or verifying hardware connectivity.

Returns
8-bit device identifier.

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