31 #ifndef PIOS_HMC5883_H
32 #define PIOS_HMC5883_H
38 #define PIOS_HMC5883_I2C_ADDR 0x1E
39 #define PIOS_HMC5883_I2C_READ_ADDR 0x3D
40 #define PIOS_HMC5883_I2C_WRITE_ADDR 0x3C
41 #define PIOS_HMC5883_CONFIG_REG_A (uint8_t)0x00
42 #define PIOS_HMC5883_CONFIG_REG_B (uint8_t)0x01
43 #define PIOS_HMC5883_MODE_REG (uint8_t)0x02
44 #define PIOS_HMC5883_DATAOUT_XMSB_REG 0x03
45 #define PIOS_HMC5883_DATAOUT_XLSB_REG 0x04
46 #define PIOS_HMC5883_DATAOUT_ZMSB_REG 0x05
47 #define PIOS_HMC5883_DATAOUT_ZLSB_REG 0x06
48 #define PIOS_HMC5883_DATAOUT_YMSB_REG 0x07
49 #define PIOS_HMC5883_DATAOUT_YLSB_REG 0x08
50 #define PIOS_HMC5883_DATAOUT_STATUS_REG 0x09
51 #define PIOS_HMC5883_DATAOUT_IDA_REG 0x0A
52 #define PIOS_HMC5883_DATAOUT_IDB_REG 0x0B
53 #define PIOS_HMC5883_DATAOUT_IDC_REG 0x0C
56 #define PIOS_HMC5883_ODR_0_75 0x00
57 #define PIOS_HMC5883_ODR_1_5 0x04
58 #define PIOS_HMC5883_ODR_3 0x08
59 #define PIOS_HMC5883_ODR_7_5 0x0C
60 #define PIOS_HMC5883_ODR_15 0x10
61 #define PIOS_HMC5883_ODR_30 0x14
62 #define PIOS_HMC5883_ODR_75 0x18
65 #define PIOS_HMC5883_MEASCONF_NORMAL 0x00
66 #define PIOS_HMC5883_MEASCONF_BIAS_POS 0x01
67 #define PIOS_HMC5883_MEASCONF_BIAS_NEG 0x02
70 #define PIOS_HMC5883_GAIN_0_88 0x00
71 #define PIOS_HMC5883_GAIN_1_3 0x20
72 #define PIOS_HMC5883_GAIN_1_9 0x40
73 #define PIOS_HMC5883_GAIN_2_5 0x60
74 #define PIOS_HMC5883_GAIN_4_0 0x80
75 #define PIOS_HMC5883_GAIN_4_7 0xA0
76 #define PIOS_HMC5883_GAIN_5_6 0xC0
77 #define PIOS_HMC5883_GAIN_8_1 0xE0
80 #define PIOS_HMC5883_MODE_CONTINUOUS 0x00
81 #define PIOS_HMC5883_MODE_SINGLE 0x01
82 #define PIOS_HMC5883_MODE_IDLE 0x02
83 #define PIOS_HMC5883_MODE_SLEEP 0x03
const struct pios_exti_cfg * exti_cfg
int32_t PIOS_HMC5883_SetOrientation(enum pios_hmc5883_orientation orientation)
int32_t PIOS_HMC5883_Test(void)
bool PIOS_HMC5883_IRQHandler()
static struct flyingpicmd_cfg_fa cfg
struct pios_i2c_adapter * pios_i2c_t
int32_t PIOS_HMC5883_Init(pios_i2c_t i2c_id, const struct pios_hmc5883_cfg *cfg)
enum pios_hmc5883_orientation Default_Orientation