17#ifndef IMU_LSM6DSV16X_H
18#define IMU_LSM6DSV16X_H
23#include "lsm6dsv16x_reg.h"
25#define IMU_I2C_ADDR_7BIT 0x6Bu
26#define IMU_FIFO_REG LSM6DSV16X_FIFO_DATA_OUT_TAG
27#define IMU_FIFO_WORD_BYTES 7u
28#define IMU_FIFO_MAX_WORDS 48u
46#define IMU_SH_HZ(fast) ((fast) ? 120.0f : 60.0f)
62 uint32_t words, gyro,
acc, mag, mag_dup, sh_nack, empty, unknown;
71 uint8_t last_mag_raw[6];
74 uint8_t last_baro_raw[5];
size_t imu_fifo_parse(imu_t *imu, const uint8_t *raw, uint16_t words, imu_event_t *ev, size_t cap, imu_parse_stats_t *st)
Decodes 'words' words read in a burst from IMU_FIFO_REG.
int32_t imu_init(imu_t *imu, const sensor_bus_t *bus, const imu_config_t *cfg)
int32_t imu_fifo_level(imu_t *imu, uint16_t *words)
Number of 7-byte words in the FIFO.
int32_t imu_fifo_read_burst(imu_t *imu, uint8_t *raw, uint16_t words)
Blocking read via sensor_bus (for tests or when DMA is not used)
Platform-independent bus interface.
uint8_t mag_fast
0: LIS2MDL 50 Hz / hub 60 Hz; 1: 100 Hz / 120 Hz
uint8_t xl_lpf2_bw
lsm6dsv16x_filt_xl_lp2_bandwidth_t
uint8_t watermark_words
4 = 2 gyro + 2 acc -> one interrupt every 2 samples
uint8_t mag_enable
LIS2MDL via sensor hub (requires IKS4A1 Mode 3)
uint8_t gy_lpf1_bw
lsm6dsv16x_filt_gy_lp1_bandwidth_t
imu_odr_t odr
same ODR for gyro and acc
uint8_t type
imu_ev_type_t
static USBD_StatusTypeDef st(HAL_StatusTypeDef h)