43 #define ICM20948_AK09916_SAMPLE_RATE 100 45 #define AK09916_I2C_ADDR 0x0C 46 #define AK09916_DEVICE_ID 0x48 48 #define AK09916REG_WIA 0x00 49 #define AK09916REG_CNTL1 0x0A 50 #define AK09916REG_ASAX 0x10 52 #define AK09916_SINGLE_MEAS_MODE 0x01 53 #define AK09916_CONTINUOUS_MODE1 0x02 54 #define AK09916_CONTINUOUS_MODE2 0x06 55 #define AK09916_POWERDOWN_MODE 0x00 56 #define AK09916_SELFTEST_MODE 0x08 57 #define AK09916_FUZE_MODE 0x0F 58 #define AK09916_16BIT_ADC 0x10 59 #define AK09916_14BIT_ADC 0x00 60 #define AK09916_RESET 0x01 61 #define AK09916_HOFL 0x08 65 #define AK09916_DEVICE_ID_A 0x48 // same as AK09916 66 #define AK09916_DEVICE_ID_B 0x09 // additional ID byte ("INFO" on AK9063 without content specification.) 68 #define AK09916REG_HXL 0x11 69 #define AK09916REG_HXH 0x12 70 #define AK09916REG_HYL 0x13 71 #define AK09916REG_HYH 0x14 72 #define AK09916REG_HZL 0x15 73 #define AK09916REG_HZH 0x16 74 #define AK09916REG_ST1 0x10 75 #define AK09916REG_ST2 0x18 76 #define AK09916REG_CNTL2 0x31 77 #define AK09916REG_CNTL3 0x32 80 #define AK09916_CNTL2_POWERDOWN_MODE 0x00 81 #define AK09916_CNTL2_SINGLE_MODE 0x01 82 #define AK09916_CNTL2_CONTINOUS_MODE_10HZ 0x02 83 #define AK09916_CNTL2_CONTINOUS_MODE_20HZ 0x04 84 #define AK09916_CNTL2_CONTINOUS_MODE_50HZ 0x06 85 #define AK09916_CNTL2_CONTINOUS_MODE_100HZ 0x08 86 #define AK09916_CNTL2_SELFTEST_MODE 0x10 87 #define AK09916_CNTL3_SRST 0x01 88 #define AK09916_ST1_DRDY 0x01 89 #define AK09916_ST1_DOR 0x02 117 void set_passthrough(uint8_t reg, uint8_t size, uint8_t *out = NULL);
118 void passthrough_read(uint8_t reg, uint8_t *buf, uint8_t size);
119 void passthrough_write(uint8_t reg, uint8_t val);
120 void read_block(uint8_t reg, uint8_t *val, uint8_t count);
124 int ak09916_setup_master_i2c();
125 bool ak09916_check_id(uint8_t &
id);
126 bool ak09916_read_adjustments();
139 void write_reg(
unsigned reg, uint8_t value);
148 bool _mag_reading_data{
false};
perf_counter_t _mag_errors
device::Device * _interface
static constexpr float ICM20948_MAG_RANGE_GA
Helper class implementing the magnetometer driver node.
Definitions for the generic base classes in the device framework.
void write_reg(unsigned reg, uint8_t value)
Write a register in the mpu.
uint8_t read_reg(unsigned reg, uint32_t speed=ICM20948_LOW_BUS_SPEED)
Read a register from the mpu.
device::Device * AK09916_I2C_interface(int bus)
void measure()
Fetch measurements from the sensor and update the report buffers.
Rotation
Enum for board and external compass rotations.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
perf_counter_t _mag_overruns
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Fundamental base class for all physical drivers (I2C, SPI).
perf_counter_t _mag_overflows
Performance measuring tools.