|
M5Unit-ENV 1.6.0 git rev:f6fd6b0
|
Goertek SPA06-003 barometer (pressure + temperature); read pressure()/temperature()/altitude() directly. On Unit DoF10 (U230) it sits at 0x76. More...
#include <unit_SPA06.hpp>
Classes | |
| struct | config_t |
| Settings for begin() More... | |
Public Member Functions | |
| UnitSPA06 (const uint8_t addr=DEFAULT_ADDRESS) | |
| virtual bool | begin () override |
| Begin the unit. | |
| virtual void | update (const bool force=false) override |
| Update the unit. | |
Settings | |
| config_t | config () const |
| Gets the configuration. | |
| void | config (const config_t &cfg) |
| Set the configuration. | |
| bool | readOversampling (spa06::Oversampling &pressure_oversampling, spa06::Oversampling &temperature_oversampling) |
| Read the oversampling. | |
| bool | writeOversampling (const spa06::Oversampling pressure_oversampling, const spa06::Oversampling temperature_oversampling) |
| Write the oversampling. | |
| bool | writeOversamplingPressure (const spa06::Oversampling pressure_oversampling) |
| Write the pressure oversampling. | |
| bool | writeOversamplingTemperature (const spa06::Oversampling temperature_oversampling) |
| Write the temperature oversampling. | |
| bool | readRate (spa06::Rate &rate) |
| Read the measurement rate. | |
| bool | writeRate (const spa06::Rate rate) |
| Write the measurement rate (pressure and temperature share the rate) | |
Reset | |
| bool | softReset () |
| Soft reset (REG_RESET SOFT_RST), leaving the chip initialized but unconfigured and stopped. | |
Periodic measurement | |
| bool | startPeriodicMeasurement (const spa06::Mode mode, const spa06::Oversampling pressure_oversampling, const spa06::Oversampling temperature_oversampling, const spa06::Rate rate) |
| Start periodic measurement. | |
| bool | startPeriodicMeasurement () |
| Start periodic measurement in the current settings. | |
| bool | stopPeriodicMeasurement () |
| Stop periodic measurement. | |
Measurement | |
| float | pressure () const |
| Latest compensated pressure (hPa) | |
| float | temperature () const |
| Latest compensated temperature (degC) | |
| float | altitude (const float sea_level_hpa=1013.25f) const |
| Absolute altitude (m) versus the given sea-level pressure (QNH, hPa) | |
| float | relativeAltitude () const |
| Altitude (m) relative to the last setReference() tare point (0 m at that pressure) | |
| void | setReference () |
| Tare the current pressure as the 0 m reference for relativeAltitude() | |
Single shot measurement | |
| bool | measureSingleshot (spa06::Data &d, const spa06::Oversampling pressure_oversampling=spa06::Oversampling::X16, const spa06::Oversampling temperature_oversampling=spa06::Oversampling::X1) |
| Measure pressure and temperature a single shot. | |
Protected Member Functions | |
| bool | start_periodic_measurement (const spa06::Mode mode, const spa06::Oversampling pressure_oversampling, const spa06::Oversampling temperature_oversampling, const spa06::Rate rate) |
| bool | start_periodic_measurement () |
| bool | seed_temperature () |
| bool | stop_periodic_measurement () |
| bool | read_measurement (spa06::Data &d) |
| bool | measure_singleshot (spa06::Data &d) |
| bool | read_coefficients () |
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitSPA06, spa06::Data) | |
Goertek SPA06-003 barometer (pressure + temperature); read pressure()/temperature()/altitude() directly. On Unit DoF10 (U230) it sits at 0x76.
| bool m5::unit::UnitSPA06::measureSingleshot | ( | spa06::Data & | d, |
| const spa06::Oversampling | pressure_oversampling = spa06::Oversampling::X16, | ||
| const spa06::Oversampling | temperature_oversampling = spa06::Oversampling::X1 ) |
Measure pressure and temperature a single shot.
| [out] | d | Measured data (self-contained: read d.pressure()/d.temperature()) |
| pressure_oversampling | Pressure oversampling | |
| temperature_oversampling | Temperature oversampling |
| bool m5::unit::UnitSPA06::readOversampling | ( | spa06::Oversampling & | pressure_oversampling, |
| spa06::Oversampling & | temperature_oversampling ) |
Read the oversampling.
| [out] | pressure_oversampling | Pressure oversampling |
| [out] | temperature_oversampling | Temperature oversampling |
| bool m5::unit::UnitSPA06::readRate | ( | spa06::Rate & | rate | ) |
Read the measurement rate.
| [out] | rate | Measurement rate |
| bool m5::unit::UnitSPA06::softReset | ( | ) |
Soft reset (REG_RESET SOFT_RST), leaving the chip initialized but unconfigured and stopped.
| bool m5::unit::UnitSPA06::startPeriodicMeasurement | ( | const spa06::Mode | mode, |
| const spa06::Oversampling | pressure_oversampling, | ||
| const spa06::Oversampling | temperature_oversampling, | ||
| const spa06::Rate | rate ) |
Start periodic measurement.
| mode | Continuous measurement type (pressure / temperature / both) |
| pressure_oversampling | Pressure oversampling |
| temperature_oversampling | Temperature oversampling |
| rate | Pressure/temperature measurement rate |
|
overridevirtual |
Update the unit.
| [in] | force | Forces an update if true, even if not time for periodic measurement |
| bool m5::unit::UnitSPA06::writeOversampling | ( | const spa06::Oversampling | pressure_oversampling, |
| const spa06::Oversampling | temperature_oversampling ) |
Write the oversampling.
| pressure_oversampling | Pressure oversampling |
| temperature_oversampling | Temperature oversampling |
| bool m5::unit::UnitSPA06::writeOversamplingPressure | ( | const spa06::Oversampling | pressure_oversampling | ) |
Write the pressure oversampling.
| pressure_oversampling | Pressure oversampling |
| bool m5::unit::UnitSPA06::writeOversamplingTemperature | ( | const spa06::Oversampling | temperature_oversampling | ) |
Write the temperature oversampling.
| temperature_oversampling | Temperature oversampling |
| bool m5::unit::UnitSPA06::writeRate | ( | const spa06::Rate | rate | ) |
Write the measurement rate (pressure and temperature share the rate)
| rate | Measurement rate |