44 #define AK8963_I2C_ADDR 0x0C 45 #define AK8963_DEVICE_ID 0x48 47 #define AK8963REG_WIA 0x00 48 #define AK8963REG_ST1 0x02 49 #define AK8963REG_HXL 0x03 50 #define AK8963REG_ASAX 0x10 51 #define AK8963REG_CNTL1 0x0A 52 #define AK8963REG_CNTL2 0x0B 54 #define AK8963_SINGLE_MEAS_MODE 0x01 55 #define AK8963_CONTINUOUS_MODE1 0x02 56 #define AK8963_CONTINUOUS_MODE2 0x06 57 #define AK8963_POWERDOWN_MODE 0x00 58 #define AK8963_SELFTEST_MODE 0x08 59 #define AK8963_FUZE_MODE 0x0F 60 #define AK8963_16BIT_ADC 0x10 61 #define AK8963_14BIT_ADC 0x00 62 #define AK8963_RESET 0x01 63 #define AK8963_HOFL 0x08 67 #define AK09916_DEVICE_ID_A 0x48 // same as AK8963 68 #define AK09916_DEVICE_ID_B 0x09 // additional ID byte ("INFO" on AK9063 without content specification.) 70 #define AK09916REG_HXL 0x11 71 #define AK09916REG_HXH 0x12 72 #define AK09916REG_HYL 0x13 73 #define AK09916REG_HYH 0x14 74 #define AK09916REG_HZL 0x15 75 #define AK09916REG_HZH 0x16 76 #define AK09916REG_ST1 0x10 77 #define AK09916REG_ST2 0x18 78 #define AK09916REG_CNTL2 0x31 79 #define AK09916REG_CNTL3 0x32 82 #define AK09916_CNTL2_POWERDOWN_MODE 0x00 83 #define AK09916_CNTL2_SINGLE_MODE 0x01 84 #define AK09916_CNTL2_CONTINOUS_MODE_10HZ 0x02 85 #define AK09916_CNTL2_CONTINOUS_MODE_20HZ 0x04 86 #define AK09916_CNTL2_CONTINOUS_MODE_50HZ 0x06 87 #define AK09916_CNTL2_CONTINOUS_MODE_100HZ 0x08 88 #define AK09916_CNTL2_SELFTEST_MODE 0x10 89 #define AK09916_CNTL3_SRST 0x01 90 #define AK09916_ST1_DRDY 0x01 91 #define AK09916_ST1_DOR 0x02 118 void set_passthrough(uint8_t reg, uint8_t size, uint8_t *out = NULL);
119 void passthrough_read(uint8_t reg, uint8_t *buf, uint8_t size);
120 void passthrough_write(uint8_t reg, uint8_t val);
121 void read_block(uint8_t reg, uint8_t *val, uint8_t count);
125 int ak8963_setup_master_i2c();
126 bool ak8963_check_id(uint8_t &
id);
127 bool ak8963_read_adjustments();
140 void write_reg(
unsigned reg, uint8_t value);
149 bool _mag_reading_data{
false};
device::Device * _interface
static constexpr float MPU9250_MAG_RANGE_GA
uint8_t read_reg(unsigned reg, uint32_t speed=MPU9250_LOW_BUS_SPEED)
Read a register from the mpu.
device::Device * AK8963_I2C_interface(int bus)
perf_counter_t _mag_errors
Definitions for the generic base classes in the device framework.
perf_counter_t _mag_overruns
Rotation
Enum for board and external compass rotations.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Helper class implementing the magnetometer driver node.
perf_counter_t _mag_overflows
void measure()
Fetch measurements from the sensor and update the report buffers.
Fundamental base class for all physical drivers (I2C, SPI).
void write_reg(unsigned reg, uint8_t value)
Write a register in the mpu.
Performance measuring tools.