8#ifdef USE_BMI270_BMM150
14static constexpr uint8_t BMI270_REG_CHIP_ID = 0x00;
15static constexpr uint8_t BMI270_REG_STATUS = 0x03;
16static constexpr uint8_t BMI270_REG_DATA_8 = 0x0C;
17static constexpr uint8_t BMI270_REG_DATA_14 = 0x12;
18static constexpr uint8_t BMI270_REG_TEMP_0 = 0x22;
19static constexpr uint8_t BMI270_REG_TEMP_MSB = 0x23;
22static constexpr uint8_t REG_READ_LEN = BMI270_REG_TEMP_MSB - BMI270_REG_DATA_8 + 1;
24static constexpr uint8_t BMI270_REG_PWR_CONF = 0x7C;
25static constexpr uint8_t BMI270_REG_PWR_CTRL = 0x7D;
26static constexpr uint8_t BMI270_REG_INIT_CTRL = 0x59;
27static constexpr uint8_t BMI270_REG_INIT_DATA = 0x5E;
28static constexpr uint8_t BMI270_REG_INIT_ADDR_0 = 0x5B;
29static constexpr uint8_t BMI270_REG_INTERNAL_STATUS = 0x21;
30static constexpr uint8_t BMI270_REG_ACC_CONF = 0x40;
31static constexpr uint8_t BMI270_REG_ACC_RANGE = 0x41;
32static constexpr uint8_t BMI270_REG_GYR_CONF = 0x42;
33static constexpr uint8_t BMI270_REG_GYR_RANGE = 0x43;
35static constexpr uint8_t BMI270_CHIP_ID_VALUE = 0x24;
40static constexpr uint8_t BMI270_REG_AUX_X_LSB = 0x04;
41static constexpr uint8_t BMI270_REG_AUX_DEV_ID = 0x4B;
42static constexpr uint8_t BMI270_REG_AUX_IF_CONF = 0x4C;
43static constexpr uint8_t BMI270_REG_AUX_RD_ADDR = 0x4D;
44static constexpr uint8_t BMI270_REG_AUX_WR_ADDR = 0x4E;
45static constexpr uint8_t BMI270_REG_AUX_WR_DATA = 0x4F;
46static constexpr uint8_t BMI270_REG_IF_CONF = 0x6B;
47static constexpr uint8_t BMI270_REG_CMD = 0x7E;
50static constexpr uint8_t BMI270_CMD_SOFT_RESET = 0xB6;
51static constexpr uint8_t BMI270_PWR_CONF_ADV_POWER_SAVE_OFF = 0x00;
52static constexpr uint8_t BMI270_PWR_CONF_FIFO_SELF_WAKEUP = 0x02;
53static constexpr uint8_t BMI270_INIT_CTRL_LOAD_START = 0x00;
54static constexpr uint8_t BMI270_INIT_CTRL_LOAD_DONE = 0x01;
55static constexpr uint8_t BMI270_INTERNAL_STATUS_MASK = 0x0F;
56static constexpr uint8_t BMI270_INTERNAL_STATUS_INIT_OK = 0x01;
57static constexpr uint8_t BMI270_CONF_BWP_NORMAL = 0x02;
58static constexpr uint8_t BMI270_CONF_BWP_SHIFT = 4;
59static constexpr uint8_t BMI270_ACC_CONF_PERF_MODE = 0x80;
60static constexpr uint8_t BMI270_GYR_CONF_NOISE_PERF = 0x40;
61static constexpr uint8_t BMI270_GYR_CONF_FILTER_PERF = 0x80;
62static constexpr uint8_t BMI270_STATUS_AUX_BUSY = 0x04;
63static constexpr uint8_t BMI270_IF_CONF_AUX_IF_EN = 0x20;
64static constexpr uint8_t BMI270_PWR_CTRL_AUX_EN = 0x01;
65static constexpr uint8_t BMI270_PWR_CTRL_ACC_EN = 0x02;
66static constexpr uint8_t BMI270_PWR_CTRL_GYR_EN = 0x04;
67static constexpr uint8_t BMI270_PWR_CTRL_TEMP_EN = 0x08;
68static constexpr uint8_t BMI270_PWR_CTRL_IMU =
69 BMI270_PWR_CTRL_ACC_EN | BMI270_PWR_CTRL_GYR_EN | BMI270_PWR_CTRL_TEMP_EN;
70static constexpr uint8_t BMI270_AUX_IF_CONF_MANUAL_EN = 0x80;
71static constexpr uint8_t BMI270_AUX_IF_CONF_FCU_WRITE_EN = 0x40;
72static constexpr uint8_t BMI270_AUX_IF_CONF_MAN_RD_BURST_8 = 0x0C;
73static constexpr uint8_t BMI270_AUX_IF_CONF_RD_BURST_8 = 0x03;
76static constexpr uint8_t BMI270_AUX_DATA_LEN = 8;
77static_assert(BMI270_REG_AUX_X_LSB + BMI270_AUX_DATA_LEN == BMI270_REG_DATA_8,
"aux data must precede accel data");
116#ifdef USE_BMI270_BMM150
127 void setup()
override;
134#ifdef USE_BMI270_BMM150
143#ifdef USE_BMI270_BMM150
157#ifdef USE_BMI270_BMM150
void set_gyro_range(BMI270GyroRange r)
uint8_t aux_device_address_
void set_accel_range(BMI270AccelRange r)
bmm150::BMM150Trim mag_trim_
bool wait_for_aux_idle_()
void set_accel_odr(BMI270AccelODR o)
void set_aux_device(BMI270AuxDevice device)
HUB_PUBLISHER(magnetometer, const bmm150::BMM150Data &) protected boo load_config_file_)()
bool read_aux_block_(uint8_t reg, uint8_t *buf)
BMI270AuxDevice aux_device_
BMI270AccelODR accel_odr_
BMI270AccelRange accel_range_
bool write_aux_register_(uint8_t reg, uint8_t value)
void dump_config() override
const LogString * setup_magnetometer_()
void set_gyro_odr(BMI270GyroODR o)
void set_aux_device_address(uint8_t address)
BMI270GyroRange gyro_range_
This Class provides the methods to read/write bytes from/to an i2c device.
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
HUB_PUBLISHER(data, const MotionData &) HUB_PUBLISHER(temperature
virtual bool update_data(MotionData &data)=0
@ BMI270_AUX_DEVICE_BMM150