| eMD IIM4265x Driver API 1.0.0

Files | Data Structures | Typedefs | Functions
Ixm42xxx driver high level functions related to APEX

High-level function to setup an Ixm42xxx device. More...

## Files
file | Ixm42xxxDriver_HL_apex.h

## Data Structures
struct | inv_ixm42xxx_tap_parameters_t
| Ixm42xxx TAP inputs parameters definition. More...
struct | inv_ixm42xxx_apex_parameters
| Ixm42xxx APEX inputs parameters definition. More...
struct | inv_ixm42xxx_apex_step_activity
| APEX pedometer outputs. More...
struct | inv_ixm42xxx_tap_data
| TAP outputs. More...

## Typedefs
typedef struct inv_ixm42xxx_apex_parameters | inv_ixm42xxx_apex_parameters_t
| Ixm42xxx APEX inputs parameters definition. More...
typedef struct inv_ixm42xxx_apex_step_activity | inv_ixm42xxx_apex_step_activity_t
| APEX pedometer outputs. More...
typedef struct inv_ixm42xxx_tap_data | inv_ixm42xxx_tap_data_t
| TAP outputs. More...

## Functions
int | inv_ixm42xxx_configure_smd_wom (struct inv_ixm42xxx *s, const uint8_t x_th, const uint8_t y_th, const uint8_t z_th, IXM42XXX_SMD_CONFIG_WOM_INT_MODE_t wom_int, IXM42XXX_SMD_CONFIG_WOM_MODE_t wom_mode)
| Configure Wake On Motion and SMD thresholds. More...
int | inv_ixm42xxx_enable_wom (struct inv_ixm42xxx *s)
| Enable Wake On Motion. note : WoM requests to have the accelerometer enabled to work. Enables WoM event generation and configures interrupt to fire on WoM event. As a consequence Fifo water-mark interrupt is disabled. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 20ms and the accelerometer in Low Power Mode. More...
int | inv_ixm42xxx_disable_wom (struct inv_ixm42xxx *s)
| Disable Wake On Motion. Disables WoM event generation and reconfigures interrupt to fire on Fifo water-mark. More...
int | inv_ixm42xxx_enable_smd (struct inv_ixm42xxx *s)
| Enable Significant Motion Detection. note : SMD requests to have the accelerometer enabled to work. Enables SMD event generation and configures interrupt to fire on SMD event. WoM event will also be generated. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 20ms and the accelerometer in Low Power Mode. More...
int | inv_ixm42xxx_disable_smd (struct inv_ixm42xxx *s)
| Disable Significant Motion Detection. Disables SMD event generation and disables SMD interrupt. More...
int | inv_ixm42xxx_init_tap_parameters_struct (struct inv_ixm42xxx *s, inv_ixm42xxx_tap_parameters_t *tap_inputs)
| Fill the TAP parameters structure with all the default parameters for TAP algorithm. More...
int | inv_ixm42xxx_configure_tap_parameters (struct inv_ixm42xxx *s, const inv_ixm42xxx_tap_parameters_t *tap_inputs)
| Configure TAP. More...
int | inv_ixm42xxx_get_tap_parameters (struct inv_ixm42xxx *s, inv_ixm42xxx_tap_parameters_t *tap_params)
| Returns current TAP parameters. More...
int | inv_ixm42xxx_enable_tap (struct inv_ixm42xxx *s)
| Enable TAP. note : TAP requests to have the accelerometer enabled to work. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 1ms and the accelerometer in Low Noise Mode. More...
int | inv_ixm42xxx_disable_tap (struct inv_ixm42xxx *s)
| Disable TAP. More...
int | inv_ixm42xxx_init_apex_parameters_struct (struct inv_ixm42xxx *s, inv_ixm42xxx_apex_parameters_t *apex_inputs)
| Fill the APEX parameters structure with all the default parameters for APEX algorithms (pedometer, tilt) More...
int | inv_ixm42xxx_configure_apex_parameters (struct inv_ixm42xxx *s, const inv_ixm42xxx_apex_parameters_t *apex_inputs)
| Configures DMP parameters for APEX algorithms (pedometer, tilt). This programmable parameters will be decoded and propagate to the SRAM to be executed at DMP start. More...
int | inv_ixm42xxx_get_apex_parameters (struct inv_ixm42xxx *s, inv_ixm42xxx_apex_parameters_t *apex_params)
| Returns current DMP parameters for APEX algorithms (pedometer, tilt). More...
int | inv_ixm42xxx_set_apex_frequency (struct inv_ixm42xxx *s, const IXM42XXX_APEX_CONFIG0_DMP_ODR_t frequency)
| Configure DMP Output Data Rate for APEX algorithms (pedometer, tilt) More...
int | inv_ixm42xxx_start_dmp (struct inv_ixm42xxx *s)
| Start DMP for APEX algorithms. More...
int | inv_ixm42xxx_enable_apex_pedometer (struct inv_ixm42xxx *s)
| Enable APEX algorithm Pedometer. note : Pedometer request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency. More...
int | inv_ixm42xxx_disable_apex_pedometer (struct inv_ixm42xxx *s)
| Disable APEX algorithm Pedometer. More...
int | inv_ixm42xxx_enable_apex_r2w (struct inv_ixm42xxx *s)
| Enable APEX algorithm Raise to wake. note : Raise to wake request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency. More...
int | inv_ixm42xxx_disable_apex_r2w (struct inv_ixm42xxx *s)
| Disable APEX algorithm Raise to wake. More...
int | inv_ixm42xxx_enable_apex_tilt (struct inv_ixm42xxx *s)
| Enable APEX algorithm Tilt. note : Tilt request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency. More...
int | inv_ixm42xxx_disable_apex_tilt (struct inv_ixm42xxx *s)
| Disable APEX algorithm Tilt. More...
int | inv_ixm42xxx_get_apex_data_activity (struct inv_ixm42xxx *s, inv_ixm42xxx_apex_step_activity_t *apex_activity)
| Retrieve APEX pedometer outputs and format them. More...
int | inv_ixm42xxx_get_tap_data (struct inv_ixm42xxx *s, inv_ixm42xxx_tap_data_t *tap_data)
| Retrieve tap outputs. More...

