|
| | UnitBMI270 (const uint8_t addr=DEFAULT_ADDRESS) |
| | Construct with the I2C address the chip will answer on.
|
| |
|
virtual | ~UnitBMI270 () |
| | Destructor.
|
| |
| virtual bool | begin () override |
| | Begin the unit.
|
| |
| 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 | sleep () override |
| | Suspend the chip (REG_PWR_CTRL off, REG_PWR_CONF adv_power_save)
|
| |
| bool | wakeup () override |
| | Resume the chip from sleep()
|
| |
|
| virtual m5::imu::Capability | imuSpec () const override |
| | Capability of this unit.
|
| |
| virtual m5::imu::Capability | readImuRaw (m5::imu::imu_raw_data_t &out) override |
| | Read the latest raw IMU data.
|
| |
| virtual void | imuConvertParam (m5::imu::imu_convert_param_t &out) const override |
| | Gets the conversion parameters for 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) |
| |
|
bool | start_periodic_measurement () |
| |
|
bool | stop_periodic_measurement () |
| |
|
bool | read_measurement (bmi270::Data &d) |
| |
| virtual bool | read_sensor_burst (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) |
| |
6-axis (accel + gyro) IMU unit. CoreS3/AtomS3R built-in
- Note
- Accel/gyro/temp only. The chip's auxiliary (AUX) interface, which can drive an on-chip BMM150 magnetometer, is deliberately left untouched here – use UnitBMI270AuxBMM150 on the boards that wire one to it (CoreS3, AtomS3R, Mini IMU-Pro). Enabling it is not always safe: on UnitDoF9/UnitDoF10 the AUX pins share the main I2C bus, and switching the interface on makes the BMI270 a second bus master, locking the bus until the unit is power-cycled
| bool m5::unit::UnitBMI270::sleep |
( |
| ) |
|
|
overridevirtual |
Suspend the chip (REG_PWR_CTRL off, REG_PWR_CONF adv_power_save)
- Returns
- True if successful
Works while periodic measurement is running: it is stopped first, since a suspended chip must not be polled. Then accel/gyro/temp are powered down and advanced power save is enabled. The uploaded configuration file survives suspend – unlike softReset(), which requires the full post-reset initialization again.
Reimplemented from m5::imu::IMUDataSource.
Reimplemented in m5::unit::UnitBMI270AuxBMM150.