| eMD IIM4265x Driver API 1.0.0

Data Structures | Macros | Enumerations | Functions
Ixm42xxxSelfTest.c File Reference
`#include "Invn/Drivers/Ixm42xxx/Ixm42xxxSelfTest.h"`
`#include "Invn/Drivers/Ixm42xxx/Ixm42xxxDefs.h"`
`#include "Invn/Drivers/Ixm42xxx/Ixm42xxxExtFunc.h"`
`#include "Invn/Drivers/Ixm42xxx/Ixm42xxxTransport.h"`
`#include "Invn/Drivers/Ixm42xxx/Ixm42xxxDriver_HL.h"`
`#include <stdio.h>`
`#include <math.h>`
Include dependency graph for Ixm42xxxSelfTest.c:

Go to the source code of this file.

## Data Structures
struct | recover_regs
| Contains the current register values. Used to reapply values after the ST procedure. More...

## Macros
#define | INV_ABS(x) (((x) < 0) ? -(x) : (x))
#define | ST_GYRO_FSR IXM42XXX_GYRO_CONFIG0_FS_SEL_250dps
#define | ST_GYRO_ODR IXM42XXX_GYRO_CONFIG0_ODR_1_KHZ
#define | ST_GYRO_UI_FILT_ORD_IND IXM42XXX_GYRO_CONFIG_GYRO_UI_FILT_ORD_3RD_ORDER
#define | ST_GYRO_UI_FILT_BW_IND IXM42XXX_GYRO_ACCEL_CONFIG0_GYRO_FILT_BW_10
#define | ST_ACCEL_FSR IXM42XXX_ACCEL_CONFIG0_FS_SEL_4g
#define | ST_ACCEL_ODR IXM42XXX_ACCEL_CONFIG0_ODR_1_KHZ
#define | ST_ACCEL_UI_FILT_ORD_IND IXM42XXX_ACCEL_CONFIG_ACCEL_UI_FILT_ORD_3RD_ORDER
#define | ST_ACCEL_UI_FILT_BW_IND IXM42XXX_GYRO_ACCEL_CONFIG0_ACCEL_FILT_BW_10
#define | INV_ST_OTP_EQUATION(FS, ST_code) (uint32_t)((2620/pow(2,3-FS))*pow(1.01, ST_code-1)+0.5)
#define | MIN_RATIO_GYRO 0.5f /* expected ratio greater than 0.5 */
#define | MIN_ST_GYRO_DPS 60 /* expected values greater than 60dps */
#define | MAX_ST_GYRO_OFFSET_DPS 20 /* expected offset less than 20 dps */
#define | MIN_RATIO_GYRO 0.5f /* expected ratio greater than 0.5 */
#define | MAX_RATIO_GYRO 1.5f /* expected ratio lower than 1.5 */
#define | MIN_ST_ACCEL_MG 225 /* expected values in [225mgee;675mgee] */
#define | MAX_ST_ACCEL_MG 675

## Enumerations
enum | inv_ixm42xxx_sensor_on_mask { INV_IXM42XXX_SENSOR_ON_MASK_ACCEL = (1L<<INV_IXM42XXX_SENSOR_ACCEL), INV_IXM42XXX_SENSOR_ON_MASK_GYRO = (1L<<INV_IXM42XXX_SENSOR_GYRO) }
| Ixm42xxx HW Base sensor status based upon s->sensor_on_mask. More...

## Functions
int | inv_ixm42xxx_run_selftest (struct inv_ixm42xxx *s, int *result)
| Perform hardware self-test for Accel and Gyro. More...
int | inv_ixm42xxx_get_st_bias (struct inv_ixm42xxx *s, int st_bias[6])
| Retrieve bias collected by self-test. More...
int | inv_ixm42xxx_set_st_bias (struct inv_ixm42xxx *s, const int st_bias[6])
| Apply bias. More...

## Macro Definition Documentation

## ◆ INV_ABS

#define INV_ABS | ( |  | x | ) | (((x) < 0) ? -(x) : (x))

Definition at line 35 of file Ixm42xxxSelfTest.c.

## ◆ INV_ST_OTP_EQUATION

#define INV_ST_OTP_EQUATION | ( |  | FS,
|  |  | ST_code
| ) |  | (uint32_t)((2620/pow(2,3-FS))*pow(1.01, ST_code-1)+0.5)

