APIs description¶
Doxygen complete API documentation¶
Parent classes¶
Main class ICM42688_SPI
derives from ABSTRACT_SENSOR_SPI and ABSTRACT_IMU which are documented in ABSTRACT_SENSORS.
Available classes¶
ICM42688_SPI¶
-
class ICM42688_SPI : public ABSTRACT_SENSOR_SPI, public ABSTRACT_IMU¶
Public Functions
-
void readFifo()¶
Read the fifo and fill the output struct.
This method will read the fifo, extract gyrometer, accelerometer values and temperature values, and apply corrections to them.
-
void readFifoFast()¶
Reads data from the FIFO buffer without checking status.
This function reads data from the FIFO buffer of the ICM42688 without checking fifo status and without going for last value stored. The function will read the same values as readFifo but will be faster, with the possiblity of reading older values.
-
void setGyroOdrRange(ICM42688_ENUM::ODR freq, ICM42688_ENUM::GYRO_RANGE range)¶
Sets the gyroscope output data rate (ODR) and range.
- Parameters:
freq – The desired gyroscope output data rate.
range – The desired gyroscope range.
-
void setAccOdrRange(ICM42688_ENUM::ODR freq, ICM42688_ENUM::ACC_RANGE range)¶
Set the accelerometer output data rate (ODR) and range.
- Parameters:
freq – The desired accelerometer output data rate.
range – The desired accelerometer range.
-
void setGyroAccelFilter(ICM42688_ENUM::FILTER_BW gyroBW, ICM42688_ENUM::FILTER_BW accBW, ICM42688_ENUM::FILTER_ORDER gyroFiltOrder, ICM42688_ENUM::FILTER_ORDER accFiltOrder)¶
Sets the filter parameters for the gyroscope and accelerometer.
- Parameters:
gyroBW – The bandwidth of the gyroscope filter.
accBW – The bandwidth of the accelerometer filter.
gyroFiltOrder – The filter order for the gyroscope.
accFiltOrder – The filter order for the accelerometer.
-
void setTempFilter(ICM42688_ENUM::TEMP_DLPF_BW tempBw)¶
Set the temperature filter bandwidth.
- Parameters:
tempBw – The bandwidth of the temperature filter.
-
void softResetSensor()¶
Resets the sensor to its default state.
This function performs a software reset on the sensor, restoring it to its default configuration. After the reset, the sensor will be in a known state and ready for further operations.
-
void flushFifo(bool printStatus)¶
Flushes the FIFO buffer.
- Parameters:
printStatus – If true, prints the status of the flush operation.
-
void setApexWOM(uint8_t xThreshold, uint8_t yThreshold, uint8_t zThreshold, ICM42688_ENUM::APEX_WOM_INT_MODE womIntMode, ICM42688_ENUM::APEX_WOM_MODE womMode, ICM42688_ENUM::APEX_SMD_MODE smdMode)¶
Sets the Apex Wake-on-Motion (WOM) parameters.
Example:
icm.setApexWOM(3, 3, 3, ICM42688_ENUM::APEX_WOM_INT_MODE::WOM_INT_MODE_OR, ICM42688_ENUM::APEX_WOM_MODE::WOM_MODE_DELTA, ICM42688_ENUM::APEX_SMD_MODE::SMD_RESERVED);
- Parameters:
xThreshold – The threshold value for the X-axis -> X /256. If X=256, the threshold is 1g.
yThreshold – The threshold value for the Y-axis -> Y /256. If Y=256, the threshold is 1g.
zThreshold – The threshold value for the Z-axis -> Z /256. If Z=256, the threshold is 1g.
womIntMode – The WOM interrupt mode: 0 for OR, 1 for AND.
womMode – The WOM mode: 0 is absolute accelerometer threshold, 1 is relative accelerometer values from the previous sample.
smdMode – The SMD mode.
-
const ICM42688_STRUCTS::APEX_STATUS &getApexStatus()¶
Retrieves the Apex status of the ICM42688 sensor.
- Returns:
The Apex status of the ICM42688 sensor.
-
void readFifo()¶
ICM42688_REGISTERS¶
-
struct ICM42688_REGISTERS¶
ICM42688_REGISTER_VALUES¶
-
struct ICM42688_REGISTER_VALUES¶