37 #define RM3100_ADDR0 (0b0100000 << 1)
38 #define RM3100_ADDR1 (0b0100001 << 1)
39 #define RM3100_ADDR2 (0b0100010 << 1)
40 #define RM3100_ADDR3 (0b0100011 << 1)
43 #define RM3100_RATE_600 0x92
44 #define RM3100_RATE_300 0x93
45 #define RM3100_RATE_150 0x94
46 #define RM3100_RATE_75 0x95
47 #define RM3100_RATE_37 0x96
48 #define RM3100_RATE_18 0x97
49 #define RM3100_RATE_9 0x98
50 #define RM3100_RATE_4_5 0x99
51 #define RM3100_RATE_2_3 0x9A
52 #define RM3100_RATE_1_2 0x9B
53 #define RM3100_RATE_0_6 0x9C
54 #define RM3100_RATE_0_3 0x9D
55 #define RM3100_RATE_0_15 0x9E
56 #define RM3100_RATE_0_075 0x9F
59 #define RM3100_TMRC_DEFAULT RM3100_RATE_150
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
Paparazzi fixed point algebra.
void rm3100_init(struct Rm3100 *mag, struct i2c_periph *i2c_p, uint8_t addr, uint8_t data_rate)
Rm3100Status
config status states
enum Rm3100Status status
init status
bool initialized
config done flag
static void rm3100_periodic(struct Rm3100 *mag)
convenience function: read or start configuration if not already initialized
struct i2c_transaction i2c_trans
i2c transaction
struct i2c_periph * i2c_p
peripheral used for communcation
volatile bool data_available
data ready flag
void rm3100_read(struct Rm3100 *mag)
uint8_t data_rate
sensor data rate
void rm3100_configure(struct Rm3100 *mag)
void rm3100_event(struct Rm3100 *mag)
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.