|
ICM42670 Portable Driver
Public API reference for the ICM-42670-P IMU driver
|
ICM-42670-P APEX motion feature functions. More...

Enumerations | |
| enum | ICM42670_ApexState_t { ICM42670_APEX_DISABLE = 0U , ICM42670_APEX_ENABLE = 1U } |
Functions | |
| ICM42670_Status_t | ICM42670_Init_Apex (const ICM42670_Config *config) |
| Initialize the APEX DMP block before enabling tilt/pedometer features. | |
| ICM42670_Status_t | ICM42670_Enable_Pedo (const ICM42670_Config *config, const ICM42670_PedoConfig_t *pedo_config) |
| Pedometer tracks step count and issues a step detect interrupt. | |
| ICM42670_Status_t | ICM42670_Disable_Pedo (const ICM42670_Config *config) |
| Disable pedometer reporting. | |
| ICM42670_Status_t | ICM42670_Read_Pedo (const ICM42670_Config *config, ICM42670_PedoData_t *pedo_data) |
| Read pedometer data and read-clear step status flags. | |
| ICM42670_Status_t | ICM42670_Enable_Tilt (const ICM42670_Config *config, const ICM42670_TiltConfig_t *tilt_config) |
| Tilt detection issues an interrupt when the tilt angle exceeds 35 degrees for more than a programmable time. | |
| ICM42670_Status_t | ICM42670_Disable_Tilt (const ICM42670_Config *config) |
| Disable tilt detection. | |
| ICM42670_Status_t | ICM42670_Read_Tilt (const ICM42670_Config *config, uint8_t *tilt_detected) |
| Read and clear the tilt event flag. | |
| ICM42670_Status_t | ICM42670_Enable_Low_G (const ICM42670_Config *config, const ICM42670_LowGConfig_t *low_g_config) |
| Low-g detection triggers an interrupt when the absolute value of the accelerometer combined axis falls below a programmable threshold and stays below the threshold for a programmable time. | |
| ICM42670_Status_t | ICM42670_Disable_Low_G (const ICM42670_Config *config) |
| Disable low-g detection. | |
| ICM42670_Status_t | ICM42670_Read_Low_G (const ICM42670_Config *config, uint8_t *low_g_detected) |
| Read and clear the low-g event flag. | |
| ICM42670_Status_t | ICM42670_Enable_Free_Fall (const ICM42670_Config *config, const ICM42670_FreeFallConfig_t *free_fall_config) |
| Freefall detection triggers an interrupt when device freefall is detected and outputs freefall duration. | |
| ICM42670_Status_t | ICM42670_Disable_Free_Fall (const ICM42670_Config *config) |
| Disable freefall detection. | |
| ICM42670_Status_t | ICM42670_Read_Free_Fall (const ICM42670_Config *config, ICM42670_FreeFallData_t *free_fall_data) |
| Read freefall data and read-clear the freefall event flag. | |
| ICM42670_Status_t | ICM42670_Enable_Wake_On_Motion (const ICM42670_Config *config, const ICM42670_WakeOnMotionConfig_t *wake_on_motion_config) |
| Wake on Motion detects motion when accelerometer samples exceed a programmable threshold. This motion event can be used to enable device operation from sleep mode. | |
| ICM42670_Status_t | ICM42670_Disable_Wake_On_Motion (const ICM42670_Config *config) |
| Disable wake-on-motion detection. | |
| ICM42670_Status_t | ICM42670_Read_Wake_On_Motion (const ICM42670_Config *config, ICM42670_WakeOnMotionData_t *wake_on_motion_data) |
| Read and clear wake-on-motion axis flags. | |
| ICM42670_Status_t | ICM42670_Enable_Significant_Motion (const ICM42670_Config *config, const ICM42670_SignificantMotionConfig_t *significant_motion_config) |
| Significant Motion Detector detects significant motion based on accelerometer data. | |
| ICM42670_Status_t | ICM42670_Disable_Significant_Motion (const ICM42670_Config *config) |
| Disable significant-motion detection. | |
| ICM42670_Status_t | ICM42670_Read_Significant_Motion (const ICM42670_Config *config, uint8_t *significant_motion_detected) |
| Read and clear the significant-motion event flag. | |
| ICM42670_Status_t | ICM42670_Read_Apex (const ICM42670_Config *config, ICM42670_ApexData_t *apex_data) |
| Read a combined APEX data snapshot. | |
ICM-42670-P APEX motion feature functions.
| ICM42670_Status_t ICM42670_Disable_Free_Fall | ( | const ICM42670_Config * | config | ) |
Disable freefall detection.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Disable_Low_G | ( | const ICM42670_Config * | config | ) |
Disable low-g detection.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Disable_Pedo | ( | const ICM42670_Config * | config | ) |
Disable pedometer reporting.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Disable_Significant_Motion | ( | const ICM42670_Config * | config | ) |
Disable significant-motion detection.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Disable_Tilt | ( | const ICM42670_Config * | config | ) |
Disable tilt detection.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Disable_Wake_On_Motion | ( | const ICM42670_Config * | config | ) |
Disable wake-on-motion detection.
| config | Driver configuration with read and write callbacks. |
| ICM42670_Status_t ICM42670_Enable_Free_Fall | ( | const ICM42670_Config * | config, |
| const ICM42670_FreeFallConfig_t * | free_fall_config | ||
| ) |
Freefall detection triggers an interrupt when device freefall is detected and outputs freefall duration.
| config | Driver configuration with read and write callbacks. |
| free_fall_config | Freefall setup values. |
References ICM42670_FreeFallConfig_t::debounce_ms, ICM42670_ERROR, ICM42670_OK, ICM42670_FreeFallConfig_t::max_distance_cm, and ICM42670_FreeFallConfig_t::min_distance_cm.
| ICM42670_Status_t ICM42670_Enable_Low_G | ( | const ICM42670_Config * | config, |
| const ICM42670_LowGConfig_t * | low_g_config | ||
| ) |
Low-g detection triggers an interrupt when the absolute value of the accelerometer combined axis falls below a programmable threshold and stays below the threshold for a programmable time.
| config | Driver configuration with read and write callbacks. |
| low_g_config | Low-g setup values. |
References ICM42670_ERROR, ICM42670_OK, ICM42670_LowGConfig_t::sample_count, and ICM42670_LowGConfig_t::threshold_mg.
| ICM42670_Status_t ICM42670_Enable_Pedo | ( | const ICM42670_Config * | config, |
| const ICM42670_PedoConfig_t * | pedo_config | ||
| ) |
Pedometer tracks step count and issues a step detect interrupt.
| config | Driver configuration with read and write callbacks. |
| pedo_config | Pedometer setup values. |
References ICM42670_ERROR, ICM42670_OK, and ICM42670_PedoConfig_t::slow_walk_enable.
| ICM42670_Status_t ICM42670_Enable_Significant_Motion | ( | const ICM42670_Config * | config, |
| const ICM42670_SignificantMotionConfig_t * | significant_motion_config | ||
| ) |
Significant Motion Detector detects significant motion based on accelerometer data.
| config | Driver configuration with read and write callbacks. |
| significant_motion_config | Significant-motion setup values. |
References ICM42670_ERROR, ICM42670_OK, and ICM42670_SignificantMotionConfig_t::sensitivity_level.
| ICM42670_Status_t ICM42670_Enable_Tilt | ( | const ICM42670_Config * | config, |
| const ICM42670_TiltConfig_t * | tilt_config | ||
| ) |
Tilt detection issues an interrupt when the tilt angle exceeds 35 degrees for more than a programmable time.
| config | Driver configuration with read and write callbacks. |
| tilt_config | Tilt setup values. |
References ICM42670_ERROR, ICM42670_OK, and ICM42670_TiltConfig_t::wait_time_s.
| ICM42670_Status_t ICM42670_Enable_Wake_On_Motion | ( | const ICM42670_Config * | config, |
| const ICM42670_WakeOnMotionConfig_t * | wake_on_motion_config | ||
| ) |
Wake on Motion detects motion when accelerometer samples exceed a programmable threshold. This motion event can be used to enable device operation from sleep mode.
| config | Driver configuration with read and write callbacks. |
| wake_on_motion_config | Wake-on-motion threshold setup. |
References ICM42670_ERROR, ICM42670_OK, ICM42670_WakeOnMotionConfig_t::x_threshold_mg, ICM42670_WakeOnMotionConfig_t::y_threshold_mg, and ICM42670_WakeOnMotionConfig_t::z_threshold_mg.
| ICM42670_Status_t ICM42670_Init_Apex | ( | const ICM42670_Config * | config | ) |
Initialize the APEX DMP block before enabling tilt/pedometer features.
This sets DMP_ODR to 50 Hz, disables DMP power-save for direct polling use, resets APEX memory, and runs the DMP initialization command.
| config | Driver configuration with read, write, and delay callbacks. |
References ICM42670_Config::delay_ms, ICM42670_ERROR, and ICM42670_OK.
| ICM42670_Status_t ICM42670_Read_Apex | ( | const ICM42670_Config * | config, |
| ICM42670_ApexData_t * | apex_data | ||
| ) |
Read a combined APEX data snapshot.
This is the preferred read path when multiple APEX features are enabled, because INT_STATUS2 and INT_STATUS3 are read-clear.
| config | Driver configuration with a read callback. |
| apex_data | Destination for combined APEX data. |
References ICM42670_PedoData_t::activity, ICM42670_PedoData_t::cadence_raw, ICM42670_FreeFallData_t::detected, ICM42670_FreeFallData_t::duration_samples, ICM42670_ApexData_t::free_fall, ICM42670_ERROR, ICM42670_OK, ICM42670_ApexData_t::low_g_detected, ICM42670_PedoData_t::overflow, ICM42670_ApexData_t::pedo, ICM42670_ApexData_t::significant_motion_detected, ICM42670_PedoData_t::step_count, ICM42670_PedoData_t::step_detected, ICM42670_ApexData_t::tilt_detected, ICM42670_ApexData_t::wake_on_motion, ICM42670_WakeOnMotionData_t::x_detected, ICM42670_WakeOnMotionData_t::y_detected, and ICM42670_WakeOnMotionData_t::z_detected.
| ICM42670_Status_t ICM42670_Read_Free_Fall | ( | const ICM42670_Config * | config, |
| ICM42670_FreeFallData_t * | free_fall_data | ||
| ) |
Read freefall data and read-clear the freefall event flag.
| config | Driver configuration with a read callback. |
| free_fall_data | Destination for freefall data. |
References ICM42670_FreeFallData_t::detected, ICM42670_FreeFallData_t::duration_samples, ICM42670_ERROR, and ICM42670_OK.
| ICM42670_Status_t ICM42670_Read_Low_G | ( | const ICM42670_Config * | config, |
| uint8_t * | low_g_detected | ||
| ) |
Read and clear the low-g event flag.
| config | Driver configuration with a read callback. |
| low_g_detected | Destination flag, nonzero when low-g was reported. |
References ICM42670_ERROR, and ICM42670_OK.
| ICM42670_Status_t ICM42670_Read_Pedo | ( | const ICM42670_Config * | config, |
| ICM42670_PedoData_t * | pedo_data | ||
| ) |
Read pedometer data and read-clear step status flags.
| config | Driver configuration with a read callback. |
| pedo_data | Destination for pedometer data. |
References ICM42670_PedoData_t::activity, ICM42670_PedoData_t::cadence_raw, ICM42670_BUSY, ICM42670_ERROR, ICM42670_OK, ICM42670_PedoData_t::overflow, ICM42670_PedoData_t::step_count, and ICM42670_PedoData_t::step_detected.
| ICM42670_Status_t ICM42670_Read_Significant_Motion | ( | const ICM42670_Config * | config, |
| uint8_t * | significant_motion_detected | ||
| ) |
Read and clear the significant-motion event flag.
| config | Driver configuration with a read callback. |
| significant_motion_detected | Destination flag, nonzero when reported. |
References ICM42670_ERROR, and ICM42670_OK.
| ICM42670_Status_t ICM42670_Read_Tilt | ( | const ICM42670_Config * | config, |
| uint8_t * | tilt_detected | ||
| ) |
Read and clear the tilt event flag.
| config | Driver configuration with a read callback. |
| tilt_detected | Destination flag, nonzero when tilt was reported. |
References ICM42670_ERROR, and ICM42670_OK.
| ICM42670_Status_t ICM42670_Read_Wake_On_Motion | ( | const ICM42670_Config * | config, |
| ICM42670_WakeOnMotionData_t * | wake_on_motion_data | ||
| ) |
Read and clear wake-on-motion axis flags.
| config | Driver configuration with a read callback. |
| wake_on_motion_data | Destination for axis flags. |
References ICM42670_ERROR, ICM42670_OK, ICM42670_WakeOnMotionData_t::x_detected, ICM42670_WakeOnMotionData_t::y_detected, and ICM42670_WakeOnMotionData_t::z_detected.