| ICM45605 eMD driver Documentation of the eMD Driver API

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

- File List
- File Members

inv_imu_selftest.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) [2020] by InvenSense, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 *
16 */
17
25 #ifndef _INV_IMU_SELFTEST_H_
26 #define _INV_IMU_SELFTEST_H_
27
28 #include <stdint.h>
29
30 #include "imu/inv_imu_driver_advanced.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /* STC status codes */
37 #define INV_IMU_ST_STATUS_SUCCESS 1
38 #define INV_IMU_ST_STATUS_FAIL -1
39 #define INV_IMU_ST_STATUS_NOT_RUN 0
42 typedef struct {
44 uint8_t accel_en;
45
47 uint8_t gyro_en;
48
50 selftest_average_time_t avg_time;
51
53 selftest_accel_threshold_t accel_limit;
54
56 selftest_gyro_threshold_t gyro_limit;
57
59 uint32_t patch_settings;
60 } inv_imu_selftest_parameters_t;
61
63 typedef struct {
65 int8_t accel_status;
66
68 int8_t gyro_status;
69
71 int8_t ax_status;
72
74 int8_t ay_status;
75
77 int8_t az_status;
78
80 int8_t gx_status;
81
83 int8_t gy_status;
84
86 int8_t gz_status;
87 } inv_imu_selftest_output_t;
88
94 int inv_imu_selftest_init_params(inv_imu_device_t *s, inv_imu_selftest_parameters_t *st_params);
95
102 int inv_imu_selftest(inv_imu_device_t *s, const inv_imu_selftest_parameters_t *st_params,
103 inv_imu_selftest_output_t *st_output);
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif /* _INV_IMU_SELFTEST_H_ */
110
inv_imu_driver_advanced.h
selftest_gyro_threshold_t
selftest_gyro_threshold_t
Definition: inv_imu_defs.h:789
selftest_average_time_t
selftest_average_time_t
Definition: inv_imu_defs.h:769
selftest_accel_threshold_t
selftest_accel_threshold_t
Definition: inv_imu_defs.h:778
inv_imu_selftest
int inv_imu_selftest(inv_imu_device_t *s, const inv_imu_selftest_parameters_t *st_params, inv_imu_selftest_output_t *st_output)
Perform hardware self-test for Accel and/or Gyro.
inv_imu_selftest_init_params
int inv_imu_selftest_init_params(inv_imu_device_t *s, inv_imu_selftest_parameters_t *st_params)
Provide recommended parameters to execute self-test.
inv_imu_device_t
Basic driver configuration structure.
Definition: inv_imu_driver.h:43
inv_imu_selftest_parameters_t
Self-Test parameters.
Definition: inv_imu_selftest.h:42
inv_imu_selftest_parameters_t::gyro_limit
selftest_gyro_threshold_t gyro_limit
Tolerance between factory trim and gyro self-test response.
Definition: inv_imu_selftest.h:56
inv_imu_selftest_parameters_t::gyro_en
uint8_t gyro_en
If set, enable gyro self-test.
Definition: inv_imu_selftest.h:47
inv_imu_selftest_parameters_t::accel_limit
selftest_accel_threshold_t accel_limit
Tolerance between factory trim and accel self-test response.
Definition: inv_imu_selftest.h:53
inv_imu_selftest_parameters_t::accel_en
uint8_t accel_en
If set, enable accel self-test.
Definition: inv_imu_selftest.h:44
inv_imu_selftest_parameters_t::patch_settings
uint32_t patch_settings
Mechanism for adding patches to self-test operations.
Definition: inv_imu_selftest.h:59
inv_imu_selftest_parameters_t::avg_time
selftest_average_time_t avg_time
Averaging time used to perform self-test.
Definition: inv_imu_selftest.h:50
inv_imu_selftest_output_t
Self-test outputs.
Definition: inv_imu_selftest.h:63
inv_imu_selftest_output_t::accel_status
int8_t accel_status
Global accel self-test status.
Definition: inv_imu_selftest.h:65
inv_imu_selftest_output_t::gz_status
int8_t gz_status
GZ self-test status.
Definition: inv_imu_selftest.h:86
inv_imu_selftest_output_t::ay_status
int8_t ay_status
AY self-test status.
Definition: inv_imu_selftest.h:74
inv_imu_selftest_output_t::gyro_status
int8_t gyro_status
Global gyro self-test status.
Definition: inv_imu_selftest.h:68
inv_imu_selftest_output_t::ax_status
int8_t ax_status
AX self-test status.
Definition: inv_imu_selftest.h:71
inv_imu_selftest_output_t::az_status
int8_t az_status
AZ self-test status.
Definition: inv_imu_selftest.h:77
inv_imu_selftest_output_t::gx_status
int8_t gx_status
GX self-test status.
Definition: inv_imu_selftest.h:80
inv_imu_selftest_output_t::gy_status
int8_t gy_status
GY self-test status.
Definition: inv_imu_selftest.h:83