Color type and data line timing for M5Unit-RGB.
More...
Go to the source code of this file.
|
| namespace | m5 |
| | Top level namespace of M5Stack.
|
| |
| namespace | rgb |
| | For M5Unit-RGB.
|
| |
| namespace | timing |
| | Data line timing shared by the SK6812 and WS2812 units (ns)
|
| |
|
|
using | m5::unit::rgb::wrgb32_color_t = uint32_t |
| | WRGB 32bits.
|
| |
|
|
constexpr uint32_t | m5::unit::rgb::timing::T0H_NS {350} |
| | 0 code, high
|
| |
|
constexpr uint32_t | m5::unit::rgb::timing::T0L_NS {800} |
| | 0 code, low
|
| |
|
constexpr uint32_t | m5::unit::rgb::timing::T1H_NS {700} |
| | 1 code, high
|
| |
|
constexpr uint32_t | m5::unit::rgb::timing::T1L_NS {600} |
| | 1 code, low
|
| |
|
constexpr uint32_t | m5::unit::rgb::timing::RESET_NS {300000} |
| | Reset (latch), WS2812C-2020 needs > 280 us.
|
| |
Color type and data line timing for M5Unit-RGB.
Kept apart from unit_LED.hpp so the native (host) tests can include it without pulling in M5UnitComponent.
◆ operator==()
| bool m5::unit::rgb::operator== |
( |
const Color & | lhs, |
|
|
const Color & | rhs ) |
|
constexpr |
Compare two Colors.
- Parameters
-
| lhs | Left-hand side |
| rhs | Right-hand side |
- Returns
- True if equal
◆ ticks_from_ns()
| uint32_t m5::unit::rgb::ticks_from_ns |
( |
const uint32_t | ns, |
|
|
const uint32_t | resolution_hz ) |
|
constexpr |
Convert a duration to RMT ticks.
- Parameters
-
| ns | Duration (ns) |
| resolution_hz | RMT resolution (Hz) |
- Returns
- Ticks, rounded to the nearest (not clamped to the 15-bit RMT duration)