35 #define AK8975_I2C_SLV_ADDR (0x0C<<1)
36 #define AK8975_REG_ST1_ADDR 0x02
37 #define AK8975_REG_CNTL_ADDR 0x0A
38 #define AK8975_REG_ASASX 0x10
39 #define AK8975_MODE_FUSE_ACCESS 0b00001111
40 #define AK8975_MODE_POWER_DOWN 0b00000000
41 #define AK8975_MODE_SINGLE_MEAS 0b00000001
enum Ak8975Status status
main status
void ak8975_read(struct Ak8975 *ak)
Ak8975ConfStatus
config status states
@ AK_DISABLE_ACCESS_CALIBRATION
struct i2c_transaction i2c_trans
i2c transaction used for communication with the ak8936
void ak8975_configure(struct Ak8975 *ak)
void ak8975_init(struct Ak8975 *ak, struct i2c_periph *i2c_p, uint8_t addr)
enum Ak8975ConfStatus init_status
init status
uint32_t last_meas_time
last measurement time in ms
Ak8975Status
Normal status states.
static void ak8975_periodic(struct Ak8975 *ak)
convenience function: read or start configuration if not already initialized
volatile bool data_available
data ready flag
bool initialized
config done flag
struct i2c_periph * i2c_p
peripheral used for communcation
void ak8975_event(struct Ak8975 *ak)
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
Paparazzi fixed point algebra.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.