|
M5Unit-ENV 1.3.1 git rev:73f34ff
|
Temperature and humidity, sensor unit. More...
#include <unit_SHT40.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| UnitSHT40 (const uint8_t addr=DEFAULT_ADDRESS) | |
| virtual bool | begin () override |
| virtual void | update (const bool force=false) override |
Settings for begin | |
| config_t | config () |
| Gets the configration. | |
| void | config (const config_t &cfg) |
| Set the configration. | |
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 (const sht40::Precision precision, const sht40::Heater heater, const float duty=0.05f) |
| Start periodic measurement. | |
| bool | stopPeriodicMeasurement () |
| Stop periodic measurement. | |
Single shot measurement | |
| bool | measureSingleshot (sht40::Data &d, const sht40::Precision precision=sht40::Precision::High, const sht40::Heater heater=sht40::Heater::None) |
| Measurement single shot. | |
Reset | |
| bool | softReset () |
| Soft reset. | |
| bool | generalReset () |
| General reset. | |
Serial number | |
| bool | readSerialNumber (uint32_t &serialNumber) |
| Read the serial number value. | |
| bool | readSerialNumber (char *serialNumber) |
| Read the serial number string. | |
Protected Member Functions | |
| bool | start_periodic_measurement (const sht40::Precision precision, const sht40::Heater heater, const float duty) |
| bool | stop_periodic_measurement () |
| bool | read_measurement (sht40::Data &d) |
| void | reset_status () |
| bool | soft_reset () |
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitSHT40, sht40::Data) | |
Protected Attributes | |
| std::unique_ptr< m5::container::CircularBuffer< sht40::Data > > | _data {} |
| config_t | _cfg {} |
| uint8_t | _cmd {} |
| uint8_t | _measureCmd {} |
| types::elapsed_time_t | _latest_heater {} |
| types::elapsed_time_t | _interval_heater {} |
| uint32_t | _duration_measure {} |
| uint32_t | _duration_heater {} |
Temperature and humidity, sensor unit.
| bool m5::unit::UnitSHT40::generalReset | ( | ) |
General reset.
Reset using I2C general call
| bool m5::unit::UnitSHT40::measureSingleshot | ( | sht40::Data & | d, |
| const sht40::Precision | precision = sht40::Precision::High, | ||
| const sht40::Heater | heater = sht40::Heater::None ) |
Measurement single shot.
| [out] | data | Measuerd data |
| precision | Sensor precision | |
| heater | Heater behavior |
| bool m5::unit::UnitSHT40::readSerialNumber | ( | char * | serialNumber | ) |
Read the serial number string.
| [out] | serialNumber | Output buffer |
| bool m5::unit::UnitSHT40::readSerialNumber | ( | uint32_t & | serialNumber | ) |
Read the serial number value.
| [out] | serialNumber | serial number value |
| bool m5::unit::UnitSHT40::softReset | ( | ) |
Soft reset.
|
inline |
Start periodic measurement.
| precision | Sensor precision |
| heater | Heater behavior |
| duty | Duty for activate heater |
|
inline |
Stop periodic measurement.