27 #include "generated/modules.h"
37 #if IMU_CUBE_ORANGEPLUS
52 imu1.spi.p = &CUBE_IMU1_SPI_DEV;
53 imu1.spi.slave_idx = CUBE_IMU1_SPI_SLAVE_IDX;
68 #if IMU_CUBE_ORANGEPLUS
73 imu2.spi.p = &CUBE_IMU2_SPI_DEV;
74 imu2.spi.slave_idx = CUBE_IMU2_SPI_SLAVE_IDX;
114 imu3.spi.p = &CUBE_IMU3_SPI_DEV;
115 imu3.spi.slave_idx = CUBE_IMU3_SPI_SLAVE_IDX;
134 #if IMU_CUBE_ORANGEPLUS
146 #if IMU_CUBE_ORANGEPLUS
Main include for ABI (AirBorneInterface).
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
int32_t phi
in rad with INT32_ANGLE_FRAC
int32_t psi
in rad with INT32_ANGLE_FRAC
int32_t theta
in rad with INT32_ANGLE_FRAC
#define ANGLE_BFP_OF_REAL(_af)
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.
void imu_set_defaults_accel(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a accel sensor WARNING: Should be called before sensor is publishing messages to...
void imu_set_defaults_gyro(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Rates *neutral, const struct Int32Rates *scale)
Set the defaults for a gyro sensor WARNING: Should be called before sensor is publishing messages to ...
Inertial Measurement Unit interface.
static struct Mpu60x0_Spi imu2
void imu_cube_periodic(void)
static struct invensense2_t imu3
static struct invensense2_t imu1
void imu_cube_event(void)
void invensense2_event(struct invensense2_t *inv)
Should be called in the event thread.
void invensense2_periodic(struct invensense2_t *inv)
Should be called periodically to request sensor readings.
void invensense2_init(struct invensense2_t *inv)
Initialize the invensense v2 sensor instance.
Driver for the Invensense V2 IMUs ICM20948, ICM20648 and ICM20649.
enum invensense2_accel_range_t accel_range
Accelerometer range configuration.
@ INVENSENSE2_GYRO_DLPF_229HZ
@ INVENSENSE2_GYRO_RANGE_4000DPS
Only possible for ICM20649.
enum invensense2_gyro_dlpf_t gyro_dlpf
Gyro DLPF configuration.
@ INVENSENSE2_ACCEL_RANGE_30G
Only possible for ICM20649.
@ INVENSENSE2_ACCEL_DLPF_265HZ
enum invensense2_bus_t bus
The communication bus used to connect the device SPI/I2C.
enum invensense2_accel_dlpf_t accel_dlpf
Accelerometer DLPF configuration.
uint8_t abi_id
The ABI id used to broadcast the device measurements.
enum invensense2_gyro_range_t gyro_range
Gyro range configuration.
void invensense3_periodic(struct invensense3_t *inv)
Should be called periodically to request sensor readings.
void invensense3_event(struct invensense3_t *inv)
Should be called in the event thread.
void invensense3_init(struct invensense3_t *inv)
Initialize the invensense v3 sensor instance.
Driver for the Invensense V3 IMUs ICM40605, ICM40609, ICM42605, IIM42652 and ICM42688.
@ INVENSENSE3_ACCEL_RANGE_32G
Only possible for ICM40609.
@ INVENSENSE3_GYRO_ODR_4KHZ
@ INVENSENSE3_PARSER_FIFO
@ INVENSENSE3_ACCEL_ODR_4KHZ
@ INVENSENSE3_GYRO_RANGE_2000DPS
const struct Int32Rates MPU60X0_GYRO_SENS_FRAC[4][2]
const struct Int32Vect3 MPU60X0_ACCEL_SENS_FRAC[4][2]
uint8_t smplrt_div
Sample rate divider.
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0ACCDLPF dlpf_cfg_acc
Digital Low Pass Filter for acceleremoter (ICM devices only)
enum Mpu60x0GyroRanges gyro_range
deg/s Range
@ MPU60X0_GYRO_RANGE_2000
@ MPU60X0_ACCEL_RANGE_16G
void mpu60x0_spi_event(struct Mpu60x0_Spi *mpu)
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
Driver for the MPU-60X0 using SPI.
volatile bool data_available
data ready flag
struct Mpu60x0Config config
float temp
temperature in degrees Celcius
union Mpu60x0_Spi::@342 data_rates
static void mpu60x0_spi_periodic(struct Mpu60x0_Spi *mpu)
convenience function: read or start configuration if not already initialized
union Mpu60x0_Spi::@341 data_accel
Architecture independent SPI (Serial Peripheral Interface) API.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.