Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the Invensense V3 IMUs ICM40605, ICM40609, ICM42605, IIM42652 and ICM42688. More...
Go to the source code of this file.
Data Structures | |
struct | invensense3_spi_t |
struct | invensense3_i2c_t |
struct | invensense3_t |
union | invensense3_t.__unnamed327__ |
Macros | |
#define | INVENSENSE3_FIFO_BUFFER_LEN 22 |
#define | INVENSENSE3_BUFFER_SIZE INVENSENSE3_FIFO_BUFFER_LEN * 20 + 3 |
Functions | |
void | invensense3_init (struct invensense3_t *inv) |
Initialize the invensense v3 sensor instance. More... | |
void | invensense3_periodic (struct invensense3_t *inv) |
Should be called periodically to request sensor readings. More... | |
void | invensense3_event (struct invensense3_t *inv) |
Should be called in the event thread. More... | |
Driver for the Invensense V3 IMUs ICM40605, ICM40609, ICM42605, IIM42652 and ICM42688.
Definition in file invensense3.h.
struct invensense3_spi_t |
Definition at line 42 of file invensense3.h.
Data Fields | ||
---|---|---|
struct spi_periph * | p | Peripheral device for communication. |
uint8_t | rx_buf[INVENSENSE3_BUFFER_SIZE] | Receive buffer. |
uint8_t | slave_idx | Slave index used for Slave Select. |
struct spi_transaction | trans | Transaction used during configuration and measurements. |
uint8_t | tx_buf[2] | Transmit buffer. |
struct invensense3_i2c_t |
Definition at line 52 of file invensense3.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 invensense3_t |
Definition at line 154 of file invensense3.h.
Data Fields | ||
---|---|---|
union invensense3_t | __unnamed__ | |
uint8_t | abi_id | The ABI id used to broadcast the device measurements. |
uint16_t | accel_aaf | Accelerometer Anti-alias filter 3dB Bandwidth configuration [Hz]. |
uint16_t | accel_aaf_regs[4] | Accelerometer Anti-alias filter register values. |
enum invensense3_accel_odr_t | accel_odr | Accelerometer Output Data Rate configuration. |
enum invensense3_accel_range_t | accel_range | Accelerometer range configuration. |
float | accel_samplerate | Sample rate in Hz from the accel_odr. |
enum invensense3_bus_t | bus | The communication bus used to connect the device SPI/I2C. |
uint8_t | config_idx | The current configuration index. |
enum invensense3_device_t | device | The device type detected. |
uint16_t | gyro_aaf | Gyro Anti-alias filter 3dB Bandwidth configuration [Hz]. |
uint16_t | gyro_aaf_regs[4] | Gyro Anti-alias filter register values. |
enum invensense3_gyro_odr_t | gyro_odr | Gyro Output Data Rate configuration. |
enum invensense3_gyro_range_t | gyro_range | Gyro range configuration. |
float | gyro_samplerate | Sample rate in Hz from the gyro_odr. |
enum invensense3_parser_t | parser | Parser of the device. |
uint8_t | register_bank | The current register bank communicating with. |
uint8_t * | rx_buffer | |
uint16_t * | rx_length | |
int | sample_numbers | expected FIFO packet number, assuming reading at PERIODIC_FREQUENCY |
enum invensense3_fifo_packet_t | sample_size | FIFO packet size. |
enum invensense3_status_t | status | Status of the invensense v3 device. |
uint32_t | timer | Used to time operations during configuration (samples left during measuring) |
uint8_t * | tx_buffer |
union invensense3_t.__unnamed327__ |
Definition at line 161 of file invensense3.h.
Data Fields | ||
---|---|---|
struct invensense3_i2c_t | i2c | I2C specific configuration. |
struct invensense3_spi_t | spi | SPI specific configuration. |
#define INVENSENSE3_BUFFER_SIZE INVENSENSE3_FIFO_BUFFER_LEN * 20 + 3 |
Definition at line 39 of file invensense3.h.
#define INVENSENSE3_FIFO_BUFFER_LEN 22 |
Definition at line 38 of file invensense3.h.
Definition at line 126 of file invensense3.h.
Enumerator | |
---|---|
INVENSENSE3_ACCEL_RANGE_32G | Only possible for ICM40609. |
INVENSENSE3_ACCEL_RANGE_16G | |
INVENSENSE3_ACCEL_RANGE_8G | |
INVENSENSE3_ACCEL_RANGE_4G | |
INVENSENSE3_ACCEL_RANGE_2G |
Definition at line 145 of file invensense3.h.
enum invensense3_bus_t |
Enumerator | |
---|---|
INVENSENSE3_SPI | |
INVENSENSE3_I2C |
Definition at line 59 of file invensense3.h.
enum invensense3_device_t |
Enumerator | |
---|---|
INVENSENSE3_UNKOWN | |
INVENSENSE3_ICM40605 | |
INVENSENSE3_ICM40609 | |
INVENSENSE3_ICM42605 | |
INVENSENSE3_IIM42652 | |
INVENSENSE3_ICM42688 |
Definition at line 85 of file invensense3.h.
Enumerator | |
---|---|
INVENSENSE3_SAMPLE_SIZE_PK1 | |
INVENSENSE3_SAMPLE_SIZE_PK2 | |
INVENSENSE3_SAMPLE_SIZE_PK3 | |
INVENSENSE3_SAMPLE_SIZE_PK4 |
Definition at line 77 of file invensense3.h.
Definition at line 95 of file invensense3.h.
Definition at line 114 of file invensense3.h.
enum invensense3_parser_t |
Enumerator | |
---|---|
INVENSENSE3_PARSER_REGISTERS | |
INVENSENSE3_PARSER_FIFO |
Definition at line 72 of file invensense3.h.
enum invensense3_status_t |
Enumerator | |
---|---|
INVENSENSE3_IDLE | |
INVENSENSE3_CONFIG | |
INVENSENSE3_RUNNING |
Definition at line 65 of file invensense3.h.
void invensense3_event | ( | struct invensense3_t * | inv | ) |
Should be called in the event thread.
inv | The invensense v3 instance |
Definition at line 327 of file invensense3.c.
References invensense3_t::bus, invensense3_t::config_idx, invensense3_t::device, I2CTransDone, I2CTransFailed, I2CTransSuccess, INV3_WHOAMI_ICM40605, INV3_WHOAMI_ICM40609, INV3_WHOAMI_ICM42605, INV3_WHOAMI_ICM42688, INV3_WHOAMI_IIM42652, INV3REG_BANK_SEL, INV3REG_FIFO_COUNTH, invensense3_config(), INVENSENSE3_CONFIG, invensense3_fifo_sample_size, invensense3_fix_config(), INVENSENSE3_I2C, INVENSENSE3_ICM40605, INVENSENSE3_ICM40609, INVENSENSE3_ICM42605, INVENSENSE3_ICM42688, INVENSENSE3_IDLE, INVENSENSE3_IIM42652, invensense3_parse_fifo_data(), invensense3_parse_reg_data(), INVENSENSE3_PARSER_FIFO, INVENSENSE3_PARSER_REGISTERS, invensense3_register_read(), INVENSENSE3_RUNNING, INVENSENSE3_SPI, Min, n_samples, invensense3_t::parser, invensense3_t::register_bank, invensense3_t::rx_buffer, invensense3_t::rx_length, invensense3_t::sample_size, SPITransDone, SPITransFailed, SPITransSuccess, invensense3_t::status, invensense3_t::timer, and invensense3_t::tx_buffer.
Referenced by imu_cube_event(), imu_icm42688_event(), and imu_pixhawk6x_event().
void invensense3_init | ( | struct invensense3_t * | inv | ) |
Initialize the invensense v3 sensor instance.
inv | The structure containing the configuration of the invensense v3 instance |
Definition at line 223 of file invensense3.c.
References invensense3_t::accel_odr, invensense3_t::bus, invensense3_t::config_idx, invensense3_t::device, invensense3_t::gyro_odr, I2CTransDone, INVENSENSE3_IDLE, INVENSENSE3_SAMPLE_SIZE_PK3, INVENSENSE3_SPI, INVENSENSE3_UNKOWN, Min, invensense3_t::register_bank, invensense3_t::rx_buffer, invensense3_t::rx_length, invensense3_t::sample_numbers, invensense3_t::sample_size, samples_from_odr(), SPICphaEdge2, SPICpolIdleHigh, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, invensense3_t::status, and invensense3_t::tx_buffer.
Referenced by imu_cube_init(), imu_icm42688_init(), and imu_pixhawk6x_init().
void invensense3_periodic | ( | struct invensense3_t * | inv | ) |
Should be called periodically to request sensor readings.
inv | The invensense v3 instance |
Definition at line 275 of file invensense3.c.
References invensense3_t::bus, I2CTransDone, INV3REG_FIFO_COUNTH, INV3REG_TEMP_DATA1, INV3REG_WHO_AM_I, invensense3_config(), INVENSENSE3_CONFIG, invensense3_fifo_sample_size, INVENSENSE3_I2C, INVENSENSE3_IDLE, INVENSENSE3_PARSER_FIFO, INVENSENSE3_PARSER_REGISTERS, invensense3_register_read(), INVENSENSE3_RUNNING, INVENSENSE3_SPI, Min, invensense3_t::parser, invensense3_t::sample_numbers, invensense3_t::sample_size, SPITransDone, invensense3_t::status, and invensense3_t::timer.
Referenced by imu_cube_periodic(), imu_icm42688_periodic(), and imu_pixhawk6x_periodic().