## Detailed Description

High-level function to setup an Ixm42xxx device.

## Typedef Documentation

## ◆ inv_ixm42xxx_apex_parameters_t

typedef struct inv_ixm42xxx_apex_parameters inv_ixm42xxx_apex_parameters_t

Ixm42xxx APEX inputs parameters definition.

## ◆ inv_ixm42xxx_apex_step_activity_t

typedef struct inv_ixm42xxx_apex_step_activity inv_ixm42xxx_apex_step_activity_t

APEX pedometer outputs.

## ◆ inv_ixm42xxx_tap_data_t

typedef struct inv_ixm42xxx_tap_data inv_ixm42xxx_tap_data_t

TAP outputs.

## Function Documentation

## ◆ inv_ixm42xxx_configure_apex_parameters()

int inv_ixm42xxx_configure_apex_parameters | ( | struct inv_ixm42xxx * | s,
|  | const inv_ixm42xxx_apex_parameters_t * | apex_inputs
| ) |  |

Configures DMP parameters for APEX algorithms (pedometer, tilt). This programmable parameters will be decoded and propagate to the SRAM to be executed at DMP start.

Parameters

  [in] | apex_inputs | The requested input parameters. See

See also
  inv_ixm42xxx_apex_parameters_t

Warning
  APEX inputs can't change on the fly, this API should be called before enabling any APEX features.
  APEX configuration can't be done too frequently, but only once every 10ms. Otherwise it can create unknown behavior.

Returns
  0 on success, negative value on error.

Definition at line 267 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_configure_smd_wom()

int inv_ixm42xxx_configure_smd_wom | ( | struct inv_ixm42xxx * | s,
|  | const uint8_t | x_th,
|  | const uint8_t | y_th,
|  | const uint8_t | z_th,
|  | IXM42XXX_SMD_CONFIG_WOM_INT_MODE_t | wom_int,
|  | IXM42XXX_SMD_CONFIG_WOM_MODE_t | wom_mode
| ) |  |

Configure Wake On Motion and SMD thresholds.

