| ICM42370P eMD Driver 2.2.7 Documentation of the eMD Driver API

- Main Page
- Related Pages
- Modules
- Classes
- Files

Files | Classes | Typedefs | Functions
APEX

High-level functions to drive APEX features. More...

## Files
file | inv_imu_apex.h

## Classes
struct | inv_imu_apex_parameters_t
| IMU APEX inputs parameters definition. More...
struct | inv_imu_apex_step_activity
| APEX pedometer outputs. More...

## Typedefs
typedef struct inv_imu_apex_step_activity | inv_imu_apex_step_activity_t
| APEX pedometer outputs. More...

## Functions
int | inv_imu_apex_enable_ff (struct inv_imu_device *s)
| Enable Free Fall. More...
int | inv_imu_apex_disable_ff (struct inv_imu_device *s)
| Disable Free Fall. More...
int | inv_imu_apex_enable_smd (struct inv_imu_device *s)
| Enable Significant Motion Detection. More...
int | inv_imu_apex_disable_smd (struct inv_imu_device *s)
| Disable Significant Motion Detection. More...
int | inv_imu_apex_init_parameters_struct (struct inv_imu_device *s, inv_imu_apex_parameters_t *apex_inputs)
| Fill the APEX parameters structure with all the default parameters for APEX algorithms. More...
int | inv_imu_apex_configure_parameters (struct inv_imu_device *s, const inv_imu_apex_parameters_t *apex_inputs)
| Configures DMP parameters for APEX algorithms. More...
int | inv_imu_apex_get_parameters (struct inv_imu_device *s, inv_imu_apex_parameters_t *apex_params)
| Returns current DMP parameters for APEX algorithms. More...
int | inv_imu_apex_set_frequency (struct inv_imu_device *s, const APEX_CONFIG1_DMP_ODR_t frequency)
| Configure DMP Output Data Rate for APEX algorithms. More...
int | inv_imu_apex_enable_pedometer (struct inv_imu_device *s)
| Enable APEX algorithm Pedometer. More...
int | inv_imu_apex_disable_pedometer (struct inv_imu_device *s)
| Disable APEX algorithm Pedometer. More...
int | inv_imu_apex_enable_tilt (struct inv_imu_device *s)
| Enable APEX algorithm Tilt. More...
int | inv_imu_apex_disable_tilt (struct inv_imu_device *s)
| Disable APEX algorithm Tilt. More...
int | inv_imu_apex_get_data_activity (struct inv_imu_device *s, inv_imu_apex_step_activity_t *apex_activity)
| Retrieve APEX pedometer outputs and format them. More...
int | inv_imu_apex_get_data_free_fall (struct inv_imu_device *s, uint16_t *freefall_duration)
| Retrieve APEX free fall outputs and format them. More...

## Detailed Description

High-level functions to drive APEX features.

## Typedef Documentation

## ◆ inv_imu_apex_step_activity_t

typedef struct inv_imu_apex_step_activity inv_imu_apex_step_activity_t

APEX pedometer outputs.

## Function Documentation

## ◆ inv_imu_apex_configure_parameters()

int inv_imu_apex_configure_parameters | ( | struct inv_imu_device * | s,
|  | const inv_imu_apex_parameters_t * | apex_inputs
| ) |  |

Configures DMP parameters for APEX algorithms.

Parameters

  [in] | s | Pointer to device.
  [in] | apex_inputs | The requested input parameters.

Returns
  0 on success, negative value on error.

Warning
  APEX inputs can't change on the fly, this should be called before enabling any APEX features.
  This API can't be called twice within 10 ms.

## ◆ inv_imu_apex_disable_ff()

int inv_imu_apex_disable_ff | ( | struct inv_imu_device * | s | ) |

Disable Free Fall.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_disable_pedometer()

int inv_imu_apex_disable_pedometer | ( | struct inv_imu_device * | s | ) |

Disable APEX algorithm Pedometer.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_disable_smd()

int inv_imu_apex_disable_smd | ( | struct inv_imu_device * | s | ) |

Disable Significant Motion Detection.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_disable_tilt()

int inv_imu_apex_disable_tilt | ( | struct inv_imu_device * | s | ) |

Disable APEX algorithm Tilt.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_enable_ff()

int inv_imu_apex_enable_ff | ( | struct inv_imu_device * | s | ) |

Enable Free Fall.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_enable_pedometer()

int inv_imu_apex_enable_pedometer | ( | struct inv_imu_device * | s | ) |

Enable APEX algorithm Pedometer.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_enable_smd()

int inv_imu_apex_enable_smd | ( | struct inv_imu_device * | s | ) |

Enable Significant Motion Detection.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

Warning
  SMD requires to have the pedometer enabled to work.

## ◆ inv_imu_apex_enable_tilt()

int inv_imu_apex_enable_tilt | ( | struct inv_imu_device * | s | ) |

Enable APEX algorithm Tilt.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_get_data_activity()

int inv_imu_apex_get_data_activity | ( | struct inv_imu_device * | s,
|  | inv_imu_apex_step_activity_t * | apex_activity
| ) |  |

Retrieve APEX pedometer outputs and format them.

Parameters

  [in] | s | Pointer to device.
  [out] | apex_activity | Apex step and activity data value.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_get_data_free_fall()

int inv_imu_apex_get_data_free_fall | ( | struct inv_imu_device * | s,
|  | uint16_t * | freefall_duration
| ) |  |

Retrieve APEX free fall outputs and format them.

Parameters

  [in] | s | Pointer to device.
  [out] | freefall_duration | Free fall duration in number of sample.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_get_parameters()

int inv_imu_apex_get_parameters | ( | struct inv_imu_device * | s,
|  | inv_imu_apex_parameters_t * | apex_params
| ) |  |

Returns current DMP parameters for APEX algorithms.

Parameters

  [in] | s | Pointer to device.
  [out] | apex_params | The current parameter, fetched from registers.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_init_parameters_struct()

int inv_imu_apex_init_parameters_struct | ( | struct inv_imu_device * | s,
|  | inv_imu_apex_parameters_t * | apex_inputs
| ) |  |

Fill the APEX parameters structure with all the default parameters for APEX algorithms.

Parameters

  [in] | s | Pointer to device.
  [out] | apex_inputs | Default input parameters.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_apex_set_frequency()

int inv_imu_apex_set_frequency | ( | struct inv_imu_device * | s,
|  | const APEX_CONFIG1_DMP_ODR_t | frequency
| ) |  |

Configure DMP Output Data Rate for APEX algorithms.

Parameters

  [in] | s | Pointer to device.
  [in] | frequency | The requested frequency.

Returns
  0 on success, negative value on error.

Warning
  Accel frequency must be higher or equal to DMP frequency.