Thermal2 data types (constants, Refresh, conversions, Data struct)
More...
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <limits>
Go to the source code of this file.
|
| namespace | m5 |
| | Top level namespace of M5stack.
|
| |
| namespace | thermal2 |
| | For UnitThermal2.
|
| |
|
|
|
|
constexpr uint8_t | m5::unit::thermal2::button_is_pressed {0x01} |
| | Is pressed now.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::button_was_pressed {0x02} |
| | Was pressed.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::button_was_released {0x04} |
| | Was released.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::button_was_clicked {0x08} |
| | Was clicked.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::button_was_hold {0x10} |
| | Was held.
|
| |
|
|
|
constexpr uint8_t | m5::unit::thermal2::enabled_function_buzzer {0x01} |
| | Buzzer enabled.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_function_led {0x02} |
| | LED enabled.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_function_auto_refresh {0x04} |
| | Auto refresh (periodic measurement) enabled.
|
| |
|
|
|
constexpr uint8_t | m5::unit::thermal2::enabled_low_temperature_low {0x01} |
| | Low temp reached low threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_med_temperature_low {0x02} |
| | Med temp reached low threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_ave_temperature_low {0x04} |
| | Ave temp reached low threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_high_temperature_low {0x08} |
| | High temp reached low threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_low_temperature_high {0x10} |
| | Low temp reached high threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_med_temperature_high {0x20} |
| | Med temp reached high threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_ave_temperature_high {0x40} |
| | Ave temp reached high threshold.
|
| |
|
constexpr uint8_t | m5::unit::thermal2::enabled_high_temperature_high {0x80} |
| | High temp reached high threshold.
|
| |
Thermal2 data types (constants, Refresh, conversions, Data struct)
Kept apart from unit_Thermal2.hpp so the native (host) tests can include it without pulling in M5UnitComponent.
◆ Refresh
Refresh rate(Hz)
| Enumerator |
|---|
| Rate0_5Hz | 0.5Hz
|
| Rate1Hz | 1Hz
|
| Rate2Hz | 2Hz
|
| Rate4Hz | 4Hz
|
| Rate8Hz | 8Hz
|
| Rate16Hz | 16Hz
|
| Rate32Hz | 32Hz
|
| Rate64Hz | 64Hz
|
◆ celsius_to_raw()
| uint16_t m5::unit::thermal2::celsius_to_raw |
( |
const float | f | ) |
|
|
inline |
Celsius to raw temperature value.
- Parameters
-
- Returns
- Raw value ((f + 64) * 128, clamped to 0 - 65535; NaN gives 65535)
◆ raw_to_celsius()
| float m5::unit::thermal2::raw_to_celsius |
( |
const uint16_t | u16 | ) |
|
|
inline |
Raw temperature value to celsius.
- Parameters
-
- Returns
- Celsius