BMI270 that switches on its auxiliary (AUX) interface and drives a BMM150 through it.
More...
|
| | UnitBMI270AuxBMM150 (const uint8_t addr=DEFAULT_ADDRESS) |
| | Construct with the BMI270's I2C address (the AUX BMM150 sits behind the bridge)
|
| |
|
virtual | ~UnitBMI270AuxBMM150 () |
| | Destructor.
|
| |
| virtual bool | begin () override |
| | Seed the magnetometer's live state from config_t, then run the base begin()
|
| |
| bool | sleep () override |
| | Suspend the chip, parking the AUX BMM150 first.
|
| |
|
| config_t | config () const |
| | Gets the configuration.
|
| |
| void | config (const config_t &cfg) |
| | Set the configuration.
|
| |
|
| virtual m5::imu::Capability | imuSpec () const override |
| | Capability of this unit.
|
| |
| virtual void | imuConvertParam (m5::imu::imu_convert_param_t &out) const override |
| | Gets the conversion parameters for raw IMU data.
|
| |
|
| bool | writeAuxMagPreset (const bmm150::Preset preset) |
| | Write the accuracy/power preset of the AUX BMM150.
|
| |
| bool | writeAuxMagRepetition (const uint8_t rep_xy, const uint8_t rep_z) |
| | Write the repetition (oversampling) of the AUX BMM150.
|
| |
| bool | readAuxMagRepetition (uint8_t &rep_xy, uint8_t &rep_z) const |
| | Read the repetition (oversampling) the AUX BMM150 is configured with.
|
| |
| | UnitBMI270 (const uint8_t addr=DEFAULT_ADDRESS) |
| | Construct with the I2C address the chip will answer on.
|
| |
|
virtual | ~UnitBMI270 () |
| | Destructor.
|
| |
| virtual void | update (const bool force=false) override |
| | Update the unit.
|
| |
| config_t | config () const |
| | Gets the configuration.
|
| |
| void | config (const config_t &cfg) |
| | Set the configuration.
|
| |
| bool | writeAccelRange (const bmi270::AccelRange range) |
| | Write the accelerometer range.
|
| |
| bool | writeGyroRange (const bmi270::GyroRange range) |
| | Write the gyroscope range.
|
| |
| bool | readAccelRange (bmi270::AccelRange &range) |
| | Read the accelerometer range from the device (REG_ACC_RANGE bits[1:0])
|
| |
| bool | readGyroRange (bmi270::GyroRange &range) |
| | Read the gyroscope range from the device (REG_GYR_RANGE bits[2:0])
|
| |
| bool | writeAccelODR (const bmi270::AccelODR odr) |
| | Write the accelerometer output data rate.
|
| |
| bool | writeGyroODR (const bmi270::GyroODR odr) |
| | Write the gyroscope output data rate.
|
| |
| bool | readAccelODR (bmi270::AccelODR &odr) |
| | Read the accelerometer output data rate from the device (REG_ACC_CONF bits[3:0])
|
| |
| bool | readGyroODR (bmi270::GyroODR &odr) |
| | Read the gyroscope output data rate from the device (REG_GYR_CONF bits[3:0])
|
| |
| bool | softReset () |
| | Soft reset (REG_CMD CMD_SOFTRESET), then re-run the mandatory post-reset initialization (config blob re-upload), leaving the chip initialized but unconfigured and stopped.
|
| |
| bool | startPeriodicMeasurement (const bmi270::AccelRange accel_range, const bmi270::GyroRange gyro_range, const bmi270::AccelODR accel_odr, const bmi270::GyroODR gyro_odr, const bmi270::FilterPerf accel_filter_perf, const bmi270::AccelBwp accel_bwp, const bmi270::FilterPerf gyro_filter_perf, const bmi270::GyroBwp gyro_bwp) |
| | Start periodic measurement.
|
| |
| bool | startPeriodicMeasurement () |
| | Start periodic measurement in the current settings.
|
| |
| bool | stopPeriodicMeasurement () |
| | Stop periodic measurement.
|
| |
| bool | wakeup () override |
| | Resume the chip from sleep()
|
| |
| virtual m5::imu::Capability | readImuRaw (m5::imu::imu_raw_data_t &out) override |
| | Read the latest raw IMU data.
|
| |
|
| virtual bool | start_periodic_measurement (const bmi270::AccelRange accel_range, const bmi270::GyroRange gyro_range, const bmi270::AccelODR accel_odr, const bmi270::GyroODR gyro_odr, const bmi270::FilterPerf accel_filter_perf, const bmi270::AccelBwp accel_bwp, const bmi270::FilterPerf gyro_filter_perf, const bmi270::GyroBwp gyro_bwp) override |
| |
| virtual bool | read_sensor_burst (bmi270::Data &d) override |
| | One 20 byte burst covering mag + accel + gyro, instead of the base's 12 byte accel/gyro read.
|
| |
|
bool | setup_aux_bmm150 () |
| |
|
bool | aux_enter_setup_mode () |
| |
|
bool | aux_detect_bmm150 () |
| |
|
bool | aux_enter_data_mode () |
| |
|
bool | aux_wait_ready () |
| |
|
bool | aux_write_register8 (const uint8_t reg, const uint8_t val) |
| |
|
bool | aux_read_register8 (const uint8_t reg, uint8_t &out) |
| |
|
bool | aux_read_burst8 (const uint8_t bmm150_reg, std::array< uint8_t, 8 > &out) |
| |
|
bool | aux_read_trim (bmm150::trim_t &trim) |
| |
|
bool | start_periodic_measurement () |
| |
|
bool | stop_periodic_measurement () |
| |
|
bool | read_measurement (bmi270::Data &d) |
| |
|
bool | write_register8_verified (const uint8_t reg, const uint8_t val) |
| |
|
bool | read_register8_quiet (const uint8_t reg, uint8_t &out) |
| |
|
bool | recover_wedged_interface (const uint8_t id) |
| |
|
bool | upload_config () |
| |
|
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitBMI270, bmi270::Data) |
| |
BMI270 that switches on its auxiliary (AUX) interface and drives a BMM150 through it.
The BMI270's AUX interface is a general-purpose I2C master built into the chip – the datasheet calls it a "master interface hub for 1 I2C AUX sensor (e.g. ext. magnetometer,
pressure)". This class implements one specific target, a Bosch BMM150: it addresses 0x10, checks for chip ID 0x32, reads that part's factory trim and drives its repetition/opmode registers. The name records that choice, since a different AUX target would need a different driver.
Which class to instantiate is a property of the board, not of the chip:
- This class turns the interface on and probes for the BMM150. CoreS3 / AtomS3R / Mini IMU-Pro (U171) wire one there. Built-in IMUs in general should use it – the probe adapts to whatever the host actually carries, with no board table to keep up to date.
- The plain UnitBMI270 never touches the interface. Use it where the wiring makes enabling it unsafe or pointless: on UnitDoF9 / UnitDoF10 the AUX pins are tied to the main I2C bus, so enabling them turns the BMI270 into a second bus master and the bus locks up until the unit is power-cycled; on UnitDoF6 there is simply no magnetometer.
Naming a chip here does not promise one is present – that is only known at runtime. On a host without a BMM150 (Capsule, StickS3, Core2 v1.3, ...) the probe finds nothing, the interface is switched back off, and the unit runs as a plain 6-axis BMI270. imuSpec() reports Mag only once a BMM150 has actually answered.
- Note
- The BMM350 in UnitDoF9 / UnitDoF10 / Unit BMM350 (U231) sits on the main bus, not on this interface, and is driven by UnitBMM350 instead
-
The bridge polls the BMM150 at a fixed 25Hz – the only rate the BMI270's aux_odr field and the BMM150's normal mode both offer – which bounds its usable oversampling; see config_t::aux_mag_preset