Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
README.md | D | 18-Mar-2025 | 3.2 KiB | 85 | 63 | |
inv_imu_apex.c | D | 18-Mar-2025 | 12.1 KiB | 344 | 236 | |
inv_imu_apex.h | D | 18-Mar-2025 | 6 KiB | 169 | 54 | |
inv_imu_defs.h | D | 18-Mar-2025 | 39.9 KiB | 992 | 644 | |
inv_imu_driver.c | D | 18-Mar-2025 | 53.4 KiB | 1,676 | 1,170 | |
inv_imu_driver.h | D | 18-Mar-2025 | 20 KiB | 533 | 170 | |
inv_imu_extfunc.h | D | 18-Mar-2025 | 749 | 40 | 12 | |
inv_imu_regmap_rev_a.h | D | 18-Mar-2025 | 88.7 KiB | 3,358 | 617 | |
inv_imu_selftest.c | D | 18-Mar-2025 | 6.7 KiB | 198 | 131 | |
inv_imu_selftest.h | D | 18-Mar-2025 | 2.2 KiB | 73 | 31 | |
inv_imu_transport.c | D | 18-Mar-2025 | 6.7 KiB | 286 | 197 | |
inv_imu_transport.h | D | 18-Mar-2025 | 3.2 KiB | 110 | 40 | |
inv_imu_version.h | D | 18-Mar-2025 | 288 | 21 | 10 |
README.md
1# Overview 2 3The eMD driver is TDK Invensense's reference code to drive our IMU from a microcontroller-based system. It is coded in C language and organized around modules. 4 5## Common files 6 7All modules rely on the following files. 8 9Files: 10* `imu/inv_imu_transport.h`: Definition of the abstraction layer used to communicate with the IMU. 11* `imu/inv_imu_transport.c`: Implementation of the abstraction layer used to communicate with the IMU. 12* `imu/inv_imu.h`: Describes IMU specificities and capabilities. 13* `imu/inv_imu_regmap_rev_a.h`: Exposes register map using positions and masks. 14* `imu/inv_imu_defs.h`: Defines possible values for most used registers. 15* `imu/inv_imu_extfunc.h`: Defines system functions required by the driver, which shall be implemented in the application layer. 16 17## Driver 18 19The **driver** contains the generic functionalities required to operate our IMU. 20 21Depends on: 22* **Common files** 23 24Files: 25* `imu/inv_imu_driver.h`: Definition of the driver API. 26* `imu/inv_imu_driver.c`: Implementation of the driver API. 27* `imu/inv_imu_version.h`: Contains the driver's version as a string. 28 29## Self-test 30 31The **self-test** module contains the code required to operate IMU's self-test. 32 33Depends on: 34* **Driver** 35* **Common files** 36 37Files: 38* `imu/inv_imu_selftest.h`: Definition of the self-test module API. 39* `imu/inv_imu_selftest.c`: Implementation of the self-test module API. 40 41## APEX 42 43The **APEX** module provides API to operate algorithm features (APEX) on-chip. The following features are available: 44* Pedometer (step count and step detector) 45* FreeFall detection, including Low-G and High-G detection. 46* Tilt detection 47* Significant Motion Detection 48 49Depends on: 50* **Driver** 51* **Common files** 52 53Files: 54* `imu/inv_imu_apex.h`: Definition of the APEX module API. 55* `imu/inv_imu_apex.c`: Implementation of the APEX module API. 56 57# Initializing driver 58 59Please, follow these steps: 60* On your application code, create a local variable of type `inv_imu_device_t` and another one of type `inv_imu_serif_t`: `inv_imu_device_t imu_dev;` and `inv_imu_serif_t imu_serif;` 61* Initialize serif structure: 62 * Provide an implementation of the `read_reg` and `write_reg` functions and initialize the corresponding pointers. 63 * Configure the `max_read` and `max_write` fields which indicates the maximum numbers of bytes allowed per transaction. 64 * Configure the `serif_type` field which indicates the serial interface used. Available options are listed in `inv_imu_transport.h`. 65 * The `context` field can be set to 0. 66* Initialize sensor event callback pointer in `inv_imu_adv_var_t` structure. This function will be called when a new sensor data will be available. 67* Call the `inv_imu_adv_init` function, providing the device and serif objects as well as a callback which will be executed when a new sample is received. 68 69Example of initialization in C: 70```C 71inv_imu_device_t imu_dev; 72inv_imu_serif_t imu_serif; 73 74/* Initialize serial interface */ 75imu_serif.read_reg = si_io_imu_read_reg; 76imu_serif.write_reg = si_io_imu_write_reg; 77imu_serif.max_read = 32768; 78imu_serif.max_write = 32768; 79imu_serif.serif_type = SERIF_TYPE; 80imu_serif.context = 0; 81 82/* Init device */ 83rc |= inv_imu_init(&imu_dev, &imu_serif, sensor_event_cb); 84``` 85