37 #define INVENSENSE2_SAMPLE_CNT 22
38 #define INVENSENSE2_SAMPLE_SIZE 14
39 #define INVENSENSE2_BUFFER_SIZE ((INVENSENSE2_SAMPLE_SIZE*INVENSENSE2_SAMPLE_CNT) + 3)
I2C transaction structure.
SPI peripheral structure.
SPI transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
enum invensense2_accel_range_t accel_range
Accelerometer range configuration.
uint8_t slave_addr
The I2C slave address on the bus.
@ INVENSENSE2_GYRO_DLPF_73HZ
@ INVENSENSE2_GYRO_DLPF_229HZ
@ INVENSENSE2_GYRO_DLPF_188HZ
@ INVENSENSE2_GYRO_DLPF_377HZ
@ INVENSENSE2_GYRO_DLPF_36HZ
@ INVENSENSE2_GYRO_DLPF_18HZ
@ INVENSENSE2_GYRO_DLPF_154HZ
@ INVENSENSE2_GYRO_DLPF_OFF
@ INVENSENSE2_GYRO_DLPF_9HZ
enum invensense2_device_t device
The device type detected.
struct spi_periph * p
Peripheral device for communication.
@ INVENSENSE2_GYRO_RANGE_4000DPS
Only possible for ICM20649.
@ INVENSENSE2_GYRO_RANGE_500DPS
@ INVENSENSE2_GYRO_RANGE_2000DPS
@ INVENSENSE2_GYRO_RANGE_1000DPS
@ INVENSENSE2_GYRO_RANGE_250DPS
Not possible for ICM20649.
void invensense2_event(struct invensense2_t *inv)
Should be called in the event thread.
struct i2c_periph * p
Peripheral device for communication.
uint8_t config_idx
The current configuration index.
struct spi_transaction trans
Transaction used during configuration and measurements.
enum invensense2_gyro_dlpf_t gyro_dlpf
Gyro DLPF configuration.
uint8_t register_bank
The current register bank communicating with.
invensense2_accel_range_t
@ INVENSENSE2_ACCEL_RANGE_2G
Not possible for ICM20649.
@ INVENSENSE2_ACCEL_RANGE_8G
@ INVENSENSE2_ACCEL_RANGE_16G
@ INVENSENSE2_ACCEL_RANGE_4G
@ INVENSENSE2_ACCEL_RANGE_30G
Only possible for ICM20649.
enum invensense2_status_t status
Status of the invensense V2 device.
@ INVENSENSE2_ACCEL_DLPF_499HZ
@ INVENSENSE2_ACCEL_DLPF_17HZ
@ INVENSENSE2_ACCEL_DLPF_136HZ
@ INVENSENSE2_ACCEL_DLPF_8HZ
@ INVENSENSE2_ACCEL_DLPF_34HZ
@ INVENSENSE2_ACCEL_DLPF_265HZ
@ INVENSENSE2_ACCEL_DLPF_69HZ
@ INVENSENSE2_ACCEL_DLPF_OFF
struct i2c_transaction trans
TRansaction used during configuration and measurements.
volatile uint8_t tx_buf[2]
Transmit buffer.
float timebase_correction_pll
Timebase correction factor for the PLL clock.
uint8_t slave_idx
Slave index used for Slave Select.
void invensense2_periodic(struct invensense2_t *inv)
Should be called periodically to request sensor readings.
enum invensense2_bus_t bus
The communication bus used to connect the device SPI/I2C.
volatile uint8_t rx_buf[INVENSENSE2_BUFFER_SIZE]
Receive buffer.
uint32_t timer
Used to time operations during configuration (samples left during measuring)
#define INVENSENSE2_BUFFER_SIZE
enum invensense2_accel_dlpf_t accel_dlpf
Accelerometer DLPF configuration.
uint8_t abi_id
The ABI id used to broadcast the device measurements.
void invensense2_init(struct invensense2_t *inv)
Initialize the invensense v2 sensor instance.
enum invensense2_gyro_range_t gyro_range
Gyro range configuration.
Architecture independent SPI (Serial Peripheral Interface) API.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.