Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the Invensense V2 IMUs ICM20948, ICM20648 and ICM20649. More...
Go to the source code of this file.
Data Structures | |
struct | invensense2_spi_t |
struct | invensense2_i2c_t |
struct | invensense2_t |
union | invensense2_t.__unnamed325__ |
Macros | |
#define | INVENSENSE2_SAMPLE_CNT 22 |
#define | INVENSENSE2_SAMPLE_SIZE 14 |
#define | INVENSENSE2_BUFFER_SIZE ((INVENSENSE2_SAMPLE_SIZE*INVENSENSE2_SAMPLE_CNT) + 3) |
Functions | |
void | invensense2_init (struct invensense2_t *inv) |
Initialize the invensense v2 sensor instance. More... | |
void | invensense2_periodic (struct invensense2_t *inv) |
Should be called periodically to request sensor readings. More... | |
void | invensense2_event (struct invensense2_t *inv) |
Should be called in the event thread. More... | |
Driver for the Invensense V2 IMUs ICM20948, ICM20648 and ICM20649.
Definition in file invensense2.h.
struct invensense2_spi_t |
Definition at line 42 of file invensense2.h.
Data Fields | ||
---|---|---|
struct spi_periph * | p | Peripheral device for communication. |
volatile uint8_t | rx_buf[INVENSENSE2_BUFFER_SIZE] | Receive buffer. |
uint8_t | slave_idx | Slave index used for Slave Select. |
struct spi_transaction | trans | Transaction used during configuration and measurements. |
volatile uint8_t | tx_buf[2] | Transmit buffer. |
struct invensense2_i2c_t |
Definition at line 52 of file invensense2.h.
Data Fields | ||
---|---|---|
struct i2c_periph * | p | Peripheral device for communication. |
uint8_t | slave_addr | The I2C slave address on the bus. |
struct i2c_transaction | trans | TRansaction used during configuration and measurements. |
struct invensense2_t |
Definition at line 123 of file invensense2.h.
Data Fields | ||
---|---|---|
union invensense2_t | __unnamed__ | |
uint8_t | abi_id | The ABI id used to broadcast the device measurements. |
enum invensense2_accel_dlpf_t | accel_dlpf | Accelerometer DLPF configuration. |
enum invensense2_accel_range_t | accel_range | Accelerometer range configuration. |
enum invensense2_bus_t | bus | The communication bus used to connect the device SPI/I2C. |
uint8_t | config_idx | The current configuration index. |
enum invensense2_device_t | device | The device type detected. |
enum invensense2_gyro_dlpf_t | gyro_dlpf | Gyro DLPF configuration. |
enum invensense2_gyro_range_t | gyro_range | Gyro range configuration. |
uint8_t | register_bank | The current register bank communicating with. |
enum invensense2_status_t | status | Status of the invensense V2 device. |
float | timebase_correction_pll | Timebase correction factor for the PLL clock. |
uint32_t | timer | Used to time operations during configuration (samples left during measuring) |
union invensense2_t.__unnamed325__ |
Definition at line 129 of file invensense2.h.
Data Fields | ||
---|---|---|
struct invensense2_i2c_t | i2c | I2C specific configuration. |
struct invensense2_spi_t | spi | SPI specific configuration. |
#define INVENSENSE2_BUFFER_SIZE ((INVENSENSE2_SAMPLE_SIZE*INVENSENSE2_SAMPLE_CNT) + 3) |
Definition at line 39 of file invensense2.h.
#define INVENSENSE2_SAMPLE_CNT 22 |
Definition at line 37 of file invensense2.h.
#define INVENSENSE2_SAMPLE_SIZE 14 |
Definition at line 38 of file invensense2.h.
Definition at line 102 of file invensense2.h.
Definition at line 114 of file invensense2.h.
enum invensense2_bus_t |
Enumerator | |
---|---|
INVENSENSE2_SPI | |
INVENSENSE2_I2C |
Definition at line 59 of file invensense2.h.
enum invensense2_device_t |
Enumerator | |
---|---|
INVENSENSE2_UNKOWN | |
INVENSENSE2_ICM20648 | |
INVENSENSE2_ICM20649 | |
INVENSENSE2_ICM20948 |
Definition at line 72 of file invensense2.h.
Definition at line 80 of file invensense2.h.
Definition at line 93 of file invensense2.h.
enum invensense2_status_t |
Enumerator | |
---|---|
INVENSENSE2_IDLE | |
INVENSENSE2_CONFIG | |
INVENSENSE2_RUNNING |
Definition at line 65 of file invensense2.h.
void invensense2_event | ( | struct invensense2_t * | inv | ) |
Should be called in the event thread.
inv | The invensense v2 instance |
Definition at line 152 of file invensense2.c.
References invensense2_t::bus, invensense2_t::config_idx, invensense2_t::device, I2CTransDone, I2CTransFailed, I2CTransSuccess, INV2_WHOAMI_ICM20648, INV2_WHOAMI_ICM20649, INV2_WHOAMI_ICM20948, INV2REG_BANK_SEL, INV2REG_FIFO_COUNTH, invensense2_config(), INVENSENSE2_CONFIG, invensense2_fix_config(), INVENSENSE2_I2C, INVENSENSE2_ICM20648, INVENSENSE2_ICM20649, INVENSENSE2_ICM20948, INVENSENSE2_IDLE, invensense2_parse_data(), invensense2_register_read(), INVENSENSE2_RUNNING, INVENSENSE2_SAMPLE_SIZE, INVENSENSE2_SPI, invensense2_t::register_bank, SPITransDone, SPITransFailed, SPITransSuccess, invensense2_t::status, and invensense2_t::timer.
Referenced by imu_cube_event(), and imu_pixhawk6x_event().
void invensense2_init | ( | struct invensense2_t * | inv | ) |
Initialize the invensense v2 sensor instance.
inv | The structure containing the configuration of the invensense v2 instance |
Definition at line 79 of file invensense2.c.
References invensense2_t::bus, invensense2_t::config_idx, invensense2_t::device, I2CTransDone, INVENSENSE2_IDLE, INVENSENSE2_SPI, INVENSENSE2_UNKOWN, invensense2_t::register_bank, SPICphaEdge2, SPICpolIdleHigh, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, and invensense2_t::status.
Referenced by imu_cube_init(), and imu_pixhawk6x_init().
void invensense2_periodic | ( | struct invensense2_t * | inv | ) |
Should be called periodically to request sensor readings.
inv | The invensense v2 instance |
Definition at line 119 of file invensense2.c.
References invensense2_t::bus, I2CTransDone, INV2REG_FIFO_COUNTH, INV2REG_WHO_AM_I, invensense2_config(), INVENSENSE2_CONFIG, INVENSENSE2_I2C, INVENSENSE2_IDLE, invensense2_register_read(), INVENSENSE2_RUNNING, INVENSENSE2_SPI, SPITransDone, and invensense2_t::status.
Referenced by imu_cube_periodic(), and imu_pixhawk6x_periodic().