Definition at line 54 of file Ixm42xxxSelfTest.c.

## ◆ MAX_RATIO_GYRO

#define MAX_RATIO_GYRO 1.5f /* expected ratio lower than 1.5 */

Definition at line 63 of file Ixm42xxxSelfTest.c.

## ◆ MAX_ST_ACCEL_MG

#define MAX_ST_ACCEL_MG 675

Definition at line 65 of file Ixm42xxxSelfTest.c.

## ◆ MAX_ST_GYRO_OFFSET_DPS

#define MAX_ST_GYRO_OFFSET_DPS 20 /* expected offset less than 20 dps */

Definition at line 60 of file Ixm42xxxSelfTest.c.

## ◆ MIN_RATIO_GYRO [1/2]

#define MIN_RATIO_GYRO 0.5f /* expected ratio greater than 0.5 */

Definition at line 62 of file Ixm42xxxSelfTest.c.

## ◆ MIN_RATIO_GYRO [2/2]

#define MIN_RATIO_GYRO 0.5f /* expected ratio greater than 0.5 */

Definition at line 62 of file Ixm42xxxSelfTest.c.

## ◆ MIN_ST_ACCEL_MG

#define MIN_ST_ACCEL_MG 225 /* expected values in [225mgee;675mgee] */

Definition at line 64 of file Ixm42xxxSelfTest.c.

## ◆ MIN_ST_GYRO_DPS

#define MIN_ST_GYRO_DPS 60 /* expected values greater than 60dps */

Definition at line 59 of file Ixm42xxxSelfTest.c.

## ◆ ST_ACCEL_FSR

#define ST_ACCEL_FSR IXM42XXX_ACCEL_CONFIG0_FS_SEL_4g

Definition at line 45 of file Ixm42xxxSelfTest.c.

## ◆ ST_ACCEL_ODR

#define ST_ACCEL_ODR IXM42XXX_ACCEL_CONFIG0_ODR_1_KHZ

Definition at line 46 of file Ixm42xxxSelfTest.c.

## ◆ ST_ACCEL_UI_FILT_BW_IND

#define ST_ACCEL_UI_FILT_BW_IND IXM42XXX_GYRO_ACCEL_CONFIG0_ACCEL_FILT_BW_10

Definition at line 48 of file Ixm42xxxSelfTest.c.

## ◆ ST_ACCEL_UI_FILT_ORD_IND

#define ST_ACCEL_UI_FILT_ORD_IND IXM42XXX_ACCEL_CONFIG_ACCEL_UI_FILT_ORD_3RD_ORDER

Definition at line 47 of file Ixm42xxxSelfTest.c.

## ◆ ST_GYRO_FSR

#define ST_GYRO_FSR IXM42XXX_GYRO_CONFIG0_FS_SEL_250dps

register configuration for self-test procedure

Definition at line 40 of file Ixm42xxxSelfTest.c.

## ◆ ST_GYRO_ODR

#define ST_GYRO_ODR IXM42XXX_GYRO_CONFIG0_ODR_1_KHZ

Definition at line 41 of file Ixm42xxxSelfTest.c.

## ◆ ST_GYRO_UI_FILT_BW_IND

#define ST_GYRO_UI_FILT_BW_IND IXM42XXX_GYRO_ACCEL_CONFIG0_GYRO_FILT_BW_10

Definition at line 43 of file Ixm42xxxSelfTest.c.

## ◆ ST_GYRO_UI_FILT_ORD_IND

#define ST_GYRO_UI_FILT_ORD_IND IXM42XXX_GYRO_CONFIG_GYRO_UI_FILT_ORD_3RD_ORDER

Definition at line 42 of file Ixm42xxxSelfTest.c.

## Enumeration Type Documentation

## ◆ inv_ixm42xxx_sensor_on_mask

enum inv_ixm42xxx_sensor_on_mask

Ixm42xxx HW Base sensor status based upon s->sensor_on_mask.

Enumerator
INV_IXM42XXX_SENSOR_ON_MASK_ACCEL |
INV_IXM42XXX_SENSOR_ON_MASK_GYRO |

Definition at line 70 of file Ixm42xxxSelfTest.c.