Parameters

  [in] | x_th | threshold value for the Wake on Motion Interrupt for X-axis accelerometer.
  [in] | y_th | threshold value for the Wake on Motion Interrupt for Y-axis accelerometer.
  [in] | z_th | threshold value for the Wake on Motion Interrupt for Z-axis accelerometer.
  [in] | wom_int | select which mode between AND/OR is used to generate interrupt.
  [in] | wom_mode | select which comparison mode is used for WoM detection.

Returns
  0 on success, negative value on error.

Definition at line 32 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_configure_tap_parameters()

int inv_ixm42xxx_configure_tap_parameters | ( | struct inv_ixm42xxx * | s,
|  | const inv_ixm42xxx_tap_parameters_t * | tap_inputs
| ) |  |

Configure TAP.

Parameters

  [in] | tap_inputs | The requested input parameters. See

See also
  inv_ixm42xxx_tap_parameters_t

Returns
  0 on success, negative value on error.

Definition at line 178 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_apex_pedometer()

int inv_ixm42xxx_disable_apex_pedometer | ( | struct inv_ixm42xxx * | s | ) |

Disable APEX algorithm Pedometer.

Returns
  0 on success, negative value on error.

Definition at line 410 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_apex_r2w()

int inv_ixm42xxx_disable_apex_r2w | ( | struct inv_ixm42xxx * | s | ) |

Disable APEX algorithm Raise to wake.

Returns
  0 on success, negative value on error.

Definition at line 438 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_apex_tilt()

int inv_ixm42xxx_disable_apex_tilt | ( | struct inv_ixm42xxx * | s | ) |

Disable APEX algorithm Tilt.

Returns
  0 on success, negative value on error.

Definition at line 467 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_smd()

int inv_ixm42xxx_disable_smd | ( | struct inv_ixm42xxx * | s | ) |

Disable Significant Motion Detection. Disables SMD event generation and disables SMD interrupt.

Returns
  0 on success, negative value on error.

Definition at line 143 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_tap()

int inv_ixm42xxx_disable_tap | ( | struct inv_ixm42xxx * | s | ) |

Disable TAP.

Returns
  0 on success, negative value on error.

Definition at line 232 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_disable_wom()

int inv_ixm42xxx_disable_wom | ( | struct inv_ixm42xxx * | s | ) |

Disable Wake On Motion. Disables WoM event generation and reconfigures interrupt to fire on Fifo water-mark.

Returns
  0 on success, negative value on error.

Definition at line 88 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_apex_pedometer()

int inv_ixm42xxx_enable_apex_pedometer | ( | struct inv_ixm42xxx * | s | ) |

Enable APEX algorithm Pedometer. note : Pedometer request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency.

Returns
  0 on success, negative value on error.

Warning
  Pedometer must be turned OFF to reconfigure it

Definition at line 395 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_apex_r2w()

int inv_ixm42xxx_enable_apex_r2w | ( | struct inv_ixm42xxx * | s | ) |

Enable APEX algorithm Raise to wake. note : Raise to wake request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency.

Returns
  0 on success, negative value on error.

Definition at line 423 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_apex_tilt()

int inv_ixm42xxx_enable_apex_tilt | ( | struct inv_ixm42xxx * | s | ) |

Enable APEX algorithm Tilt. note : Tilt request to have the accelerometer enabled to works with accelerometer frequency less than dmp frequency.

Returns
  0 on success, negative value on error.

Definition at line 452 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_smd()

int inv_ixm42xxx_enable_smd | ( | struct inv_ixm42xxx * | s | ) |

Enable Significant Motion Detection. note : SMD requests to have the accelerometer enabled to work. Enables SMD event generation and configures interrupt to fire on SMD event. WoM event will also be generated. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 20ms and the accelerometer in Low Power Mode.

Returns
  0 on success, negative value on error.

Definition at line 117 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_tap()

int inv_ixm42xxx_enable_tap | ( | struct inv_ixm42xxx * | s | ) |

Enable TAP. note : TAP requests to have the accelerometer enabled to work. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 1ms and the accelerometer in Low Noise Mode.

Returns
  0 on success, negative value on error.

Definition at line 219 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_enable_wom()

int inv_ixm42xxx_enable_wom | ( | struct inv_ixm42xxx * | s | ) |

