37 #define HMC58X3_ADDR 0x1E 38 #define HMC58X3_CRA 0x00 39 #define HMC58X3_CRB 0x01 40 #define HMC58X3_MODE 0x02 41 #define HMC58X3_DATA 0x03 42 #define HMC58X3_STATUS 0x09 43 #define HMC58X3_ID1 0x0A 44 #define HMC58X3_ID2 0x0B 45 #define HMC58X3_ID3 0x0C 47 #define HMC58X3_CRA_NO_AVG 0x00 48 #define HMC58X3_CRA_AVG_2_MEAS 0x20 49 #define HMC58X3_CRA_AVG_4_MEAS 0x40 50 #define HMC58X3_CRA_AVG_8_MEAS 0x60 52 #define HMC58X3_CRA_DO_0_75 0x00 53 #define HMC58X3_CRA_DO_1_5 0x04 54 #define HMC58X3_CRA_DO_3 0x08 55 #define HMC58X3_CRA_DO_7_5 0x0C 56 #define HMC58X3_CRA_DO_15 0x10 57 #define HMC58X3_CRA_DO_30 0x14 58 #define HMC58X3_CRA_DO_75 0x18 60 #define HMC58X3_CRA_MEAS_MODE_NORMAL 0x00 61 #define HMC58X3_CRA_MEAS_MODE_POS_BIAS 0x01 62 #define HMC58X3_CRA_MEAS_MODE_NEG_BIAS 0x02 64 #define HMC58X3_CRB_GN_1370 0x00 65 #define HMC58X3_CRB_GN_1090 0x20 66 #define HMC58X3_CRB_GN_820 0x40 67 #define HMC58X3_CRB_GN_660 0x60 68 #define HMC58X3_CRB_GN_440 0x80 69 #define HMC58X3_CRB_GN_390 0xA0 70 #define HMC58X3_CRB_GN_330 0xC0 71 #define HMC58X3_CRB_GN_230 0xE0 73 #define HMC58X3_MODE_HS 0x80 74 #define HMC58X3_MODE_CONTINUOUS 0x00 75 #define HMC58X3_MODE_SINGLE 0x01 76 #define HMC58X3_MODE_IDLE 0x02 78 #define HMC58X3_SR_LOCK 0x02 79 #define HMC58X3_SR_RDY 0x01 81 #define HMC58X3_TIMEOUT 30000 91 void cb(uint8_t result);
bool read(float mag_data[])