8#ifdef USE_BMI270_BMM150
16static constexpr uint8_t BMI270_REG_CHIP_ID = 0x00;
17static constexpr uint8_t BMI270_REG_ERR_REG = 0x02;
18static constexpr uint8_t BMI270_REG_STATUS = 0x03;
19static constexpr uint8_t BMI270_REG_DATA_8 = 0x0C;
20static constexpr uint8_t BMI270_REG_DATA_14 = 0x12;
21static constexpr uint8_t BMI270_REG_TEMP_0 = 0x22;
22static constexpr uint8_t BMI270_REG_TEMP_MSB = 0x23;
24static constexpr uint8_t REG_READ_LEN =
25 BMI270_REG_TEMP_MSB - BMI270_REG_DATA_8 +
28static constexpr uint8_t BMI270_REG_PWR_CONF = 0x7C;
29static constexpr uint8_t BMI270_REG_PWR_CTRL = 0x7D;
30static constexpr uint8_t BMI270_REG_INIT_CTRL = 0x59;
31static constexpr uint8_t BMI270_REG_INIT_DATA = 0x5E;
32static constexpr uint8_t BMI270_REG_INIT_ADDR_0 = 0x5B;
33static constexpr uint8_t BMI270_REG_INTERNAL_STATUS = 0x21;
34static constexpr uint8_t BMI270_REG_ACC_CONF = 0x40;
35static constexpr uint8_t BMI270_REG_ACC_RANGE = 0x41;
36static constexpr uint8_t BMI270_REG_GYR_CONF = 0x42;
37static constexpr uint8_t BMI270_REG_GYR_RANGE = 0x43;
39static constexpr uint8_t BMI270_CHIP_ID_VALUE = 0x24;
44static constexpr uint8_t BMI270_REG_AUX_X_LSB = 0x04;
45static constexpr uint8_t BMI270_REG_AUX_DEV_ID = 0x4B;
46static constexpr uint8_t BMI270_REG_AUX_IF_CONF = 0x4C;
47static constexpr uint8_t BMI270_REG_AUX_RD_ADDR = 0x4D;
48static constexpr uint8_t BMI270_REG_AUX_WR_ADDR = 0x4E;
49static constexpr uint8_t BMI270_REG_AUX_WR_DATA = 0x4F;
50static constexpr uint8_t BMI270_REG_IF_CONF = 0x6B;
51static constexpr uint8_t BMI270_REG_CMD = 0x7E;
54static constexpr uint8_t BMI270_CMD_SOFT_RESET = 0xB6;
55static constexpr uint8_t BMI270_PWR_CONF_ADV_POWER_SAVE_OFF = 0x00;
56static constexpr uint8_t BMI270_PWR_CONF_FIFO_SELF_WAKEUP = 0x02;
57static constexpr uint8_t BMI270_INIT_CTRL_LOAD_START = 0x00;
58static constexpr uint8_t BMI270_INIT_CTRL_LOAD_DONE = 0x01;
59static constexpr uint8_t BMI270_INTERNAL_STATUS_MASK = 0x0F;
60static constexpr uint8_t BMI270_INTERNAL_STATUS_INIT_OK = 0x01;
61static constexpr uint8_t BMI270_CONF_BWP_NORMAL = 0x02;
62static constexpr uint8_t BMI270_CONF_BWP_SHIFT = 4;
63static constexpr uint8_t BMI270_ACC_CONF_PERF_MODE = 0x80;
64static constexpr uint8_t BMI270_GYR_CONF_NOISE_PERF = 0x40;
65static constexpr uint8_t BMI270_GYR_CONF_FILTER_PERF = 0x80;
66static constexpr uint8_t BMI270_STATUS_AUX_BUSY = 0x04;
67static constexpr uint8_t BMI270_IF_CONF_AUX_IF_EN = 0x20;
68static constexpr uint8_t BMI270_PWR_CTRL_AUX_EN = 0x01;
69static constexpr uint8_t BMI270_PWR_CTRL_ACC_EN = 0x02;
70static constexpr uint8_t BMI270_PWR_CTRL_GYR_EN = 0x04;
71static constexpr uint8_t BMI270_PWR_CTRL_TEMP_EN = 0x08;
72static constexpr uint8_t BMI270_PWR_CTRL_IMU =
73 BMI270_PWR_CTRL_ACC_EN | BMI270_PWR_CTRL_GYR_EN | BMI270_PWR_CTRL_TEMP_EN;
74static constexpr uint8_t BMI270_AUX_IF_CONF_MANUAL_EN = 0x80;
75static constexpr uint8_t BMI270_AUX_IF_CONF_FCU_WRITE_EN = 0x40;
76static constexpr uint8_t BMI270_AUX_IF_CONF_MAN_RD_BURST_8 = 0x0C;
77static constexpr uint8_t BMI270_AUX_IF_CONF_RD_BURST_8 = 0x03;
80static constexpr uint8_t BMI270_AUX_DATA_LEN = 8;
81static_assert(BMI270_REG_AUX_X_LSB + BMI270_AUX_DATA_LEN == BMI270_REG_DATA_8,
"aux data must precede accel data");
124#ifdef USE_BMI270_BMM150
137 void setup()
override;
147#ifdef USE_BMI270_BMM150
156#ifdef USE_BMI270_BMM150
177#ifdef USE_BMI270_BMM150
void set_gyro_range(BMI270GyroRange r)
uint8_t aux_device_address_
bool read_magnetometer_trim_()
void set_accel_range(BMI270AccelRange r)
bmm150::BMM150Trim mag_trim_
LazyCallbackManager< void(const bmm150::BMM150Data &)> magnetometer_callback_
LazyCallbackManager< void(float)> temperature_callback_
bool update_data(motion::MotionData &data) override
void set_accel_odr(BMI270AccelODR o)
float get_setup_priority() const override
void add_magnetometer_listener(F &&cb)
void set_aux_device(BMI270AuxDevice device)
bool read_aux_block_(uint8_t reg, uint8_t *buf)
BMI270AuxDevice aux_device_
void add_temperature_listener(F &&cb)
BMI270AccelODR accel_odr_
BMI270AccelRange accel_range_
bool wait_for_aux_idle_(uint32_t timeout_ms)
bool write_aux_register_(uint8_t reg, uint8_t value)
void dump_config() override
bool 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
@ BMI270_AUX_DEVICE_BMM150
constexpr float DATA
For components that import data from directly connected sensors like DHT.