Enable Wake On Motion. note : WoM requests to have the accelerometer enabled to work. Enables WoM event generation and configures interrupt to fire on WoM event. As a consequence Fifo water-mark interrupt is disabled. To have good performance, it's recommended to set accelerometer ODR (Output Data Rate) to 20ms and the accelerometer in Low Power Mode.

Returns
  0 on success, negative value on error.

Definition at line 54 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_get_apex_data_activity()

int inv_ixm42xxx_get_apex_data_activity | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_apex_step_activity_t * | apex_activity
| ) |  |

Retrieve APEX pedometer outputs and format them.

Parameters

  [out] | apex_activity | Apex step and activity data value.

Returns
  0 in case of success, negative value on error. See enum inv_error

Definition at line 480 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_get_apex_parameters()

int inv_ixm42xxx_get_apex_parameters | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_apex_parameters_t * | apex_params
| ) |  |

Returns current DMP parameters for APEX algorithms (pedometer, tilt).

Parameters

  [out] | apex_params | The current parameter, fetched from registers. See

See also
  inv_ixm42xxx_apex_parameters_t

Returns
  0 on success, negative value on error.

Definition at line 319 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_get_tap_data()

int inv_ixm42xxx_get_tap_data | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_tap_data_t * | tap_data
| ) |  |

Retrieve tap outputs.

Parameters

  [out] | tap_data | Tap axis, direction and type

Returns
  0 in case of success, negative value on error. See enum inv_error

Definition at line 493 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_get_tap_parameters()

int inv_ixm42xxx_get_tap_parameters | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_tap_parameters_t * | tap_params
| ) |  |

Returns current TAP parameters.

Parameters

  [out] | tap_params | The current parameter, fetched from registers. See

See also
  inv_ixm42xxx_tap_parameters_t

Returns
  0 on success, negative value on error.

Definition at line 197 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_init_apex_parameters_struct()

int inv_ixm42xxx_init_apex_parameters_struct | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_apex_parameters_t * | apex_inputs
| ) |  |

Fill the APEX parameters structure with all the default parameters for APEX algorithms (pedometer, tilt)

Parameters

  [out] | apex_inputs | Default input parameters. See

See also
  inv_ixm42xxx_apex_parameters_t

Returns
  0 on success, negative value on error.

Definition at line 245 of file Ixm42xxxDriver_HL_apex.c.

## ◆ inv_ixm42xxx_init_tap_parameters_struct()

int inv_ixm42xxx_init_tap_parameters_struct | ( | struct inv_ixm42xxx * | s,
|  | inv_ixm42xxx_tap_parameters_t * | tap_inputs
| ) |  |

Fill the TAP parameters structure with all the default parameters for TAP algorithm.

Parameters

  [out] | tap_inputs | Default input parameters. See

See also
  inv_ixm42xxx_tap_parameters_t

Returns
  0 on success, negative value on error.

Definition at line 166 of file Ixm42xxxDriver_HL_apex.c.

## ◆ inv_ixm42xxx_set_apex_frequency()

int inv_ixm42xxx_set_apex_frequency | ( | struct inv_ixm42xxx * | s,
|  | const IXM42XXX_APEX_CONFIG0_DMP_ODR_t | frequency
| ) |  |

Configure DMP Output Data Rate for APEX algorithms (pedometer, tilt)

Parameters

  [in] | frequency | The requested frequency.

See also
  IXM42XXX_APEX_CONFIG0_DMP_ODR_t

Warning
  DMP_ODR can change on the fly, and the DMP code will accommodate necessary modifications
  The user needs to take care to set Accel frequency >= DMP frequency. This is a hard constraint since HW will not handle incorrect setting.

Returns
  0 on success, negative value on error.

Definition at line 366 of file Ixm42xxxDriver_HL_apex.c.

Here is the call graph for this function:

## ◆ inv_ixm42xxx_start_dmp()

int inv_ixm42xxx_start_dmp | ( | struct inv_ixm42xxx * | s | ) |

Start DMP for APEX algorithms.

Returns
  0 on success, negative value on error.

Definition at line 377 of file Ixm42xxxDriver_HL_apex.c.

Here is the caller graph for this function: