Solaris Software
Loading...
Searching...
No Matches
icm20948.h
Go to the documentation of this file.
1/**
2 * @file icm20948.h
3 * @brief ICM20948 IMU driver and SPP service.
4 *
5 * Provides SPI register access, DMP firmware loading and sensor data
6 * acquisition for the TDK InvenSense ICM20948 9-axis IMU. Supports
7 * data-ready interrupt via GPIO event groups.
8 *
9 * The driver follows a three-step workflow:
10 * 1. Call SPP_SERVICES_ICM20948_getProducerContract() and register the result
11 * with SPP_SERVICES_PUBSUB_registerProducer().
12 * 2. The service framework calls init (GPIO/SPI setup + DMP firmware load).
13 * 3. On each DRDY interrupt acquireData reads the DMP FIFO and publishes
14 * a 9-axis data packet.
15 *
16 * Hardware pin configuration is encoded in K_ICM20948_INT_* and
17 * K_ICM20948_SPI_HOST_USED constants; no external instance is needed.
18 *
19 * Naming conventions used in this file:
20 * - Constants/macros: K_ICM20948_*
21 * - Types: ICM20948_*_t
22 * - Public functions: SPP_SERVICES_ICM20948_*()
23 * - Pointer params: p_*
24 */
25
26#ifndef SPP_ICM20948_H
27#define SPP_ICM20948_H
28
29#include "spp/core/types.h"
30#include "spp/hal/gpio/gpio.h"
32
33/* ----------------------------------------------------------------
34 * DEFINES
35 * ---------------------------------------------------------------- */
36
37/* Service */
38#define K_ICM20948_TASK_PRIORITY 4U /**< FreeRTOS task priority for the ICM20948 service task. */
39#define K_ICM20948_CONFIG_TASK_PRIORITY 5U /**< Priority for the DMP configuration task. */
40#define K_ICM20948_READ_SENSORS_PRIORITY 4U /**< Priority for the sensor read task. */
41#define K_ICM20948_TASK_TIMEOUT_MS 5000U /**< Timeout in ms for the acquire task. */
42#define K_ICM20948_SERVICE_APID (0x0002U) /**< APID produced by the ICM20948 module (bitmask scheme). */
43
44/* SPI */
45#define K_ICM20948_SPI_HOST_USED (1U) /**< SPI host identifier (SPI2_HOST = 1 on ESP32). */
46#define K_ICM20948_PIN_NUM_CS 21U /**< SPI chip-select GPIO pin. */
47#define K_ICM20948_PIN_NUM_CIPO 47U /**< SPI CIPO (MISO) GPIO pin. */
48#define K_ICM20948_PIN_NUM_COPI 38U /**< SPI COPI (MOSI) GPIO pin. */
49#define K_ICM20948_PIN_NUM_CLK 48U /**< SPI clock GPIO pin. */
50#define K_ICM20948_READ_OP 0x80U /**< SPI read flag: set MSB to signal a read transaction. */
51#define K_ICM20948_WRITE_OP 0x00U /**< SPI write marker (zero). */
52#define K_ICM20948_EMPTY_MESSAGE 0x00U /**< Dummy byte clocked out during SPI reads. */
53
54/* Interrupt */
55#define K_ICM20948_INT_PIN_NUM 4U /**< GPIO interrupt pin. */
56#define K_ICM20948_INT_INTR_TYPE 1U /**< Interrupt trigger type (1=rising). */
57#define K_ICM20948_INT_PULL 0U /**< Pull resistor: 0=none, 1=up, 2=down. */
58
59/* Register bank select */
60#define K_ICM20948_REG_BANK_SEL 0x7FU /**< Register bank select register address. */
61
62/* Bank 0 register addresses */
63#define K_ICM20948_REG_WHO_AM_I 0x00U /**< WHO_AM_I register; expected value 0xEA. */
64#define K_ICM20948_REG_USER_CTRL 0x03U /**< User control register. */
65#define K_ICM20948_REG_LP_CONF 0x05U /**< Low-power configuration register. */
66#define K_ICM20948_REG_PWR_MGMT_1 0x06U /**< Power management 1 register. */
67#define K_ICM20948_REG_PWR_MGMT_2 0x07U /**< Power management 2 register. */
68#define K_ICM20948_REG_INT_ENABLE 0x10U /**< Interrupt enable register. */
69#define K_ICM20948_REG_INT_ENABLE_1 0x11U /**< Interrupt enable 1 register. */
70#define K_ICM20948_REG_INT_ENABLE_2 0x12U /**< Interrupt enable 2 register. */
71#define K_ICM20948_REG_DMP_INT_STATUS 0x18U /**< DMP interrupt status register. */
72#define K_ICM20948_REG_INT_STATUS 0x19U /**< Interrupt status register. */
73#define K_ICM20948_REG_SINGLE_FIFO_PRIORITY_SEL 0x26U /**< FIFO single-stream priority select register. */
74#define K_ICM20948_REG_PERIPH_SENS_DATA_00 0x3BU /**< External sensor data register 0. */
75#define K_ICM20948_REG_FIFO_EN_1 0x66U /**< FIFO enable 1 register. */
76#define K_ICM20948_REG_FIFO_EN_2 0x67U /**< FIFO enable 2 register. */
77#define K_ICM20948_REG_FIFO_RST 0x68U /**< FIFO reset register. */
78#define K_ICM20948_REG_FIFO_MODE 0x69U /**< FIFO mode register. */
79#define K_ICM20948_REG_FIFO_COUNTH 0x70U /**< FIFO byte count high register. */
80#define K_ICM20948_REG_FIFO_COUNTL 0x71U /**< FIFO byte count low register. */
81#define K_ICM20948_REG_FIFO_R_W 0x72U /**< FIFO read/write data register. */
82#define K_ICM20948_REG_HW_FIX_DISABLE 0x75U /**< Hardware fix disable register. */
83#define K_ICM20948_REG_FIFO_CFG 0x76U /**< FIFO configuration register. */
84
85/* Bank 1 register addresses */
86#define K_ICM20948_REG_TIMEBASE_CORRECTION_PLL 0x28U /**< PLL timebase correction register (bank 1). */
87
88/* Bank 2 register addresses */
89#define K_ICM20948_REG_GYRO_SMPLRT_DIV 0x00U /**< Gyroscope sample-rate divider register (bank 2). */
90#define K_ICM20948_REG_GYRO_CONFIG 0x01U /**< Gyroscope configuration register (bank 2). */
91#define K_ICM20948_REG_ACCEL_SMPLRT_DIV_1 0x10U /**< Accelerometer sample-rate divider high register (bank 2). */
92#define K_ICM20948_REG_ACCEL_SMPLRT_DIV_2 0x11U /**< Accelerometer sample-rate divider low register (bank 2). */
93#define K_ICM20948_REG_ACCEL_CONFIG 0x14U /**< Accelerometer configuration register (bank 2). */
94#define K_ICM20948_REG_ACCEL_CONFIG_2 0x15U /**< Accelerometer configuration 2 register (bank 2). */
95#define K_ICM20948_REG_DMP_ADDR_MSB 0x50U /**< DMP program start address MSB (bank 2). */
96#define K_ICM20948_REG_DMP_ADDR_LSB 0x51U /**< DMP program start address LSB (bank 2). */
97
98/* Bank 3 register addresses */
99#define K_ICM20948_I2C_MST_ODR_CONFIG 0x00U /**< I2C master ODR configuration register (bank 3). */
100#define K_ICM20948_REG_I2C_CTRL 0x01U /**< I2C master control register (bank 3). */
101#define K_ICM20948_REG_SLV0_ADDR 0x03U /**< I2C slave 0 address register (bank 3). */
102#define K_ICM20948_REG_SLV0_REG 0x04U /**< I2C slave 0 register address (bank 3). */
103#define K_ICM20948_REG_SLV0_CTRL 0x05U /**< I2C slave 0 control register (bank 3). */
104#define K_ICM20948_REG_SLV0_DO 0x06U /**< I2C slave 0 data out register (bank 3). */
105#define K_ICM20948_I2C_SLV1_ADDR 0x07U /**< I2C slave 1 address register (bank 3). */
106#define K_ICM20948_I2C_SLV1_REG 0x08U /**< I2C slave 1 register address (bank 3). */
107#define K_ICM20948_I2C_SLV1_CTRL 0x09U /**< I2C slave 1 control register (bank 3). */
108#define K_ICM20948_I2C_SLV1_DO 0x0AU /**< I2C slave 1 data out register (bank 3). */
109
110/* DMP memory access */
111#define K_ICM20948_REG_MEM_START_ADDR 0x7CU /**< DMP memory start address register. */
112#define K_ICM20948_REG_MEM_R_W 0x7DU /**< DMP memory read/write register. */
113#define K_ICM20948_REG_MEM_BANK_SEL 0x7EU /**< DMP memory bank select register. */
114#define K_ICM20948_DMP_LOAD_START 0x0090U /**< Start address in DMP memory for firmware load. */
115
116/* DMP memory addresses */
117#define K_ICM20948_DMP_DATA_OUT_CTL1 (4U * 16U) /**< DMP output control 1 address. */
118#define K_ICM20948_DMP_DATA_OUT_CTL2 (4U * 16U + 2U) /**< DMP output control 2 address. */
119#define K_ICM20948_DMP_DATA_INTR_CTL (4U * 16U + 12U) /**< DMP interrupt control address. */
120#define K_ICM20948_DMP_MOTION_EVENT_CTL (4U * 16U + 14U) /**< DMP motion event control address. */
121#define K_ICM20948_DMP_DATA_RDY_STATUS (8U * 16U + 10U) /**< DMP data ready status address. */
122#define K_ICM20948_DMP_ODR_QUAT6 (10U * 16U + 12U) /**< DMP quaternion6 output data rate address. */
123#define K_ICM20948_DMP_ODR_QUAT9 (10U * 16U + 8U) /**< DMP quaternion9 output data rate address. */
124#define K_ICM20948_DMP_ODR_GYRO (11U * 16U + 10U) /**< DMP gyroscope output data rate address. */
125#define K_ICM20948_DMP_ODR_CPASS (11U * 16U + 6U) /**< DMP compass output data rate address. */
126#define K_ICM20948_DMP_ODR_ACCEL (11U * 16U + 14U) /**< DMP accelerometer output data rate address. */
127#define K_ICM20948_DMP_CPASS_TIME_BUFFER (29U * 16U + 8U) /**< DMP compass time buffer address. */
128#define K_ICM20948_DMP_GYRO_SF (19U * 16U) /**< DMP gyroscope scale factor address. */
129#define K_ICM20948_DMP_ACC_SCALE (30U * 16U) /**< DMP accelerometer scale address. */
130#define K_ICM20948_DMP_FIFO_WATERMARK (31U * 16U + 14U) /**< DMP FIFO watermark address. */
131#define K_ICM20948_DMP_BAC_RATE (48U * 16U + 10U) /**< DMP basic activity classifier rate address. */
132#define K_ICM20948_DMP_B2S_RATE (48U * 16U + 8U) /**< DMP bring-to-see rate address. */
133#define K_ICM20948_DMP_ACCEL_ONLY_GAIN (16U * 16U + 12U) /**< DMP accel-only mode gain address. */
134#define K_ICM20948_DMP_ACC_SCALE2 (79U * 16U + 4U) /**< DMP accelerometer scale 2 address. */
135#define K_ICM20948_DMP_CPASS_MTX_00 (23U * 16U) /**< Compass mount matrix [0][0]. */
136#define K_ICM20948_DMP_CPASS_MTX_01 (23U * 16U + 4U) /**< Compass mount matrix [0][1]. */
137#define K_ICM20948_DMP_CPASS_MTX_02 (23U * 16U + 8U) /**< Compass mount matrix [0][2]. */
138#define K_ICM20948_DMP_CPASS_MTX_10 (23U * 16U + 12U) /**< Compass mount matrix [1][0]. */
139#define K_ICM20948_DMP_CPASS_MTX_11 (24U * 16U) /**< Compass mount matrix [1][1]. */
140#define K_ICM20948_DMP_CPASS_MTX_12 (24U * 16U + 4U) /**< Compass mount matrix [1][2]. */
141#define K_ICM20948_DMP_CPASS_MTX_20 (24U * 16U + 8U) /**< Compass mount matrix [2][0]. */
142#define K_ICM20948_DMP_CPASS_MTX_21 (24U * 16U + 12U) /**< Compass mount matrix [2][1]. */
143#define K_ICM20948_DMP_CPASS_MTX_22 (25U * 16U) /**< Compass mount matrix [2][2]. */
144#define K_ICM20948_DMP_GYRO_FULLSCALE (72U * 16U + 12U) /**< DMP gyroscope full-scale address. */
145#define K_ICM20948_DMP_ACCEL_ALPHA_VAR (91U * 16U) /**< DMP accel alpha variance address. */
146#define K_ICM20948_DMP_ACCEL_A_VAR (92U * 16U) /**< DMP accel A variance address. */
147#define K_ICM20948_DMP_ACCEL_CAL_INIT (94U * 16U + 4U) /**< DMP accel calibration init address. */
148#define K_ICM20948_DMP_B2S_MTX_00 (208U * 16U) /**< Body-to-sensor matrix [0][0]. */
149#define K_ICM20948_DMP_B2S_MTX_01 (208U * 16U + 4U) /**< Body-to-sensor matrix [0][1]. */
150#define K_ICM20948_DMP_B2S_MTX_02 (208U * 16U + 8U) /**< Body-to-sensor matrix [0][2]. */
151#define K_ICM20948_DMP_B2S_MTX_10 (208U * 16U + 12U) /**< Body-to-sensor matrix [1][0]. */
152#define K_ICM20948_DMP_B2S_MTX_11 (209U * 16U) /**< Body-to-sensor matrix [1][1]. */
153#define K_ICM20948_DMP_B2S_MTX_12 (209U * 16U + 4U) /**< Body-to-sensor matrix [1][2]. */
154#define K_ICM20948_DMP_B2S_MTX_20 (209U * 16U + 8U) /**< Body-to-sensor matrix [2][0]. */
155#define K_ICM20948_DMP_B2S_MTX_21 (209U * 16U + 12U) /**< Body-to-sensor matrix [2][1]. */
156#define K_ICM20948_DMP_B2S_MTX_22 (210U * 16U) /**< Body-to-sensor matrix [2][2]. */
157
158/* Magnetometer (AK09916) */
159#define K_ICM20948_MAG_WR_ADDR 0x0CU /**< AK09916 magnetometer write address (I2C). */
160#define K_ICM20948_MAG_RD_ADDR 0x8CU /**< AK09916 magnetometer read address (I2C). */
161#define K_ICM20948_MAG_CTRL_2 0x31U /**< AK09916 control 2 register address. */
162
163/* Raw sensor data registers (bank 0) */
164#define K_ICM20948_REG_ACCEL_X_H 0x2DU /**< Accelerometer X high byte register. */
165#define K_ICM20948_REG_ACCEL_X_L 0x2EU /**< Accelerometer X low byte register. */
166#define K_ICM20948_REG_ACCEL_Y_H 0x2FU /**< Accelerometer Y high byte register. */
167#define K_ICM20948_REG_ACCEL_Y_L 0x30U /**< Accelerometer Y low byte register. */
168#define K_ICM20948_REG_ACCEL_Z_H 0x31U /**< Accelerometer Z high byte register. */
169#define K_ICM20948_REG_ACCEL_Z_L 0x32U /**< Accelerometer Z low byte register. */
170#define K_ICM20948_REG_GYRO_X_H 0x33U /**< Gyroscope X high byte register. */
171#define K_ICM20948_REG_GYRO_X_L 0x34U /**< Gyroscope X low byte register. */
172#define K_ICM20948_REG_GYRO_Y_H 0x35U /**< Gyroscope Y high byte register. */
173#define K_ICM20948_REG_GYRO_Y_L 0x36U /**< Gyroscope Y low byte register. */
174#define K_ICM20948_REG_GYRO_Z_H 0x37U /**< Gyroscope Z high byte register. */
175#define K_ICM20948_REG_GYRO_Z_L 0x38U /**< Gyroscope Z low byte register. */
176#define K_ICM20948_REG_MAGNETO_X_L 0x3CU /**< Magnetometer X low byte register. */
177#define K_ICM20948_REG_MAGNETO_X_H 0x3DU /**< Magnetometer X high byte register. */
178#define K_ICM20948_REG_MAGNETO_Y_L 0x3EU /**< Magnetometer Y low byte register. */
179#define K_ICM20948_REG_MAGNETO_Y_H 0x3FU /**< Magnetometer Y high byte register. */
180#define K_ICM20948_REG_MAGNETO_Z_L 0x40U /**< Magnetometer Z low byte register. */
181#define K_ICM20948_REG_MAGNETO_Z_H 0x41U /**< Magnetometer Z high byte register. */
182
183
184/* ----------------------------------------------------------------
185 * STRUCTS AND ENUMS
186 * ---------------------------------------------------------------- */
187
188/** @brief ICM20948 register bank selector. */
196
197/** @brief REG_BANK_SEL register bit layout. */
198typedef union
199{
201 struct
202 {
206 } bits;
208
209/** @brief USER_CTRL register bit layout. */
210typedef union
211{
213 struct
214 {
222 spp_uint8_t dmpEn : 1;
223 } bits;
225
226/** @brief LP_CONFIG register bit layout. */
227typedef union
228{
230 struct
231 {
237 } bits;
239
240/** @brief Clock source selection for PWR_MGMT_1. */
247
248/** @brief PWR_MGMT_1 register bit layout. */
249typedef union
250{
252 struct
253 {
257 spp_uint8_t lpEn : 1;
258 spp_uint8_t sleep : 1;
260 } bits;
262
263/** @brief PWR_MGMT_2 register bit layout. */
278
279/** @brief INT_ENABLE register bit layout. */
280typedef union
281{
283 struct
284 {
288 } bits;
290
291/** @brief INT_ENABLE_2 register bit layout. */
305
306/** @brief INT_STATUS register bit layout. */
307typedef union
308{
310 struct
311 {
315 } bits;
317
318/** @brief DMP_INT_STATUS register bit layout. */
319typedef union
320{
322 struct
323 {
330 } bits;
332
333/** @brief SINGLE_FIFO_PRIORITY_SEL register bit layout. */
345
346/** @brief FIFO_EN_1 register bit layout. */
347typedef union
348{
350 struct
351 {
357 } bits;
359
360/** @brief FIFO_EN_2 register bit layout. */
374
375/** @brief FIFO_RST register bit layout. */
376typedef union
377{
379 struct
380 {
387 } bits;
389
390/** @brief FIFO_MODE register bit layout. */
391typedef union
392{
394 struct
395 {
398 } bits;
400
401/** @brief FIFO_CFG register bit layout. */
402typedef union
403{
405 struct
406 {
409 } bits;
411
412/** @brief HW_FIX_DISABLE register bit layout. */
413typedef union
414{
416 struct
417 {
418 spp_uint8_t bit0 : 1;
419 spp_uint8_t bit1 : 1;
420 spp_uint8_t bit2 : 1;
421 spp_uint8_t bit3 : 1;
422 spp_uint8_t bit4 : 1;
423 spp_uint8_t bit5 : 1;
424 spp_uint8_t bit6 : 1;
425 spp_uint8_t bit7 : 1;
426 } bits;
428
429/** @brief Gyroscope full-scale range selection. */
437
438/** @brief GYRO_CONFIG_1 register bit layout. */
439typedef union
440{
442 struct
443 {
448 } bits;
450
451/** @brief Accelerometer full-scale range selection. */
459
460/** @brief ACCEL_CONFIG register bit layout. */
472
473/** @brief ACCEL_CONFIG_2 register bit layout. */
474typedef union
475{
477 struct
478 {
481 } bits;
483
484/** @brief I2C_MST_CTRL register bit layout. */
485typedef union
486{
488 struct
489 {
493 } bits;
495
496/** @brief I2C_SLVx_ADDR register bit layout. */
497typedef union
498{
500 struct
501 {
502 spp_uint8_t i2cId : 7;
504 } bits;
506
507/** @brief I2C_SLVx_CTRL register bit layout. */
508typedef union
509{
511 struct
512 {
514 spp_uint8_t group : 1;
518 } bits;
520
521/** @brief I2C_MST_ODR_CONFIG register bit layout. */
522typedef union
523{
525 struct
526 {
529 } bits;
531
532/**
533 * @brief Parsed sensor sample from the DMP FIFO.
534 */
535typedef struct
536{
537 float ax; /**< Accelerometer X (g) */
538 float ay; /**< Accelerometer Y (g) */
539 float az; /**< Accelerometer Z (g) */
540 float gx; /**< Gyroscope X (dps) */
541 float gy; /**< Gyroscope Y (dps) */
542 float gz; /**< Gyroscope Z (dps) */
543 float mx; /**< Magnetometer X (uT) */
544 float my; /**< Magnetometer Y (uT) */
545 float mz; /**< Magnetometer Z (uT) */
546 float qw; /**< Quaternion W (uT) */
547 float qx; /**< Quaternion X (uT) */
548 float qy; /**< Quaternion Y (uT) */
549 float qz; /**< Quaternion Z (uT) */
550 float accuracy; /**< Quaternion accuracy */
551 spp_bool_t dataReady; /**< Set when a FIFO packet has been parsed. */
553
554/**
555 * @brief ICM20948 interrupt and GPIO context.
556 */
557typedef struct
558{
559 volatile spp_bool_t drdyFlag; /**< Set by ISR on data-ready interrupt. */
560 SPP_GpioIsrCtx_t isr_ctx; /**< ISR context (points at drdyFlag). */
561 spp_uint32_t intPin; /**< GPIO interrupt pin number. */
562 spp_uint32_t intIntrType; /**< Interrupt trigger type (1=rising). */
563 spp_uint32_t intPull; /**< Pull resistor: 0=none, 1=up, 2=down. */
565
566/**
567 * @brief ICM20948 sensor instance.
568 *
569 * One static instance (@c s_icmData) is kept inside icm20948.c; its hardware
570 * fields are set from K_ICM20948_* constants by SPP_SERVICES_ICM20948_init.
571 */
572typedef struct
573{
574 /* Hardware configuration — set at declaration */
575 spp_uint8_t spiDevIdx; /**< SPI device handle index. */
576 spp_uint32_t intPin; /**< GPIO interrupt pin number. */
577 spp_uint32_t intIntrType; /**< Interrupt edge type (1=rising). */
578 spp_uint32_t intPull; /**< Pull resistor (0=none, 1=up). */
579
580 /* Runtime state — filled in by init, do not set manually */
581 void *p_spi; /**< SPI device handle. */
582 ICM20948_Data_t icmData; /**< Interrupt flag and ISR context. */
583 ICM20948_SensorData_t lastData; /**< Last parsed FIFO sample. */
584 spp_uint16_t seq; /**< Packet sequence counter. */
585} ICM20948_t;
586
587
588/* ----------------------------------------------------------------
589 * PUBLIC FUNCTIONS
590 * ---------------------------------------------------------------- */
592
593#endif /* SPP_ICM20948_H */
SPP GPIO HAL API — dispatches through the registered HAL port.
const SPP_SERVICE_ProducerContract_t * SPP_SERVICES_ICM20948_getProducerContract(void)
Returns a pointer to the ICM20948 producer contract.
Definition icm20948.c:106
ICM20948_RegBank_t
ICM20948 register bank selector.
Definition icm20948.h:190
@ K_ICM20948_REG_BANK_2
Definition icm20948.h:193
@ K_ICM20948_REG_BANK_1
Definition icm20948.h:192
@ K_ICM20948_REG_BANK_0
Definition icm20948.h:191
@ K_ICM20948_REG_BANK_3
Definition icm20948.h:194
ICM20948_AccelFsSel_t
Accelerometer full-scale range selection.
Definition icm20948.h:453
@ K_ICM20948_ACCEL_FS_4G
Definition icm20948.h:455
@ K_ICM20948_ACCEL_FS_2G
Definition icm20948.h:454
@ K_ICM20948_ACCEL_FS_16G
Definition icm20948.h:457
@ K_ICM20948_ACCEL_FS_8G
Definition icm20948.h:456
ICM20948_GyroFsSel_t
Gyroscope full-scale range selection.
Definition icm20948.h:431
@ K_ICM20948_GYRO_FS_2000DPS
Definition icm20948.h:435
@ K_ICM20948_GYRO_FS_500DPS
Definition icm20948.h:433
@ K_ICM20948_GYRO_FS_1000DPS
Definition icm20948.h:434
@ K_ICM20948_GYRO_FS_250DPS
Definition icm20948.h:432
ICM20948_ClockSel_t
Clock source selection for PWR_MGMT_1.
Definition icm20948.h:242
@ K_ICM20948_CLK_AUTO
Definition icm20948.h:244
@ K_ICM20948_CLK_STOP
Definition icm20948.h:245
@ K_ICM20948_CLK_INTERNAL_20MHZ
Definition icm20948.h:243
SPP module descriptor and registry API.
ICM20948 interrupt and GPIO context.
Definition icm20948.h:558
spp_uint32_t intPin
Definition icm20948.h:561
spp_uint32_t intPull
Definition icm20948.h:563
volatile spp_bool_t drdyFlag
Definition icm20948.h:559
spp_uint32_t intIntrType
Definition icm20948.h:562
SPP_GpioIsrCtx_t isr_ctx
Definition icm20948.h:560
Parsed sensor sample from the DMP FIFO.
Definition icm20948.h:536
spp_bool_t dataReady
Definition icm20948.h:551
ICM20948 sensor instance.
Definition icm20948.h:573
spp_uint32_t intIntrType
Definition icm20948.h:577
spp_uint32_t intPull
Definition icm20948.h:578
ICM20948_SensorData_t lastData
Definition icm20948.h:583
spp_uint16_t seq
Definition icm20948.h:584
spp_uint8_t spiDevIdx
Definition icm20948.h:575
ICM20948_Data_t icmData
Definition icm20948.h:582
void * p_spi
Definition icm20948.h:581
spp_uint32_t intPin
Definition icm20948.h:576
Context passed to the GPIO ISR handler.
Definition gpio.h:27
Describes the contract of a producer module. This module needs to have:
Definition service.h:28
Portable integer types and SPI/storage configuration types for SPP.
uint16_t spp_uint16_t
Definition types.h:29
uint32_t spp_uint32_t
Definition types.h:31
uint8_t spp_uint8_t
Definition types.h:27
bool spp_bool_t
Definition types.h:36
ACCEL_CONFIG_2 register bit layout.
Definition icm20948.h:475
ACCEL_CONFIG register bit layout.
Definition icm20948.h:462
REG_BANK_SEL register bit layout.
Definition icm20948.h:199
spp_uint8_t value
Definition icm20948.h:200
DMP_INT_STATUS register bit layout.
Definition icm20948.h:320
FIFO_CFG register bit layout.
Definition icm20948.h:403
spp_uint8_t value
Definition icm20948.h:404
FIFO_EN_1 register bit layout.
Definition icm20948.h:348
spp_uint8_t value
Definition icm20948.h:349
FIFO_EN_2 register bit layout.
Definition icm20948.h:362
spp_uint8_t value
Definition icm20948.h:363
FIFO_MODE register bit layout.
Definition icm20948.h:392
FIFO_RST register bit layout.
Definition icm20948.h:377
spp_uint8_t value
Definition icm20948.h:378
GYRO_CONFIG_1 register bit layout.
Definition icm20948.h:440
HW_FIX_DISABLE register bit layout.
Definition icm20948.h:414
I2C_MST_CTRL register bit layout.
Definition icm20948.h:486
spp_uint8_t value
Definition icm20948.h:487
I2C_MST_ODR_CONFIG register bit layout.
Definition icm20948.h:523
I2C_SLVx_ADDR register bit layout.
Definition icm20948.h:498
I2C_SLVx_CTRL register bit layout.
Definition icm20948.h:509
INT_ENABLE_2 register bit layout.
Definition icm20948.h:293
INT_ENABLE register bit layout.
Definition icm20948.h:281
INT_STATUS register bit layout.
Definition icm20948.h:308
LP_CONFIG register bit layout.
Definition icm20948.h:228
spp_uint8_t value
Definition icm20948.h:229
PWR_MGMT_1 register bit layout.
Definition icm20948.h:250
PWR_MGMT_2 register bit layout.
Definition icm20948.h:265
SINGLE_FIFO_PRIORITY_SEL register bit layout.
Definition icm20948.h:335
USER_CTRL register bit layout.
Definition icm20948.h:211