Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
imu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
16#ifndef __SENSOR_IMU_H__
17#define __SENSOR_IMU_H__
18
19#include "../../common.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
26#define IMU_ACCEL_SCALE_2G (2)
27#define IMU_ACCEL_SCALE_4G (4)
28#define IMU_ACCEL_SCALE_8G (8)
29#define IMU_ACCEL_SCALE_16G (16)
30
32#define IMU_GYRO_SCALE_125DPS (125)
33#define IMU_GYRO_SCALE_250DPS (250)
34#define IMU_GYRO_SCALE_500DPS (500)
35#define IMU_GYRO_SCALE_1000DPS (1000)
36#define IMU_GYRO_SCALE_2000DPS (2000)
37
39#define IMU_NUM_AXES (3U)
40
42#define ACCEL_AXIS_NUM (IMU_NUM_AXES)
43
45#define GYRO_AXIS_NUM (IMU_NUM_AXES)
46
50typedef struct imu_config_s {
52 int32_t accel_fs_g;
53
55 int32_t gyro_fs_dps;
56
58 int32_t data_rate_hz;
60
62typedef struct imu_data_s {
64 struct {
65 int16_t raw;
66 float phys;
69 struct {
70 int16_t raw;
71 float phys;
74
84status_t imu_init(const imu_config_t *p_config, generic_cb_t data_ready_cb);
85
94
95#ifdef __cplusplus
96}
97#endif /* __cplusplus */
98
99#endif /* __SENSOR_IMU_H__ */
100
enum status_e status_t
void(* generic_cb_t)(void)
Definition common.h:84
#define ACCEL_AXIS_NUM
Definition imu.h:42
status_t imu_read(imu_data_t *const p_data)
Read IMU sensor data.
struct imu_data_s imu_data_t
struct imu_config_s imu_config_t
IMU sensor configurations.
#define GYRO_AXIS_NUM
Definition imu.h:45
status_t imu_init(const imu_config_t *p_config, generic_cb_t data_ready_cb)
Initialize and start generation of IMU sensor data.
int32_t data_rate_hz
Definition imu.h:58
int32_t gyro_fs_dps
Definition imu.h:55
int32_t accel_fs_g
Definition imu.h:52
IMU sensor configurations.
Definition imu.h:50
float phys
Definition imu.h:66
struct imu_data_s::@1 gyro[((3U))]
struct imu_data_s::@0 accel[((3U))]
int16_t raw
Definition imu.h:65
Definition imu.h:62