|
M5Unit-IMU 0.0.2 git rev:e5b00aa
|
Thin contract between measurement units and consumers (e.g. AHRS) More...
#include <imu_data_source.hpp>
Public Member Functions | |
| virtual Capability | imuSpec () const =0 |
| What this source can provide. | |
| virtual Capability | readImuRaw (imu_raw_data_t &out)=0 |
| Pop the oldest unconsumed raw sample. | |
| virtual void | imuConvertParam (imu_convert_param_t &out) const =0 |
| Conversion coefficients for this source. | |
| virtual bool | sleep () |
| Put the device into its lowest reversible power state. | |
| virtual bool | wakeup () |
| Bring the device back from sleep() | |
Thin contract between measurement units and consumers (e.g. AHRS)
Implementations report their capability, hand out unconsumed raw samples in oldest-first order (pop semantics), and expose conversion coefficients. User-defined sources only need to implement those three methods to plug into the AHRS layer; sleep()/wakeup() are optional and default to doing nothing.
|
pure virtual |
Conversion coefficients for this source.
| [out] | out | Conversion coefficients destination |
Implemented in m5::unit::UnitAK8963, m5::unit::UnitBMI270, m5::unit::UnitBMI270AuxBMM150, m5::unit::UnitBMM150, m5::unit::UnitBMM350, m5::unit::UnitMAG3110, m5::unit::UnitMPU6xxx, and m5::unit::UnitSH200Q.
|
pure virtual |
What this source can provide.
Implemented in m5::unit::UnitAK8963, m5::unit::UnitBMI270, m5::unit::UnitBMI270AuxBMM150, m5::unit::UnitBMM150, m5::unit::UnitBMM350, m5::unit::UnitMAG3110, m5::unit::UnitMPU6xxx, and m5::unit::UnitSH200Q.
|
pure virtual |
Pop the oldest unconsumed raw sample.
| [out] | out | Sample destination |
Implemented in m5::unit::UnitAK8963, m5::unit::UnitBMI270, m5::unit::UnitBMM150, m5::unit::UnitBMM350, m5::unit::UnitMAG3110, m5::unit::UnitMPU6xxx, and m5::unit::UnitSH200Q.
|
inlinevirtual |
Put the device into its lowest reversible power state.
Optional: the default does nothing and returns false, so sources that cannot be suspended stay safe to aggregate. Implementations leave the device producing no samples while asleep. Periodic measurement is stopped; wakeup() does not restore it and callers must invoke startPeriodicMeasurement() again to resume sampling.
Reimplemented in m5::unit::UnitAK8963, m5::unit::UnitBMI270, m5::unit::UnitBMI270AuxBMM150, m5::unit::UnitBMM150, m5::unit::UnitBMM350, m5::unit::UnitMAG3110, and m5::unit::UnitMPU6xxx.
|
inlinevirtual |
Bring the device back from sleep()
Optional: the default does nothing and returns false. Implementations bring the device back to a configurable state; they do not restore the measurement mode that was active before sleep(). Callers must invoke startPeriodicMeasurement() again to resume sampling. Calling this without a preceding sleep() must be harmless.
Reimplemented in m5::unit::UnitAK8963, m5::unit::UnitBMI270, m5::unit::UnitBMM150, m5::unit::UnitBMM350, m5::unit::UnitMAG3110, and m5::unit::UnitMPU6xxx.