30 #include "pprzlink/messages.h"
32 #include "generated/airframe.h"
34 #ifndef HMC58XX_CHAN_X
35 #define HMC58XX_CHAN_X 0
37 #ifndef HMC58XX_CHAN_Y
38 #define HMC58XX_CHAN_Y 1
40 #ifndef HMC58XX_CHAN_Z
41 #define HMC58XX_CHAN_Z 2
43 #ifndef HMC58XX_CHAN_X_SIGN
44 #define HMC58XX_CHAN_X_SIGN +
46 #ifndef HMC58XX_CHAN_Y_SIGN
47 #define HMC58XX_CHAN_Y_SIGN +
49 #ifndef HMC58XX_CHAN_Z_SIGN
50 #define HMC58XX_CHAN_Z_SIGN +
53 #if MODULE_HMC58XX_UPDATE_AHRS
57 #if defined HMC58XX_MAG_TO_IMU_PHI && defined HMC58XX_MAG_TO_IMU_THETA && defined HMC58XX_MAG_TO_IMU_PSI
58 #define USE_MAG_TO_IMU 1
61 #define USE_MAG_TO_IMU 0
71 #if MODULE_HMC58XX_UPDATE_AHRS && USE_MAG_TO_IMU
91 #if MODULE_HMC58XX_UPDATE_AHRS
117 #if MODULE_HMC58XX_SYNC_SEND
120 #if MODULE_HMC58XX_UPDATE_AHRS || MODULE_HMC58XX_SYNC_SEND
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
volatile bool data_available
data ready flag
#define HMC58XX_CHAN_X_SIGN
#define MAG_HMC58XX_SENDER_ID
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
struct Imu imu
global IMU state
void mag_hmc58xx_module_event(void)
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
void int32_rmat_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_a2b, struct Int32Vect3 *va)
rotate 3D vector by rotation matrix.
void mag_hmc58xx_module_init(void)
struct Hmc58xx mag_hmc58xx
#define HMC58XX_CHAN_Y_SIGN
void mag_hmc58xx_module_periodic(void)
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
Inertial Measurement Unit interface.
#define HMC58XX_CHAN_Z_SIGN
Module wrapper for Honeywell HMC5843 and HMC5883 magnetometers.
#define ANGLE_BFP_OF_REAL(_af)
#define DefaultChannel
SITL.
void imu_scale_mag(struct Imu *_imu)
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
Common code for AP and FBW telemetry.
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void hmc58xx_event(struct Hmc58xx *hmc)
void mag_hmc58xx_report(void)
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.