37#ifndef INVENSENSE3_456_H
38#define INVENSENSE3_456_H
44#define INVENSENSE3_456_FIFO_BUFFER_LEN 22
45#define INVENSENSE3_456_BUFFER_SIZE INVENSENSE3_456_FIFO_BUFFER_LEN * sizeof(struct FIFODataHighRes) + 3
54 uint8_t gx : 4,
ax : 4, gy : 4, ay : 4, gz : 4, az : 4;
SPI peripheral structure.
SPI transaction structure.
struct invensense3_456_spi_t spi
SPI specific configuration (support SPI only for now)
uint8_t config_idx
The current configuration index (used for setup/initial configuration)
int sample_numbers
expected FIFO packet number, assuming reading at PERIODIC_FREQUENCY
enum invensense3_456_device_t device
The device type detected.
void invensense3_456_init(struct invensense3_456_t *inv)
Initialize the invensense v3 sensor instance.
uint8_t rx_buf[INVENSENSE3_456_BUFFER_SIZE]
Receive buffer.
uint8_t slave_idx
Slave index used for Slave Select.
struct spi_transaction trans
Transaction used during configuration and measurements.
@ INVENSENSE3_456_RUNNING
enum invensense3_456_odr_t imu_odr
Accelerometer / gyro Output Data Rate configuration.
enum invensense3_456_status_t status
Status of the invensense device.
@ INVENSENSE3_456_ICM45686
float imu_samplerate
Sample rate in Hz from the imu_odr.
#define INVENSENSE3_456_BUFFER_SIZE
uint8_t abi_id
The ABI id used to broadcast the device measurements.
uint8_t tx_buf[4]
Transmit buffer.
uint32_t timer
Used to time operations during configuration (samples left during measuring)
void invensense3_456_event(struct invensense3_456_t *inv)
Should be called in the event thread.
struct spi_periph * p
Peripheral device for communication.
void invensense3_456_periodic(struct invensense3_456_t *inv)
Should be called periodically to request sensor readings.
@ INVENSENSE3_456_ODR_100HZ
@ INVENSENSE3_456_ODR_6_4KHZ
@ INVENSENSE3_456_ODR_50HZ
@ INVENSENSE3_456_ODR_800HZ
@ INVENSENSE3_456_ODR_25HZ
@ INVENSENSE3_456_ODR_3_2KHZ
@ INVENSENSE3_456_ODR_1_6KHZ
@ INVENSENSE3_456_ODR_400HZ
@ INVENSENSE3_456_ODR_200HZ
Architecture independent SPI (Serial Peripheral Interface) API.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.