Go to the source code of this file.
Functions | |
void | hmc5883l_async_read (float *mag_data) |
bool | hmc5883l_present () |
void | hmc5883l_request_async_update () |
bool | hmc5883lInit () |
static void | read_cb (uint8_t result) |
Variables | |
static uint8_t | cmd |
static volatile float | data_ [3] |
static uint8_t | i2c_buf_ [6] |
static uint32_t | last_update_ms_ |
static bool | mag_present_ |
static uint32_t | next_update_ms_ |
#define HMC58X3_ADDR 0x1E |
Definition at line 28 of file drv_hmc5883l.c.
#define HMC58X3_CRA 0x00 |
Definition at line 29 of file drv_hmc5883l.c.
#define HMC58X3_CRA_AVG_2_MEAS 0x20 |
Definition at line 39 of file drv_hmc5883l.c.
#define HMC58X3_CRA_AVG_4_MEAS 0x40 |
Definition at line 40 of file drv_hmc5883l.c.
#define HMC58X3_CRA_AVG_8_MEAS 0x60 |
Definition at line 41 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_0_75 0x00 |
Definition at line 43 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_15 0x10 |
Definition at line 47 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_1_5 0x04 |
Definition at line 44 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_3 0x08 |
Definition at line 45 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_30 0x14 |
Definition at line 48 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_75 0x18 |
Definition at line 49 of file drv_hmc5883l.c.
#define HMC58X3_CRA_DO_7_5 0x0C |
Definition at line 46 of file drv_hmc5883l.c.
#define HMC58X3_CRA_MEAS_MODE_NEG_BIAS 0x02 |
Definition at line 53 of file drv_hmc5883l.c.
#define HMC58X3_CRA_MEAS_MODE_NORMAL 0x00 |
Definition at line 51 of file drv_hmc5883l.c.
#define HMC58X3_CRA_MEAS_MODE_POS_BIAS 0x01 |
Definition at line 52 of file drv_hmc5883l.c.
#define HMC58X3_CRA_NO_AVG 0x00 |
Definition at line 38 of file drv_hmc5883l.c.
#define HMC58X3_CRB 0x01 |
Definition at line 30 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_1090 0x20 |
Definition at line 56 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_1370 0x00 |
Definition at line 55 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_230 0xE0 |
Definition at line 62 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_330 0xC0 |
Definition at line 61 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_390 0xA0 |
Definition at line 60 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_440 0x80 |
Definition at line 59 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_660 0x60 |
Definition at line 58 of file drv_hmc5883l.c.
#define HMC58X3_CRB_GN_820 0x40 |
Definition at line 57 of file drv_hmc5883l.c.
#define HMC58X3_DATA 0x03 |
Definition at line 32 of file drv_hmc5883l.c.
#define HMC58X3_ID1 0x0A |
Definition at line 34 of file drv_hmc5883l.c.
#define HMC58X3_ID2 0x0B |
Definition at line 35 of file drv_hmc5883l.c.
#define HMC58X3_ID3 0x0C |
Definition at line 36 of file drv_hmc5883l.c.
#define HMC58X3_MODE 0x02 |
Definition at line 31 of file drv_hmc5883l.c.
#define HMC58X3_MODE_CONTINUOUS 0x00 |
Definition at line 65 of file drv_hmc5883l.c.
#define HMC58X3_MODE_HS 0x80 |
Definition at line 64 of file drv_hmc5883l.c.
#define HMC58X3_MODE_IDLE 0x02 |
Definition at line 67 of file drv_hmc5883l.c.
#define HMC58X3_MODE_SINGLE 0x01 |
Definition at line 66 of file drv_hmc5883l.c.
#define HMC58X3_SR_LOCK 0x02 |
Definition at line 69 of file drv_hmc5883l.c.
#define HMC58X3_SR_RDY 0x01 |
Definition at line 70 of file drv_hmc5883l.c.
#define HMC58X3_STATUS 0x09 |
Definition at line 33 of file drv_hmc5883l.c.
#define HMC58X3_TIMEOUT 30000 |
Definition at line 72 of file drv_hmc5883l.c.
void hmc5883l_async_read | ( | float * | mag_data | ) |
Definition at line 138 of file drv_hmc5883l.c.
bool hmc5883l_present | ( | ) |
Definition at line 111 of file drv_hmc5883l.c.
void hmc5883l_request_async_update | ( | ) |
Definition at line 118 of file drv_hmc5883l.c.
bool hmc5883lInit | ( | ) |
Definition at line 83 of file drv_hmc5883l.c.
|
static |
Definition at line 127 of file drv_hmc5883l.c.
|
static |
Definition at line 79 of file drv_hmc5883l.c.
|
static |
Definition at line 75 of file drv_hmc5883l.c.
|
static |
Definition at line 74 of file drv_hmc5883l.c.
|
static |
Definition at line 76 of file drv_hmc5883l.c.
|
static |
Definition at line 78 of file drv_hmc5883l.c.
|
static |
Definition at line 77 of file drv_hmc5883l.c.