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.
7 * Uses a GPIO data-ready interrupt.
8 *
9 * The driver follows a three-step workflow:
10 * 1. Register the producer contract through PUBSUB.
11 * 2. PUBSUB initializes the sensor and loads the DMP firmware.
12 * 3. During acquisition cycles, the driver checks DRDY, reads the
13 * DMP FIFO and publishes an 11-float (44-byte) SPP packet.
14 *
15 * Hardware pin configuration is encoded in K_ICM20948_INT_* and
16 * K_ICM20948_SPI_HOST_USED constants; no external instance is needed.
17 *
18 * Naming conventions used in this file:
19 * - Constants/macros: K_ICM20948_*
20 * - Types: ICM20948_*_t
21 * - Public functions: SPP_SERVICES_ICM20948_*()
22 * - Pointer params: p_*
23 */
24
25#ifndef SPP_ICM20948_H
26#define SPP_ICM20948_H
27
28#include "spp/core/types.h"
29#include "spp/hal/gpio/gpio.h"
31
32/* ----------------------------------------------------------------
33 * DEFINES
34 * ---------------------------------------------------------------- */
35
36/* Service */
37#define K_ICM20948_TASK_TIMEOUT_MS 5000U /**< Timeout in ms for the acquire task. */
38
39/* SPI */
40#define K_ICM20948_SPI_HOST_USED (1U) /**< SPI host identifier (SPI2_HOST = 1 on ESP32). */
41#define K_ICM20948_PIN_NUM_CS 21U /**< SPI chip-select GPIO pin. */
42#define K_ICM20948_PIN_NUM_CIPO 47U /**< SPI CIPO (MISO) GPIO pin. */
43#define K_ICM20948_PIN_NUM_COPI 38U /**< SPI COPI (MOSI) GPIO pin. */
44#define K_ICM20948_PIN_NUM_CLK 48U /**< SPI clock GPIO pin. */
45#define K_ICM20948_READ_OP 0x80U /**< SPI read flag: set MSB to signal a read transaction. */
46#define K_ICM20948_WRITE_OP 0x00U /**< SPI write marker (zero). */
47#define K_ICM20948_EMPTY_MESSAGE 0x00U /**< Dummy byte clocked out during SPI reads. */
48
49/* Interrupt */
50#define K_ICM20948_INT_PIN_NUM 4U /**< GPIO interrupt pin. */
51#define K_ICM20948_INT_INTR_TYPE 1U /**< Interrupt trigger type (1=rising). */
52#define K_ICM20948_INT_PULL 0U /**< Pull resistor: 0=none, 1=up, 2=down. */
53
54/* Register bank select */
55#define K_ICM20948_REG_BANK_SEL 0x7FU /**< Register bank select register address. */
56
57/* Bank 0 register addresses */
58#define K_ICM20948_REG_WHO_AM_I 0x00U /**< WHO_AM_I register; expected value 0xEA. */
59#define K_ICM20948_REG_USER_CTRL 0x03U /**< User control register. */
60#define K_ICM20948_REG_LP_CONF 0x05U /**< Low-power configuration register. */
61#define K_ICM20948_REG_PWR_MGMT_1 0x06U /**< Power management 1 register. */
62#define K_ICM20948_REG_PWR_MGMT_2 0x07U /**< Power management 2 register. */
63#define K_ICM20948_REG_INT_ENABLE 0x10U /**< Interrupt enable register. */
64#define K_ICM20948_REG_INT_ENABLE_1 0x11U /**< Interrupt enable 1 register. */
65#define K_ICM20948_REG_INT_ENABLE_2 0x12U /**< Interrupt enable 2 register. */
66#define K_ICM20948_REG_DMP_INT_STATUS 0x18U /**< DMP interrupt status register. */
67#define K_ICM20948_REG_INT_STATUS 0x19U /**< Interrupt status register. */
68#define K_ICM20948_REG_SINGLE_FIFO_PRIORITY_SEL 0x26U /**< FIFO single-stream priority select register. */
69#define K_ICM20948_REG_PERIPH_SENS_DATA_00 0x3BU /**< External sensor data register 0. */
70#define K_ICM20948_REG_FIFO_EN_1 0x66U /**< FIFO enable 1 register. */
71#define K_ICM20948_REG_FIFO_EN_2 0x67U /**< FIFO enable 2 register. */
72#define K_ICM20948_REG_FIFO_RST 0x68U /**< FIFO reset register. */
73#define K_ICM20948_REG_FIFO_MODE 0x69U /**< FIFO mode register. */
74#define K_ICM20948_REG_FIFO_COUNTH 0x70U /**< FIFO byte count high register. */
75#define K_ICM20948_REG_FIFO_COUNTL 0x71U /**< FIFO byte count low register. */
76#define K_ICM20948_REG_FIFO_R_W 0x72U /**< FIFO read/write data register. */
77#define K_ICM20948_REG_HW_FIX_DISABLE 0x75U /**< Hardware fix disable register. */
78#define K_ICM20948_REG_FIFO_CFG 0x76U /**< FIFO configuration register. */
79
80/* Bank 1 register addresses */
81#define K_ICM20948_REG_TIMEBASE_CORRECTION_PLL 0x28U /**< PLL timebase correction register (bank 1). */
82
83/* Bank 2 register addresses */
84#define K_ICM20948_REG_GYRO_SMPLRT_DIV 0x00U /**< Gyroscope sample-rate divider register (bank 2). */
85#define K_ICM20948_REG_GYRO_CONFIG 0x01U /**< Gyroscope configuration register (bank 2). */
86#define K_ICM20948_REG_ACCEL_SMPLRT_DIV_1 0x10U /**< Accelerometer sample-rate divider high register (bank 2). */
87#define K_ICM20948_REG_ACCEL_SMPLRT_DIV_2 0x11U /**< Accelerometer sample-rate divider low register (bank 2). */
88#define K_ICM20948_REG_ACCEL_CONFIG 0x14U /**< Accelerometer configuration register (bank 2). */
89#define K_ICM20948_REG_ACCEL_CONFIG_2 0x15U /**< Accelerometer configuration 2 register (bank 2). */
90#define K_ICM20948_REG_DMP_ADDR_MSB 0x50U /**< DMP program start address MSB (bank 2). */
91#define K_ICM20948_REG_DMP_ADDR_LSB 0x51U /**< DMP program start address LSB (bank 2). */
92
93/* Bank 3 register addresses */
94#define K_ICM20948_I2C_MST_ODR_CONFIG 0x00U /**< I2C master ODR configuration register (bank 3). */
95#define K_ICM20948_REG_I2C_CTRL 0x01U /**< I2C master control register (bank 3). */
96#define K_ICM20948_REG_SLV0_ADDR 0x03U /**< I2C slave 0 address register (bank 3). */
97#define K_ICM20948_REG_SLV0_REG 0x04U /**< I2C slave 0 register address (bank 3). */
98#define K_ICM20948_REG_SLV0_CTRL 0x05U /**< I2C slave 0 control register (bank 3). */
99#define K_ICM20948_REG_SLV0_DO 0x06U /**< I2C slave 0 data out register (bank 3). */
100#define K_ICM20948_I2C_SLV1_ADDR 0x07U /**< I2C slave 1 address register (bank 3). */
101#define K_ICM20948_I2C_SLV1_REG 0x08U /**< I2C slave 1 register address (bank 3). */
102#define K_ICM20948_I2C_SLV1_CTRL 0x09U /**< I2C slave 1 control register (bank 3). */
103#define K_ICM20948_I2C_SLV1_DO 0x0AU /**< I2C slave 1 data out register (bank 3). */
104
105/* DMP memory access */
106#define K_ICM20948_REG_MEM_START_ADDR 0x7CU /**< DMP memory start address register. */
107#define K_ICM20948_REG_MEM_R_W 0x7DU /**< DMP memory read/write register. */
108#define K_ICM20948_REG_MEM_BANK_SEL 0x7EU /**< DMP memory bank select register. */
109#define K_ICM20948_DMP_LOAD_START 0x0090U /**< Start address in DMP memory for firmware load. */
110
111/* DMP memory addresses */
112#define K_ICM20948_DMP_DATA_OUT_CTL1 (4U * 16U) /**< DMP output control 1 address. */
113#define K_ICM20948_DMP_DATA_OUT_CTL2 (4U * 16U + 2U) /**< DMP output control 2 address. */
114#define K_ICM20948_DMP_DATA_INTR_CTL (4U * 16U + 12U) /**< DMP interrupt control address. */
115#define K_ICM20948_DMP_MOTION_EVENT_CTL (4U * 16U + 14U) /**< DMP motion event control address. */
116#define K_ICM20948_DMP_DATA_RDY_STATUS (8U * 16U + 10U) /**< DMP data ready status address. */
117#define K_ICM20948_DMP_ODR_QUAT6 (10U * 16U + 12U) /**< DMP quaternion6 output data rate address. */
118#define K_ICM20948_DMP_ODR_QUAT9 (10U * 16U + 8U) /**< DMP quaternion9 output data rate address. */
119#define K_ICM20948_DMP_ODR_GYRO (11U * 16U + 10U) /**< DMP gyroscope output data rate address. */
120#define K_ICM20948_DMP_ODR_CPASS (11U * 16U + 6U) /**< DMP compass output data rate address. */
121#define K_ICM20948_DMP_ODR_ACCEL (11U * 16U + 14U) /**< DMP accelerometer output data rate address. */
122#define K_ICM20948_DMP_CPASS_TIME_BUFFER (29U * 16U + 8U) /**< DMP compass time buffer address. */
123#define K_ICM20948_DMP_GYRO_SF (19U * 16U) /**< DMP gyroscope scale factor address. */
124#define K_ICM20948_DMP_ACC_SCALE (30U * 16U) /**< DMP accelerometer scale address. */
125#define K_ICM20948_DMP_FIFO_WATERMARK (31U * 16U + 14U) /**< DMP FIFO watermark address. */
126#define K_ICM20948_DMP_BAC_RATE (48U * 16U + 10U) /**< DMP basic activity classifier rate address. */
127#define K_ICM20948_DMP_B2S_RATE (48U * 16U + 8U) /**< DMP bring-to-see rate address. */
128#define K_ICM20948_DMP_ACCEL_ONLY_GAIN (16U * 16U + 12U) /**< DMP accel-only mode gain address. */
129#define K_ICM20948_DMP_ACC_SCALE2 (79U * 16U + 4U) /**< DMP accelerometer scale 2 address. */
130#define K_ICM20948_DMP_CPASS_MTX_00 (23U * 16U) /**< Compass mount matrix [0][0]. */
131#define K_ICM20948_DMP_CPASS_MTX_01 (23U * 16U + 4U) /**< Compass mount matrix [0][1]. */
132#define K_ICM20948_DMP_CPASS_MTX_02 (23U * 16U + 8U) /**< Compass mount matrix [0][2]. */
133#define K_ICM20948_DMP_CPASS_MTX_10 (23U * 16U + 12U) /**< Compass mount matrix [1][0]. */
134#define K_ICM20948_DMP_CPASS_MTX_11 (24U * 16U) /**< Compass mount matrix [1][1]. */
135#define K_ICM20948_DMP_CPASS_MTX_12 (24U * 16U + 4U) /**< Compass mount matrix [1][2]. */
136#define K_ICM20948_DMP_CPASS_MTX_20 (24U * 16U + 8U) /**< Compass mount matrix [2][0]. */
137#define K_ICM20948_DMP_CPASS_MTX_21 (24U * 16U + 12U) /**< Compass mount matrix [2][1]. */
138#define K_ICM20948_DMP_CPASS_MTX_22 (25U * 16U) /**< Compass mount matrix [2][2]. */
139#define K_ICM20948_DMP_GYRO_FULLSCALE (72U * 16U + 12U) /**< DMP gyroscope full-scale address. */
140#define K_ICM20948_DMP_ACCEL_ALPHA_VAR (91U * 16U) /**< DMP accel alpha variance address. */
141#define K_ICM20948_DMP_ACCEL_A_VAR (92U * 16U) /**< DMP accel A variance address. */
142#define K_ICM20948_DMP_ACCEL_CAL_INIT (94U * 16U + 4U) /**< DMP accel calibration init address. */
143#define K_ICM20948_DMP_B2S_MTX_00 (208U * 16U) /**< Body-to-sensor matrix [0][0]. */
144#define K_ICM20948_DMP_B2S_MTX_01 (208U * 16U + 4U) /**< Body-to-sensor matrix [0][1]. */
145#define K_ICM20948_DMP_B2S_MTX_02 (208U * 16U + 8U) /**< Body-to-sensor matrix [0][2]. */
146#define K_ICM20948_DMP_B2S_MTX_10 (208U * 16U + 12U) /**< Body-to-sensor matrix [1][0]. */
147#define K_ICM20948_DMP_B2S_MTX_11 (209U * 16U) /**< Body-to-sensor matrix [1][1]. */
148#define K_ICM20948_DMP_B2S_MTX_12 (209U * 16U + 4U) /**< Body-to-sensor matrix [1][2]. */
149#define K_ICM20948_DMP_B2S_MTX_20 (209U * 16U + 8U) /**< Body-to-sensor matrix [2][0]. */
150#define K_ICM20948_DMP_B2S_MTX_21 (209U * 16U + 12U) /**< Body-to-sensor matrix [2][1]. */
151#define K_ICM20948_DMP_B2S_MTX_22 (210U * 16U) /**< Body-to-sensor matrix [2][2]. */
152
153/* Magnetometer (AK09916) */
154#define K_ICM20948_MAG_WR_ADDR 0x0CU /**< AK09916 magnetometer write address (I2C). */
155#define K_ICM20948_MAG_RD_ADDR 0x8CU /**< AK09916 magnetometer read address (I2C). */
156#define K_ICM20948_MAG_CTRL_2 0x31U /**< AK09916 control 2 register address. */
157
158/* Raw sensor data registers (bank 0) */
159#define K_ICM20948_REG_ACCEL_X_H 0x2DU /**< Accelerometer X high byte register. */
160#define K_ICM20948_REG_ACCEL_X_L 0x2EU /**< Accelerometer X low byte register. */
161#define K_ICM20948_REG_ACCEL_Y_H 0x2FU /**< Accelerometer Y high byte register. */
162#define K_ICM20948_REG_ACCEL_Y_L 0x30U /**< Accelerometer Y low byte register. */
163#define K_ICM20948_REG_ACCEL_Z_H 0x31U /**< Accelerometer Z high byte register. */
164#define K_ICM20948_REG_ACCEL_Z_L 0x32U /**< Accelerometer Z low byte register. */
165#define K_ICM20948_REG_GYRO_X_H 0x33U /**< Gyroscope X high byte register. */
166#define K_ICM20948_REG_GYRO_X_L 0x34U /**< Gyroscope X low byte register. */
167#define K_ICM20948_REG_GYRO_Y_H 0x35U /**< Gyroscope Y high byte register. */
168#define K_ICM20948_REG_GYRO_Y_L 0x36U /**< Gyroscope Y low byte register. */
169#define K_ICM20948_REG_GYRO_Z_H 0x37U /**< Gyroscope Z high byte register. */
170#define K_ICM20948_REG_GYRO_Z_L 0x38U /**< Gyroscope Z low byte register. */
171#define K_ICM20948_REG_MAGNETO_X_L 0x3CU /**< Magnetometer X low byte register. */
172#define K_ICM20948_REG_MAGNETO_X_H 0x3DU /**< Magnetometer X high byte register. */
173#define K_ICM20948_REG_MAGNETO_Y_L 0x3EU /**< Magnetometer Y low byte register. */
174#define K_ICM20948_REG_MAGNETO_Y_H 0x3FU /**< Magnetometer Y high byte register. */
175#define K_ICM20948_REG_MAGNETO_Z_L 0x40U /**< Magnetometer Z low byte register. */
176#define K_ICM20948_REG_MAGNETO_Z_H 0x41U /**< Magnetometer Z high byte register. */
177
178/* Calibration offsets */
179#define K_ICM20948_ACCEL_BIAS_X (0.004621f)
180#define K_ICM20948_ACCEL_BIAS_Y (-0.001157f)
181#define K_ICM20948_ACCEL_BIAS_Z (0.010014f)
182
183#define K_ICM20948_GYRO_BIAS_X (0.681567f)
184#define K_ICM20948_GYRO_BIAS_Y (0.428753f)
185#define K_ICM20948_GYRO_BIAS_Z (-0.329620f)
186
187#define K_ICM20948_MAG_BIAS_X 8.6090f
188#define K_ICM20948_MAG_BIAS_Y -10.9293f
189#define K_ICM20948_MAG_BIAS_Z 16.6568f
190
191/* ----------------------------------------------------------------
192 * STRUCTS AND ENUMS
193 * ---------------------------------------------------------------- */
194
195/** @brief ICM20948 register bank selector. */
203
204/** @brief REG_BANK_SEL register bit layout. */
205typedef union
206{
208 struct
209 {
213 } bits;
215
216/** @brief USER_CTRL register bit layout. */
217typedef union
218{
220 struct
221 {
229 spp_uint8_t dmpEn : 1;
230 } bits;
232
233/** @brief LP_CONFIG register bit layout. */
234typedef union
235{
237 struct
238 {
244 } bits;
246
247/** @brief Clock source selection for PWR_MGMT_1. */
254
255/** @brief PWR_MGMT_1 register bit layout. */
256typedef union
257{
259 struct
260 {
264 spp_uint8_t lpEn : 1;
265 spp_uint8_t sleep : 1;
267 } bits;
269
270/** @brief PWR_MGMT_2 register bit layout. */
285
286/** @brief INT_ENABLE register bit layout. */
287typedef union
288{
290 struct
291 {
295 } bits;
297
298/** @brief INT_ENABLE_2 register bit layout. */
312
313/** @brief INT_STATUS register bit layout. */
314typedef union
315{
317 struct
318 {
322 } bits;
324
325/** @brief DMP_INT_STATUS register bit layout. */
326typedef union
327{
329 struct
330 {
337 } bits;
339
340/** @brief SINGLE_FIFO_PRIORITY_SEL register bit layout. */
352
353/** @brief FIFO_EN_1 register bit layout. */
354typedef union
355{
357 struct
358 {
364 } bits;
366
367/** @brief FIFO_EN_2 register bit layout. */
381
382/** @brief FIFO_RST register bit layout. */
383typedef union
384{
386 struct
387 {
394 } bits;
396
397/** @brief FIFO_MODE register bit layout. */
398typedef union
399{
401 struct
402 {
405 } bits;
407
408/** @brief FIFO_CFG register bit layout. */
409typedef union
410{
412 struct
413 {
416 } bits;
418
419/** @brief HW_FIX_DISABLE register bit layout. */
420typedef union
421{
423 struct
424 {
425 spp_uint8_t bit0 : 1;
426 spp_uint8_t bit1 : 1;
427 spp_uint8_t bit2 : 1;
428 spp_uint8_t bit3 : 1;
429 spp_uint8_t bit4 : 1;
430 spp_uint8_t bit5 : 1;
431 spp_uint8_t bit6 : 1;
432 spp_uint8_t bit7 : 1;
433 } bits;
435
436/** @brief Gyroscope full-scale range selection. */
444
445/** @brief GYRO_CONFIG_1 register bit layout. */
446typedef union
447{
449 struct
450 {
455 } bits;
457
458/** @brief Accelerometer full-scale range selection. */
466
467/** @brief ACCEL_CONFIG register bit layout. */
479
480/** @brief ACCEL_CONFIG_2 register bit layout. */
481typedef union
482{
484 struct
485 {
488 } bits;
490
491/** @brief I2C_MST_CTRL register bit layout. */
492typedef union
493{
495 struct
496 {
500 } bits;
502
503/** @brief I2C_SLVx_ADDR register bit layout. */
504typedef union
505{
507 struct
508 {
509 spp_uint8_t i2cId : 7;
511 } bits;
513
514/** @brief I2C_SLVx_CTRL register bit layout. */
515typedef union
516{
518 struct
519 {
521 spp_uint8_t group : 1;
525 } bits;
527
528/** @brief I2C_MST_ODR_CONFIG register bit layout. */
529typedef union
530{
532 struct
533 {
536 } bits;
538
539/**
540 * @brief Parsed sensor sample from the DMP FIFO.
541 */
542typedef struct
543{
544 float ax; /**< Accelerometer X (g) */
545 float ay; /**< Accelerometer Y (g) */
546 float az; /**< Accelerometer Z (g) */
547 float gx; /**< Gyroscope X (dps) */
548 float gy; /**< Gyroscope Y (dps) */
549 float gz; /**< Gyroscope Z (dps) */
550 float mx; /**< Magnetometer X (uT) */
551 float my; /**< Magnetometer Y (uT) */
552 float mz; /**< Magnetometer Z (uT) */
553 float qw; /**< Quaternion W (-) */
554 float qx; /**< Quaternion X (-) */
555 float qy; /**< Quaternion Y (-) */
556 float qz; /**< Quaternion Z (-) */
557 float accuracy; /**< Quaternion accuracy */
558 spp_bool_t dataReady; /**< Set when a FIFO packet has been parsed. */
560
561/**
562 * @brief ICM20948 interrupt and GPIO context.
563 */
564typedef struct
565{
566 volatile spp_bool_t drdyFlag; /**< Set by ISR on data-ready interrupt. */
567 SPP_GpioIsrCtx_t isr_ctx; /**< ISR context (points at drdyFlag). */
568 spp_uint32_t intPin; /**< GPIO interrupt pin number. */
569 spp_uint32_t intIntrType; /**< Interrupt trigger type (1=rising). */
570 spp_uint32_t intPull; /**< Pull resistor: 0=none, 1=up, 2=down. */
572
573/**
574 * @brief ICM20948 sensor instance.
575 *
576 * One static instance (@c s_icmData) is kept inside icm20948.c; its hardware
577 * fields are set from K_ICM20948_* constants by SPP_SERVICES_ICM20948_init.
578 */
579typedef struct
580{
581 /* Hardware configuration — set at declaration */
582 spp_uint8_t spiDevIdx; /**< SPI device handle index. */
583 spp_uint32_t intPin; /**< GPIO interrupt pin number. */
584 spp_uint32_t intIntrType; /**< Interrupt edge type (1=rising). */
585 spp_uint32_t intPull; /**< Pull resistor (0=none, 1=up). */
586
587 /* Runtime state — filled in by init, do not set manually */
588 void *p_spi; /**< SPI device handle. */
589 ICM20948_Data_t icmData; /**< Interrupt flag and ISR context. */
590 ICM20948_SensorData_t lastData; /**< Last parsed FIFO sample. */
591 spp_uint16_t seq; /**< Packet sequence counter. */
592} ICM20948_t;
593
594
595/* ----------------------------------------------------------------
596 * PUBLIC FUNCTIONS
597 * ---------------------------------------------------------------- */
598
599/**
600 * @brief Returns the ICM20948 producer contract for PUBSUB registration.
601 * @return Pointer to the static producer contract.
602 */
604
605#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:113
ICM20948_RegBank_t
ICM20948 register bank selector.
Definition icm20948.h:197
@ K_ICM20948_REG_BANK_2
Definition icm20948.h:200
@ K_ICM20948_REG_BANK_1
Definition icm20948.h:199
@ K_ICM20948_REG_BANK_0
Definition icm20948.h:198
@ K_ICM20948_REG_BANK_3
Definition icm20948.h:201
ICM20948_AccelFsSel_t
Accelerometer full-scale range selection.
Definition icm20948.h:460
@ K_ICM20948_ACCEL_FS_4G
Definition icm20948.h:462
@ K_ICM20948_ACCEL_FS_2G
Definition icm20948.h:461
@ K_ICM20948_ACCEL_FS_16G
Definition icm20948.h:464
@ K_ICM20948_ACCEL_FS_8G
Definition icm20948.h:463
ICM20948_GyroFsSel_t
Gyroscope full-scale range selection.
Definition icm20948.h:438
@ K_ICM20948_GYRO_FS_2000DPS
Definition icm20948.h:442
@ K_ICM20948_GYRO_FS_500DPS
Definition icm20948.h:440
@ K_ICM20948_GYRO_FS_1000DPS
Definition icm20948.h:441
@ K_ICM20948_GYRO_FS_250DPS
Definition icm20948.h:439
ICM20948_ClockSel_t
Clock source selection for PWR_MGMT_1.
Definition icm20948.h:249
@ K_ICM20948_CLK_AUTO
Definition icm20948.h:251
@ K_ICM20948_CLK_STOP
Definition icm20948.h:252
@ K_ICM20948_CLK_INTERNAL_20MHZ
Definition icm20948.h:250
SPP module descriptor and registry API.
ICM20948 interrupt and GPIO context.
Definition icm20948.h:565
spp_uint32_t intPin
Definition icm20948.h:568
spp_uint32_t intPull
Definition icm20948.h:570
volatile spp_bool_t drdyFlag
Definition icm20948.h:566
spp_uint32_t intIntrType
Definition icm20948.h:569
SPP_GpioIsrCtx_t isr_ctx
Definition icm20948.h:567
Parsed sensor sample from the DMP FIFO.
Definition icm20948.h:543
spp_bool_t dataReady
Definition icm20948.h:558
ICM20948 sensor instance.
Definition icm20948.h:580
spp_uint32_t intIntrType
Definition icm20948.h:584
spp_uint32_t intPull
Definition icm20948.h:585
ICM20948_SensorData_t lastData
Definition icm20948.h:590
spp_uint16_t seq
Definition icm20948.h:591
spp_uint8_t spiDevIdx
Definition icm20948.h:582
ICM20948_Data_t icmData
Definition icm20948.h:589
void * p_spi
Definition icm20948.h:588
spp_uint32_t intPin
Definition icm20948.h:583
Context passed to the GPIO ISR handler.
Definition gpio.h:27
Defines the callbacks and metadata of an SPP producer.
Definition service.h:25
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:482
ACCEL_CONFIG register bit layout.
Definition icm20948.h:469
REG_BANK_SEL register bit layout.
Definition icm20948.h:206
spp_uint8_t value
Definition icm20948.h:207
DMP_INT_STATUS register bit layout.
Definition icm20948.h:327
FIFO_CFG register bit layout.
Definition icm20948.h:410
spp_uint8_t value
Definition icm20948.h:411
FIFO_EN_1 register bit layout.
Definition icm20948.h:355
spp_uint8_t value
Definition icm20948.h:356
FIFO_EN_2 register bit layout.
Definition icm20948.h:369
spp_uint8_t value
Definition icm20948.h:370
FIFO_MODE register bit layout.
Definition icm20948.h:399
FIFO_RST register bit layout.
Definition icm20948.h:384
spp_uint8_t value
Definition icm20948.h:385
GYRO_CONFIG_1 register bit layout.
Definition icm20948.h:447
HW_FIX_DISABLE register bit layout.
Definition icm20948.h:421
I2C_MST_CTRL register bit layout.
Definition icm20948.h:493
spp_uint8_t value
Definition icm20948.h:494
I2C_MST_ODR_CONFIG register bit layout.
Definition icm20948.h:530
I2C_SLVx_ADDR register bit layout.
Definition icm20948.h:505
I2C_SLVx_CTRL register bit layout.
Definition icm20948.h:516
INT_ENABLE_2 register bit layout.
Definition icm20948.h:300
INT_ENABLE register bit layout.
Definition icm20948.h:288
INT_STATUS register bit layout.
Definition icm20948.h:315
LP_CONFIG register bit layout.
Definition icm20948.h:235
spp_uint8_t value
Definition icm20948.h:236
PWR_MGMT_1 register bit layout.
Definition icm20948.h:257
PWR_MGMT_2 register bit layout.
Definition icm20948.h:272
SINGLE_FIFO_PRIORITY_SEL register bit layout.
Definition icm20948.h:342
USER_CTRL register bit layout.
Definition icm20948.h:218