|
M5Unit-ENV 1.4.0 git rev:c1b5980
|
Temperature and humidity sensor unit (SHT20) More...
#include <unit_SHT20.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| UnitSHT20 (const uint8_t addr=DEFAULT_ADDRESS) | |
| virtual bool | begin () override |
| virtual void | update (const bool force=false) override |
Settings for begin | |
| config_t | config () const |
| Gets the configuration. | |
| void | config (const config_t &cfg) |
| Set the configuration. | |
Measurement data by periodic | |
| float | temperature () const |
| Oldest measured temperature (Celsius) | |
| float | celsius () const |
| Oldest measured temperature (Celsius) | |
| float | fahrenheit () const |
| Oldest measured temperature (Fahrenheit) | |
| float | humidity () const |
| Oldest measured humidity (RH) | |
Periodic measurement | |
| bool | startPeriodicMeasurement () |
| Start periodic measurement. | |
| bool | stopPeriodicMeasurement () |
| Stop periodic measurement. | |
Single shot measurement | |
| bool | measureSingleshot (sht20::Data &d) |
| Measurement single shot. | |
Resolution | |
| bool | readResolution (sht20::Resolution &res) |
| Read measurement resolution. | |
| bool | writeResolution (const sht20::Resolution res) |
| Write measurement resolution. | |
Heater | |
| bool | startHeater () |
| Enable on-chip heater. | |
| bool | stopHeater () |
| Disable on-chip heater. | |
Reset | |
| bool | softReset () |
| Soft reset. | |
Protected Member Functions | |
| bool | start_periodic_measurement () |
| bool | stop_periodic_measurement () |
| bool | read_measurement (sht20::Data &d) |
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitSHT20, sht20::Data) | |
Protected Attributes | |
| std::unique_ptr< m5::container::CircularBuffer< sht20::Data > > | _data {} |
| config_t | _cfg {} |
Temperature and humidity sensor unit (SHT20)
Sensirion SHT20 — I2C address 0x40, 1-byte commands, CRC-8
| bool m5::unit::UnitSHT20::measureSingleshot | ( | sht20::Data & | d | ) |
Measurement single shot.
| [out] | d | Measured data |
| bool m5::unit::UnitSHT20::readResolution | ( | sht20::Resolution & | res | ) |
Read measurement resolution.
| [out] | res | Resolution |
| bool m5::unit::UnitSHT20::softReset | ( | ) |
Soft reset.
| bool m5::unit::UnitSHT20::startHeater | ( | ) |
Enable on-chip heater.
|
inline |
Start periodic measurement.
| bool m5::unit::UnitSHT20::stopHeater | ( | ) |
Disable on-chip heater.
|
inline |
Stop periodic measurement.
| bool m5::unit::UnitSHT20::writeResolution | ( | const sht20::Resolution | res | ) |
Write measurement resolution.
| res | Resolution |