|
M5Unit-INFRARED 0.1.0 git rev:aed3018
|
STHS34PF80 unit. More...
#include <unit_STHS34PF80.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| UnitSTHS34PF80 (const uint8_t addr=DEFAULT_ADDRESS) | |
| virtual bool | begin () override |
| virtual void | update (const bool force=false) override |
| bool | softReset () |
| Software reset. | |
Settings for begin | |
| config_t | config () |
| Gets the configration. | |
| void | config (const config_t &cfg) |
| Set the configration. | |
Properties | |
| uint16_t | sensitivity () const |
| Gets the inner sensitivity. | |
Measurement data by periodic | |
| int16_t | object () const |
| Oldest TOBJECT. | |
| float | objectTemperature () const |
| Oldest object temperature. | |
| int16_t | ambient () const |
| Oldest TAMBIENT. | |
| float | ambientTemperature () const |
| Oldest ambient temperature. | |
| int16_t | compensated_object () const |
| Oldest TOBJ_COMP. | |
| float | compensatedObjectTemperature () const |
| Oldest compensated object temperature. | |
| int16_t | presence () const |
| Oldest TPRESENCE. | |
| int16_t | motion () const |
| Oldest TMOTION. | |
| int16_t | ambient_shock () const |
| Oldest TAMB_SHOCK. | |
| bool | isPresence () const |
| Oldest presence detefction. | |
| bool | isMotion () const |
| Oldest motion detefction. | |
| bool | isAmbientShock () const |
| Oldest ambient shock detefction. | |
Periodic measurement | |
| bool | startPeriodicMeasurement (const sths34pf80::Gain mode, const sths34pf80::ODR odr, const bool comp_type=true, const bool abs=false) |
| Start periodic measurement. | |
| bool | stopPeriodicMeasurement () |
| Stop periodic measurement. | |
Single shot measurement | |
| bool | measureSingleshot (sths34pf80::Data &data, const sths34pf80::AmbientTemperatureAverage avg_t, const sths34pf80::ObjectTemperatureAverage avg_tmos) |
| Measurement single shot. | |
Settings | |
| bool | readAverageTrim (sths34pf80::AmbientTemperatureAverage &avg_t, sths34pf80::ObjectTemperatureAverage &avg_tmos) |
| Read the avarage trim. | |
| bool | writeAverageTrim (const sths34pf80::AmbientTemperatureAverage avg_t, const sths34pf80::ObjectTemperatureAverage avg_tmos) |
| Write the avarage trim. | |
| bool | readGainMode (sths34pf80::Gain &mode) |
| Read the gain mode. | |
| bool | writeGainMode (const sths34pf80::Gain mode) |
| Write the gain mode. | |
| bool | readSensitivityRaw (int8_t &raw) |
| Read the raw sensitivity. | |
| bool | readSensitivity (uint16_t &value) |
| Read the raw sensitivity. | |
| bool | writeSensitivityRaw (const int8_t raw) |
| Write the raw sensitivity. | |
| bool | writeSensitivity (const uint16_t value) |
| Write the sensitivity. | |
| bool | readObjectDataRate (sths34pf80::ODR &odr) |
| Read the ODR. | |
Algorithm settings | |
| |
| bool | resetAlgorithm () |
| Reset the algorithm. | |
| bool | readLowPassFilter (sths34pf80::LowPassFilter &lpf_p_m, sths34pf80::LowPassFilter &lpf_m, sths34pf80::LowPassFilter &lpf_p, sths34pf80::LowPassFilter &lpf_a_t) |
| Read the low pass filter. | |
| bool | writeLowPassFilter (const sths34pf80::LowPassFilter lpf_p_m, const sths34pf80::LowPassFilter lpf_m, const sths34pf80::LowPassFilter lpf_p, const sths34pf80::LowPassFilter lpf_a) |
| Write the low pass filter. | |
| bool | readPresenceThreshold (uint16_t &thres) |
| Read the threshold for presence detection. | |
| bool | writePresenceThreshold (const uint16_t thres) |
| Write the threshold for presence detection. | |
| bool | readMotionThreshold (uint16_t &thres) |
| Read the threshold for motion detection. | |
| bool | writeMotionThreshold (const uint16_t thres) |
| Write the threshold for motion detection. | |
| bool | readAmbientShockThreshold (uint16_t &thres) |
| Read the threshold for ambient shock detection. | |
| bool | writeAmbientShockThreshold (const uint16_t thres) |
| Write the threshold for ambient shock detection. | |
| bool | readPresenceHysteresis (uint8_t &hyst) |
| Read the hysteresis for presence detection. | |
| bool | writePresenceHysteresis (const uint8_t hyst) |
| Write the hysteresis for presence detection. | |
| bool | readMotionHysteresis (uint8_t &hyst) |
| Read the hysteresis for motion detection. | |
| bool | writeMotionHysteresis (const uint8_t hyst) |
| Write the hysteresis for motion detection. | |
| bool | readAmbientShockHysteresis (uint8_t &hyst) |
| Read the hysteresis for ambient shock detection. | |
| bool | writeAmbientShockHysteresis (const uint8_t hyst) |
| Write the hysteresis for ambient shock detection. | |
| bool | readAlgorithmConfig (uint8_t &v) |
| Read the algorithm configuration. | |
Static Public Member Functions | |
| static sths34pf80::ODR | maximum_odr (const sths34pf80::ObjectTemperatureAverage avg_tmos) |
| Get the maximum ODR value that can be set. | |
Protected Member Functions | |
| bool | read_embedded_register (const uint8_t ereg, uint8_t *rbuf, const uint32_t len) |
| bool | write_embedded_register (const uint8_t ereg, const uint8_t *buf, const uint32_t len) |
| bool | read_embedded_register8 (const uint8_t ereg, uint8_t &v) |
| bool | write_embedded_register8 (const uint8_t ereg, const uint8_t v) |
| bool | read_embedded_register16LE (const uint8_t ereg, uint16_t &v) |
| bool | write_embedded_register16LE (const uint8_t ereg, const uint16_t v) |
| bool | start_periodic_measurement () |
| bool | start_periodic_measurement (const sths34pf80::Gain mode, const sths34pf80::ODR odr, const bool comp_type, const bool abs) |
| bool | stop_periodic_measurement () |
| bool | write_odr (const sths34pf80::ODR odr) |
| bool | write_algorithm_config (const uint8_t v) |
| bool | is_data_ready () |
| bool | read_measurement (sths34pf80::Data &d, const bool full=true) |
| bool | guard_in_periodic (const char *fname) |
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitSTHS34PF80, sths34pf80::Data) | |
STHS34PF80 unit.
| bool m5::unit::UnitSTHS34PF80::measureSingleshot | ( | sths34pf80::Data & | data, |
| const sths34pf80::AmbientTemperatureAverage | avg_t, | ||
| const sths34pf80::ObjectTemperatureAverage | avg_tmos ) |
Measurement single shot.
| [out] | data | Measuerd data |
| avg_t | The number of averaged samples for ambient temperature | |
| avg_tmos | The number of averaged samples for object temperature |
| bool m5::unit::UnitSTHS34PF80::readAlgorithmConfig | ( | uint8_t & | v | ) |
Read the algorithm configuration.
| [out] | v | Value |
| bool m5::unit::UnitSTHS34PF80::readAmbientShockHysteresis | ( | uint8_t & | hyst | ) |
Read the hysteresis for ambient shock detection.
| [out] | hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::readAmbientShockThreshold | ( | uint16_t & | thres | ) |
Read the threshold for ambient shock detection.
| [out] | thres | Threshold |
| bool m5::unit::UnitSTHS34PF80::readAverageTrim | ( | sths34pf80::AmbientTemperatureAverage & | avg_t, |
| sths34pf80::ObjectTemperatureAverage & | avg_tmos ) |
Read the avarage trim.
| [out] | avg_t | The number of averaged samples for ambient temperature |
| [out] | avg_tmos | The number of averaged samples for object temperature |
| bool m5::unit::UnitSTHS34PF80::readGainMode | ( | sths34pf80::Gain & | mode | ) |
Read the gain mode.
| [out] | mode | Gain |
| bool m5::unit::UnitSTHS34PF80::readLowPassFilter | ( | sths34pf80::LowPassFilter & | lpf_p_m, |
| sths34pf80::LowPassFilter & | lpf_m, | ||
| sths34pf80::LowPassFilter & | lpf_p, | ||
| sths34pf80::LowPassFilter & | lpf_a_t ) |
Read the low pass filter.
| [out] | lp_p_m | For presence and motion detection |
| [out] | lpf_m | For motion detection |
| [out] | lpf_p | For presence detection |
| [out] | lpf_a_t | For ambient temperature shock detection |
| bool m5::unit::UnitSTHS34PF80::readMotionHysteresis | ( | uint8_t & | hyst | ) |
Read the hysteresis for motion detection.
| [out] | hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::readMotionThreshold | ( | uint16_t & | thres | ) |
Read the threshold for motion detection.
| [out] | thres | Threshold |
| bool m5::unit::UnitSTHS34PF80::readObjectDataRate | ( | sths34pf80::ODR & | odr | ) |
Read the ODR.
| odr | ODR |
| bool m5::unit::UnitSTHS34PF80::readPresenceHysteresis | ( | uint8_t & | hyst | ) |
Read the hysteresis for presence detection.
| [out] | hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::readPresenceThreshold | ( | uint16_t & | thres | ) |
Read the threshold for presence detection.
| [out] | thres | Threshold |
| bool m5::unit::UnitSTHS34PF80::readSensitivity | ( | uint16_t & | value | ) |
Read the raw sensitivity.
| [out] | value | Sensitivity |
| bool m5::unit::UnitSTHS34PF80::readSensitivityRaw | ( | int8_t & | raw | ) |
Read the raw sensitivity.
| [out] | raw | Raw value |
| bool m5::unit::UnitSTHS34PF80::resetAlgorithm | ( | ) |
Reset the algorithm.
Apply each value to the embedded linear algorithm for compensate for ambient temperature variations in the object temperature
|
inline |
Start periodic measurement.
| mode | Gain mode |
| odr | Object data rate |
| comp_type | Enables the embedded linear algorithm if true (Valid only in default gain mode) |
| abs | Selects the absolute value in the presence detection algorithm if true |
| ObjectTemperatureAverage(AVG_TMOS) | Maximum ODR |
|---|---|
| Samples2 | ODR30 |
| Samples8 | ODR30 |
| Samples32 | ODR30 |
| Samples128 | ODR8 |
| Samples256 | ODR4 |
| Samples512 | ODR2 |
| Samples1024 | ODR1 |
| Samples2048 | ODR0_5 |
|
inline |
Stop periodic measurement.
To be PowerDown mode
| bool m5::unit::UnitSTHS34PF80::writeAmbientShockHysteresis | ( | const uint8_t | hyst | ) |
Write the hysteresis for ambient shock detection.
| [out] | hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::writeAmbientShockThreshold | ( | const uint16_t | thres | ) |
Write the threshold for ambient shock detection.
| [out] | thres | Threshold |
| bool m5::unit::UnitSTHS34PF80::writeAverageTrim | ( | const sths34pf80::AmbientTemperatureAverage | avg_t, |
| const sths34pf80::ObjectTemperatureAverage | avg_tmos ) |
Write the avarage trim.
| avg_t | The number of averaged samples for ambient temperature |
| avg_tmos | The number of averaged samples for object temperature |
| bool m5::unit::UnitSTHS34PF80::writeGainMode | ( | const sths34pf80::Gain | mode | ) |
Write the gain mode.
| mode | Gain |
| bool m5::unit::UnitSTHS34PF80::writeLowPassFilter | ( | const sths34pf80::LowPassFilter | lpf_p_m, |
| const sths34pf80::LowPassFilter | lpf_m, | ||
| const sths34pf80::LowPassFilter | lpf_p, | ||
| const sths34pf80::LowPassFilter | lpf_a ) |
Write the low pass filter.
| lp_p_m | For presence and motion detection |
| lpf_m | For motion detection |
| lpf_p | For presence detection |
| lpf_a_t | For ambient temperature shock detection |
| bool m5::unit::UnitSTHS34PF80::writeMotionHysteresis | ( | const uint8_t | hyst | ) |
Write the hysteresis for motion detection.
| hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::writeMotionThreshold | ( | const uint16_t | thres | ) |
Write the threshold for motion detection.
| thres | Threshold (15 bits) |
| bool m5::unit::UnitSTHS34PF80::writePresenceHysteresis | ( | const uint8_t | hyst | ) |
Write the hysteresis for presence detection.
| hyst | Hysteresis |
| bool m5::unit::UnitSTHS34PF80::writePresenceThreshold | ( | const uint16_t | thres | ) |
Write the threshold for presence detection.
| thres | Threshold (15 bits) |
| bool m5::unit::UnitSTHS34PF80::writeSensitivity | ( | const uint16_t | value | ) |
Write the sensitivity.
| value | Sensitivity (0 - 4080) |
| bool m5::unit::UnitSTHS34PF80::writeSensitivityRaw | ( | const int8_t | raw | ) |
Write the raw sensitivity.
| raw | Raw value |