WS2812_RMT Driver 0.1.0
API reference
Loading...
Searching...
No Matches
ws2812_rmt_kconfig.hpp
Go to the documentation of this file.
1
11#ifndef WS2812_RMT_KCONFIG_HPP
12#define WS2812_RMT_KCONFIG_HPP
13
14#ifdef __has_include
15#if __has_include("sdkconfig.h")
16#include "sdkconfig.h"
17#endif
18#endif
19
20#include "ws2812_rmt_types.hpp"
21
22#ifndef CONFIG_WS2812_RMT_DEFAULT_BRIGHTNESS
24#define CONFIG_WS2812_RMT_DEFAULT_BRIGHTNESS 255
25#endif
26#ifndef CONFIG_WS2812_RMT_RESET_US
28#define CONFIG_WS2812_RMT_RESET_US 0
29#endif
30#ifndef CONFIG_WS2812_RMT_POWER_ON_SETTLE_US
32#define CONFIG_WS2812_RMT_POWER_ON_SETTLE_US 1000
33#endif
34
35namespace ws2812_rmt {
36
41constexpr Variant KconfigVariant() noexcept {
42#if defined(CONFIG_WS2812_RMT_VARIANT_WS2812)
43 return Variant::Ws2812;
44#elif defined(CONFIG_WS2812_RMT_VARIANT_WS2812B_PRE_V5)
46#elif defined(CONFIG_WS2812_RMT_VARIANT_WS2812C)
47 return Variant::Ws2812c;
48#elif defined(CONFIG_WS2812_RMT_VARIANT_WS2812D)
49 return Variant::Ws2812d;
50#elif defined(CONFIG_WS2812_RMT_VARIANT_SK6812_RGBW)
52#elif defined(CONFIG_WS2812_RMT_VARIANT_SK6812_MINI)
54#elif defined(CONFIG_WS2812_RMT_VARIANT_SK6812)
55 return Variant::Sk6812;
56#else
57 return Variant::Ws2812bV5;
58#endif
59}
60
65constexpr Config KconfigDefaults() noexcept {
68 c.brightness = static_cast<uint8_t>(CONFIG_WS2812_RMT_DEFAULT_BRIGHTNESS);
69 c.reset_us = static_cast<uint32_t>(CONFIG_WS2812_RMT_RESET_US);
71 return c;
72}
73
74} // namespace ws2812_rmt
75
76#endif // WS2812_RMT_KCONFIG_HPP
Variant
The timing generation (window set) of the part, chosen by what is printed on or known about it.
Definition ws2812_rmt_types.hpp:176
@ Ws2812
WS2812 (6 pin): 0.35/0.8/0.7/0.6 us +-150 ns, reset above 50 us.
@ Ws2812bV5
WS2812B V5 and V6, WS2812B-2020, WS2812B-1313, WS2812C-2020: reset above 280 us.
@ Ws2812c
WS2812C (5050) and WS2812-2020: T1L window 220 to 420 ns.
@ Ws2812d
WS2812D-F8: 750 to 1000 ns on T0L and T1H.
@ Ws2812bPreV5
WS2812B and WS2812S of 2013 to 2017: reset above 300 us.
@ Sk6812
SK6812 RGB (Rev 01): 0.3/0.9/0.6/0.6 us +-150 ns, reset 80 us.
@ Sk6812Rgbw
SK6812RGBW: 32 bit frame, low inside a frame below 20 us.
The WS2812_RMT driver: everything it declares lives here; internals in detail.
Definition ws2812_rmt.hpp:29
constexpr Variant KconfigVariant() noexcept
The variant menuconfig selected; Variant::Ws2812bV5 without a selection.
Definition ws2812_rmt_kconfig.hpp:41
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the datasheet defaults.
Definition ws2812_rmt_kconfig.hpp:65
Everything EnsureInitialized() uses. The defaults suit a current WS2812B (V5, V6).
Definition ws2812_rmt_types.hpp:509
uint8_t brightness
Linear dimming at start, 0 to 255.
Definition ws2812_rmt_types.hpp:513
Variant variant
The timing generation; no profile fits every part.
Definition ws2812_rmt_types.hpp:510
uint32_t reset_us
Reset low time; 0 = datasheet minimum plus kResetMarginUs.
Definition ws2812_rmt_types.hpp:516
static constexpr Config Default() noexcept
Definition ws2812_rmt_types.hpp:522
uint32_t power_on_settle_us
Wait after PowerOn() (no datasheet value, A-16).
Definition ws2812_rmt_types.hpp:517
#define CONFIG_WS2812_RMT_RESET_US
Definition ws2812_rmt_kconfig.hpp:28
#define CONFIG_WS2812_RMT_POWER_ON_SETTLE_US
Definition ws2812_rmt_kconfig.hpp:32
#define CONFIG_WS2812_RMT_DEFAULT_BRIGHTNESS
Definition ws2812_rmt_kconfig.hpp:24
Public types of the WS2812_RMT driver: errors, Result<T>, colours, the timing profile of every suppor...