22 #include "../common/axis.h"
23 #include "../config/sensors.h"
24 #include "../config/compass.h"
48 static inline bool ins_mag_is_calibrated(
struct ins_mag *
self) {
return self->calibratingM == 0; }
50 static inline int32_t ins_mag_get_x(
struct ins_mag *
self) {
return self->magADC[
X]; }
51 static inline int32_t ins_mag_get_y(
struct ins_mag *
self) {
return self->magADC[
Y]; }
52 static inline int32_t ins_mag_get_z(
struct ins_mag *
self) {
return self->magADC[
Z]; }
#define XYZ_AXIS_COUNT
Definition: axis.h:26
void ins_mag_save_trims(const struct ins_mag *self, struct config *config)
Definition: compass.c:64
int16_t mag_min[3]
Definition: compass.h:33
int16_t mag_max[3]
Definition: compass.h:32
const struct mag_config * config
Definition: compass.h:35
void ins_mag_init(struct ins_mag *self, const struct mag_config *config, const struct sensor_trims_config *trims)
Definition: compass.c:39
int16_t calibratingM
Definition: compass.h:39
struct sensor_trims_config trims
Definition: compass.h:37
uint8_t z
set the acc deadband for z-Axis, this ignores small accelerations
Definition: accelerometer.h:52
rollAndPitchTrims_t trims
accelerometer trim
Definition: accelerometer.h:51
void ins_mag_start_calibration(struct ins_mag *self)
Definition: compass.c:55
void ins_mag_process_sample(struct ins_mag *self, int32_t x, int32_t y, int32_t z)
Definition: compass.c:68
float mag_scale[3]
Definition: compass.h:31
int32_t magADC[XYZ_AXIS_COUNT]
Definition: compass.h:27
float magneticDeclination
Definition: compass.h:29