6 #include "oXs_config_basic.h"
7 #include "oXs_config_advanced.h"
8 #include "oXs_config_macros.h"
13 #define HMC5883L_ADDRESS (0x1E)
14 #define HMC5883L_REG_CONFIG_A (0x00)
15 #define HMC5883L_REG_CONFIG_B (0x01)
16 #define HMC5883L_REG_MODE (0x02)
17 #define HMC5883L_REG_OUT_X_M (0x03)
18 #define HMC5883L_REG_OUT_X_L (0x04)
19 #define HMC5883L_REG_OUT_Z_M (0x05)
20 #define HMC5883L_REG_OUT_Z_L (0x06)
21 #define HMC5883L_REG_OUT_Y_M (0x07)
22 #define HMC5883L_REG_OUT_Y_L (0x08)
23 #define HMC5883L_REG_STATUS (0x09)
24 #define HMC5883L_REG_IDENT_A (0x0A)
25 #define HMC5883L_REG_IDENT_B (0x0B)
26 #define HMC5883L_REG_IDENT_C (0x0C)
28 // number of samples for averages
29 #define HMC5883L_SAMPLES_8 0b11
30 #define HMC5883L_SAMPLES_4 0b10
31 #define HMC5883L_SAMPLES_2 0b01
32 #define HMC5883L_SAMPLES_1 0b00
36 #define HMC5883L_DATARATE_75HZ 0b110
37 #define HMC5883L_DATARATE_30HZ 0b101
38 #define HMC5883L_DATARATE_15HZ 0b100
39 #define HMC5883L_DATARATE_7_5HZ 0b011
40 #define HMC5883L_DATARATE_3HZ 0b010
41 #define HMC5883L_DATARATE_1_5HZ 0b001
42 #define HMC5883L_DATARATE_0_75_HZ 0b000
47 #define HMC5883L_RANGE_8_1GA 0b111
48 #define HMC5883L_RANGE_5_6GA 0b110
49 #define HMC5883L_RANGE_4_7GA 0b101
50 #define HMC5883L_RANGE_4GA 0b100
51 #define HMC5883L_RANGE_2_5GA 0b011
52 #define HMC5883L_RANGE_1_9GA 0b010
53 #define HMC5883L_RANGE_1_3GA 0b001
54 #define HMC5883L_RANGE_0_88GA 0b000
58 #define HMC5883L_IDLE 0b10
59 #define HMC5883L_SINGLE 0b01
60 #define HMC5883L_CONTINOUS 0b00
62 boolean
setup_hmc5883() ;
64 boolean
read_hmc5883() ; // return a flag that is true when a new heading is available
68 #endif // OXS_HMC5883_h