13#ifndef M5_UNIT_THERMO_UNIT_THERMAL2_DATA_HPP
14#define M5_UNIT_THERMO_UNIT_THERMAL2_DATA_HPP
84 const float v{std::fmax(std::fmin((f + 64) * 128, 65535.f), 0.f)};
85 return static_cast<uint16_t
>(std::round(v));
94 return u16 / 128.0f - 64;
126 return thermal2::raw_to_celsius(
temp[0]);
131 return thermal2::raw_to_celsius(
temp[1]);
136 return thermal2::raw_to_celsius(
temp[2]);
141 return thermal2::raw_to_celsius(
temp[4]);
146 return thermal2::raw_to_celsius(
temp[6]);
154 return (idx < 384) ? thermal2::raw_to_celsius(
raw[idx]) : std::numeric_limits<float>::quiet_NaN();
Top level namespace of M5stack.
Measurement data group.
Definition unit_Thermal2_data.hpp:103
float medianTemperature() const
Gets median temperature in Celsius.
Definition unit_Thermal2_data.hpp:124
uint8_t most_diff_x
Most different pixel X.
Definition unit_Thermal2_data.hpp:111
uint16_t raw[384]
Raw pixel data (1/2)
Definition unit_Thermal2_data.hpp:121
uint16_t average_temperature
Average temperature (raw)
Definition unit_Thermal2_data.hpp:109
uint8_t most_diff_y
Most different pixel Y.
Definition unit_Thermal2_data.hpp:112
uint8_t subpage
Subpage 0:even 1:odd.
Definition unit_Thermal2_data.hpp:104
float temperature(const uint_fast16_t idx) const
Gets pixel temperature in Celsius.
Definition unit_Thermal2_data.hpp:152
uint8_t highest_diff_x
Highest pixel X.
Definition unit_Thermal2_data.hpp:117
uint16_t highest_temperature
Highest temperature (raw)
Definition unit_Thermal2_data.hpp:116
uint16_t median_temperature
Median temperature (raw)
Definition unit_Thermal2_data.hpp:108
float averageTemperature() const
Gets average temperature in Celsius.
Definition unit_Thermal2_data.hpp:129
uint16_t most_diff_temperature
Most different temperature (raw)
Definition unit_Thermal2_data.hpp:110
float highestTemperature() const
Gets highest temperature in Celsius.
Definition unit_Thermal2_data.hpp:144
float mostDiffTemperature() const
Gets most different temperature in Celsius.
Definition unit_Thermal2_data.hpp:134
uint16_t temp[8]
Temperature information.
Definition unit_Thermal2_data.hpp:106
uint8_t highest_diff_y
Highest pixel Y.
Definition unit_Thermal2_data.hpp:118
float lowestTemperature() const
Gets lowest temperature in Celsius.
Definition unit_Thermal2_data.hpp:139
uint8_t lowest_diff_x
Lowest pixel X.
Definition unit_Thermal2_data.hpp:114
uint8_t lowest_diff_y
Lowest pixel Y.
Definition unit_Thermal2_data.hpp:115
uint16_t lowest_temperature
Lowest temperature (raw)
Definition unit_Thermal2_data.hpp:113
constexpr uint8_t button_was_released
Was released.
Definition unit_Thermal2_data.hpp:35
constexpr uint8_t enabled_low_temperature_low
Low temp reached low threshold.
Definition unit_Thermal2_data.hpp:51
constexpr uint8_t enabled_high_temperature_low
High temp reached low threshold.
Definition unit_Thermal2_data.hpp:54
constexpr uint8_t enabled_ave_temperature_low
Ave temp reached low threshold.
Definition unit_Thermal2_data.hpp:53
constexpr uint8_t button_was_pressed
Was pressed.
Definition unit_Thermal2_data.hpp:34
constexpr uint8_t button_was_hold
Was held.
Definition unit_Thermal2_data.hpp:37
constexpr uint8_t enabled_function_led
LED enabled.
Definition unit_Thermal2_data.hpp:44
constexpr uint8_t button_was_clicked
Was clicked.
Definition unit_Thermal2_data.hpp:36
constexpr uint8_t enabled_med_temperature_high
Med temp reached high threshold.
Definition unit_Thermal2_data.hpp:56
constexpr uint8_t enabled_high_temperature_high
High temp reached high threshold.
Definition unit_Thermal2_data.hpp:58
float raw_to_celsius(const uint16_t u16)
Raw temperature value to celsius.
Definition unit_Thermal2_data.hpp:92
constexpr uint8_t enabled_low_temperature_high
Low temp reached high threshold.
Definition unit_Thermal2_data.hpp:55
constexpr uint8_t button_is_pressed
Is pressed now.
Definition unit_Thermal2_data.hpp:33
constexpr uint8_t enabled_ave_temperature_high
Ave temp reached high threshold.
Definition unit_Thermal2_data.hpp:57
constexpr uint8_t enabled_med_temperature_low
Med temp reached low threshold.
Definition unit_Thermal2_data.hpp:52
Refresh
Refresh rate(Hz)
Definition unit_Thermal2_data.hpp:65
constexpr uint8_t enabled_function_buzzer
Buzzer enabled.
Definition unit_Thermal2_data.hpp:43
constexpr uint8_t enabled_function_auto_refresh
Auto refresh (periodic measurement) enabled.
Definition unit_Thermal2_data.hpp:45
uint16_t celsius_to_raw(const float f)
Celsius to raw temperature value.
Definition unit_Thermal2_data.hpp:81