|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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
struct Lis3mdl mag_lis3mdl
void mag_lis3mdl_module_periodic(void)
#define LIS3MDL_CHAN_X_SIGN
#define LIS3MDL_MODE_CONTINUOUS
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define LIS3MDL_PERFORMANCE_ULTRA_HIGH
void mag_lis3mdl_report(void)
#define LIS3MDL_SCALE_4_GAUSS
#define ANGLE_BFP_OF_REAL(_af)
#define LIS3MDL_DATA_RATE_80_HZ
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.
struct Imu imu
global IMU state
Common code for AP and FBW telemetry.
void int32_rmat_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_a2b, struct Int32Vect3 *va)
rotate 3D vector by rotation matrix.
volatile bool data_available
data ready flag
void imu_scale_mag(struct Imu *_imu)
#define MAG_LIS3MDL_SENDER_ID
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
void mag_lis3mdl_module_init(void)
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
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)
void lis3mdl_event(struct Lis3mdl *mag)
#define LIS3MDL_CHAN_Z_SIGN
#define LIS3MDL_CHAN_Y_SIGN
#define VECT3_COPY(_a, _b)
void mag_lis3mdl_module_event(void)
static void lis3mdl_periodic(struct Lis3mdl *mag)
convenience function: read or start configuration if not already initialized