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
Ak8975Status
Normal status states.
volatile bool data_available
data ready flag
uint32_t last_meas_time
last measurement time in ms
enum Ak8975ConfStatus init_status
init status
Ak8975ConfStatus
config status states
static void ak8975_periodic(struct Ak8975 *ak)
convenience function: read or start configuration if not already initialized
void ak8975_event(struct Ak8975 *ak)
enum Ak8975Status status
main status
void ak8975_configure(struct Ak8975 *ak)
I2C transaction structure.
bool initialized
config done flag
I2C peripheral structure.
void ak8975_init(struct Ak8975 *ak, struct i2c_periph *i2c_p, uint8_t addr)
struct i2c_transaction i2c_trans
i2c transaction used for communication with the ak8936
void ak8975_read(struct Ak8975 *ak)
struct i2c_periph * i2c_p
peripheral used for communcation
Paparazzi fixed point algebra.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.