ICM42670 Portable Driver
Public API reference for the ICM-42670-P IMU driver
Loading...
Searching...
No Matches
ICM42670_fsync.c File Reference

FSYNC configuration and polling helpers for the ICM-42670-P. More...

#include "ICM42670_fsync.h"
#include "ICM42670_internal.h"
#include <stddef.h>
Include dependency graph for ICM42670_fsync.c:

Functions

ICM42670_Status_t ICM42670_Enable_Fsync (const ICM42670_Config *config, const ICM42670_FsyncConfig_t *fsync_config)
 Enable FSYNC timestamp capture with simple defaults.
 
ICM42670_Status_t ICM42670_Disable_Fsync (const ICM42670_Config *config)
 Disable FSYNC timestamp capture and clear FSYNC interrupt routing.
 
ICM42670_Status_t ICM42670_Read_Fsync (const ICM42670_Config *config, ICM42670_FsyncData_t *fsync_data)
 Read the read-clear FSYNC event status and latest FSYNC timestamp.
 

Detailed Description

FSYNC configuration and polling helpers for the ICM-42670-P.

Function Documentation

◆ ICM42670_Disable_Fsync()

ICM42670_Status_t ICM42670_Disable_Fsync ( const ICM42670_Config config)

Disable FSYNC timestamp capture and clear FSYNC interrupt routing.

Parameters
configDriver configuration with read, write, and delay callbacks.
Returns
ICM42670_OK on success, otherwise ICM42670_ERROR or ICM42670_BUSY.

References ICM42670_ERROR, ICM42670_FSYNC_INT_NONE, and ICM42670_OK.

◆ ICM42670_Enable_Fsync()

ICM42670_Status_t ICM42670_Enable_Fsync ( const ICM42670_Config config,
const ICM42670_FsyncConfig_t fsync_config 
)

Enable FSYNC timestamp capture with simple defaults.

Passing NULL for fsync_config selects rising-edge FSYNC, no UI data LSB tag, clear-on-sensor-update behavior, and no interrupt routing.

Parameters
configDriver configuration with read, write, and delay callbacks.
fsync_configOptional FSYNC configuration, or NULL for defaults.
Returns
ICM42670_OK on success, otherwise ICM42670_ERROR or ICM42670_BUSY.

References ICM42670_FsyncConfig_t::clear_mode, ICM42670_ERROR, ICM42670_FSYNC_CLEAR_ON_TAGGED_LSB_READ, ICM42670_FSYNC_FALLING_EDGE, ICM42670_OK, ICM42670_FsyncConfig_t::interrupt_pin, ICM42670_FsyncConfig_t::polarity, and ICM42670_FsyncConfig_t::tag.

◆ ICM42670_Read_Fsync()

ICM42670_Status_t ICM42670_Read_Fsync ( const ICM42670_Config config,
ICM42670_FsyncData_t fsync_data 
)

Read the read-clear FSYNC event status and latest FSYNC timestamp.

Parameters
configDriver configuration with a read callback.
fsync_dataDestination for event status and timestamp data.
Returns
ICM42670_OK on success, otherwise ICM42670_ERROR.

References ICM42670_FsyncData_t::event_detected, ICM42670_ERROR, ICM42670_OK, ICM42670_FsyncData_t::raw_status, and ICM42670_FsyncData_t::timestamp_delta_us.