29 #include "pprzlink/messages.h"
31 #include "generated/airframe.h"
33 #ifndef LIS3MDL_CHAN_X
34 #define LIS3MDL_CHAN_X 0
36 #ifndef LIS3MDL_CHAN_Y
37 #define LIS3MDL_CHAN_Y 1
39 #ifndef LIS3MDL_CHAN_Z
40 #define LIS3MDL_CHAN_Z 2
42 #ifndef LIS3MDL_CHAN_X_SIGN
43 #define LIS3MDL_CHAN_X_SIGN +
45 #ifndef LIS3MDL_CHAN_Y_SIGN
46 #define LIS3MDL_CHAN_Y_SIGN +
48 #ifndef LIS3MDL_CHAN_Z_SIGN
49 #define LIS3MDL_CHAN_Z_SIGN +
52 #if MODULE_LIS3MDL_UPDATE_AHRS
56 #if defined LIS3MDL_MAG_TO_IMU_PHI && defined LIS3MDL_MAG_TO_IMU_THETA && defined LIS3MDL_MAG_TO_IMU_PSI
57 #define USE_MAG_TO_IMU 1
60 #define USE_MAG_TO_IMU 0
74 #if MODULE_LIS3MDL_UPDATE_AHRS && USE_MAG_TO_IMU
94 #if MODULE_LIS3MDL_UPDATE_AHRS
120 #if MODULE_LIS3MDL_SYNC_SEND
123 #if MODULE_LIS3MDL_UPDATE_AHRS || MODULE_LIS3MDL_SYNC_SEND
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
struct Imu imu
global IMU state
#define LIS3MDL_SCALE_4_GAUSS
void mag_lis3mdl_module_init(void)
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
#define LIS3MDL_MODE_CONTINUOUS
#define MAG_LIS3MDL_SENDER_ID
#define LIS3MDL_CHAN_Z_SIGN
void mag_lis3mdl_module_event(void)
void int32_rmat_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_a2b, struct Int32Vect3 *va)
rotate 3D vector by rotation matrix.
#define LIS3MDL_DATA_RATE_80_HZ
#define LIS3MDL_CHAN_Y_SIGN
#define LIS3MDL_PERFORMANCE_ULTRA_HIGH
void mag_lis3mdl_module_periodic(void)
#define LIS3MDL_CHAN_X_SIGN
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
Inertial Measurement Unit interface.
struct Lis3mdl mag_lis3mdl
#define ANGLE_BFP_OF_REAL(_af)
void imu_scale_mag(struct Imu *_imu)
Common code for AP and FBW telemetry.
Module wrapper for ST LIS3MDL magnetometers.
static void lis3mdl_periodic(struct Lis3mdl *mag)
convenience function: read or start configuration if not already initialized
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void lis3mdl_event(struct Lis3mdl *mag)
volatile bool data_available
data ready flag
void mag_lis3mdl_report(void)
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.
void lis3mdl_init(struct Lis3mdl *mag, struct i2c_periph *i2c_p, uint8_t addr, uint8_t data_rate, uint8_t scale, uint8_t mode, uint8_t perf)