ISF15ACP4 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
isf15acp4_kconfig.hpp
Go to the documentation of this file.
1
21#ifndef ISF15ACP4_KCONFIG_HPP
22#define ISF15ACP4_KCONFIG_HPP
23
24#ifdef __has_include
25#if __has_include("sdkconfig.h")
26#include "sdkconfig.h"
27#endif
28#endif
29
30#include "isf15acp4_types.hpp"
31
32#ifndef CONFIG_ISF15ACP4_MASTER_CURRENT
34#define CONFIG_ISF15ACP4_MASTER_CURRENT 15
35#endif
36#ifndef CONFIG_ISF15ACP4_BUTTON_DEBOUNCE_MS
38#define CONFIG_ISF15ACP4_BUTTON_DEBOUNCE_MS 20
39#endif
40#ifndef CONFIG_ISF15ACP4_BUTTON_LONG_PRESS_MS
42#define CONFIG_ISF15ACP4_BUTTON_LONG_PRESS_MS 800
43#endif
44#ifndef CONFIG_ISF15ACP4_IDLE_DIM_MS
46#define CONFIG_ISF15ACP4_IDLE_DIM_MS 0
47#endif
48#ifndef CONFIG_ISF15ACP4_IDLE_SLEEP_MS
50#define CONFIG_ISF15ACP4_IDLE_SLEEP_MS 0
51#endif
52
53namespace isf15acp4 {
54
60constexpr Config KconfigDefaults() noexcept {
61#ifdef CONFIG_ISF15ACP4_VARIANT_ISC15ANP4
63#elif defined(CONFIG_ISF15ACP4_VARIANT_ISC01P)
65#else
67#endif
68 c.master_current = static_cast<uint8_t>(CONFIG_ISF15ACP4_MASTER_CURRENT);
69#ifdef CONFIG_ISF15ACP4
71#ifdef CONFIG_ISF15ACP4_RED_ON_SEGMENT_A
72 true;
73#else
74 false;
75#endif
77#ifdef CONFIG_ISF15ACP4_BUTTON_ACTIVE_LOW
78 true;
79#else
80 false;
81#endif
82#endif
85 c.idle_dim_ms = static_cast<uint32_t>(CONFIG_ISF15ACP4_IDLE_DIM_MS);
86 c.idle_sleep_ms = static_cast<uint32_t>(CONFIG_ISF15ACP4_IDLE_SLEEP_MS);
87 return c;
88}
89
90} // namespace isf15acp4
91
92#endif // ISF15ACP4_KCONFIG_HPP
constexpr Config PresetFor(Variant variant) noexcept
The working set of a module.
Definition isf15acp4_types.hpp:362
@ Isc15anp4
64 x 48 pixels, pushbutton (NKK sheet ISC15ANP4).
@ Isc01p
52 x 36 pixels, display only (NKK sheet ISC01P): no switch.
@ Isf15acp4
96 x 64 pixels, frameless pushbutton (NKK sheet E4 to E7).
#define CONFIG_ISF15ACP4_MASTER_CURRENT
Definition isf15acp4_kconfig.hpp:34
#define CONFIG_ISF15ACP4_IDLE_SLEEP_MS
Definition isf15acp4_kconfig.hpp:50
#define CONFIG_ISF15ACP4_IDLE_DIM_MS
Definition isf15acp4_kconfig.hpp:46
#define CONFIG_ISF15ACP4_BUTTON_DEBOUNCE_MS
Definition isf15acp4_kconfig.hpp:38
#define CONFIG_ISF15ACP4_BUTTON_LONG_PRESS_MS
Definition isf15acp4_kconfig.hpp:42
Public types of the ISF15ACP4 driver: errors, Result<T>, the display and button configuration,...
The ISF15ACP4 driver: everything it declares lives here; internals in detail.
Definition isf15acp4.hpp:31
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the module's preset.
Definition isf15acp4_kconfig.hpp:60
uint32_t debounce_ms
Time a level must be stable to count, 1 to 1000.
Definition isf15acp4_types.hpp:288
uint32_t long_press_ms
Hold time of LongPress, above the debounce time, to 60000.
Definition isf15acp4_types.hpp:289
bool active_low
The closed switch pulls the pin low (pull-up wiring).
Definition isf15acp4_types.hpp:287
Everything the driver sends at start-up, and its own time knobs.
Definition isf15acp4_types.hpp:322
ButtonConfig button
The switch.
Definition isf15acp4_types.hpp:354
uint32_t idle_sleep_ms
Poll(): sleep after this idle time; 0 = never.
Definition isf15acp4_types.hpp:353
uint32_t idle_dim_ms
Poll(): dim after this idle time; 0 = never.
Definition isf15acp4_types.hpp:352
uint8_t master_current
87h, 0 to 15 (1/16 to 16/16).
Definition isf15acp4_types.hpp:331
bool red_on_segment_a
Panel wiring: segment group A carries red.
Definition isf15acp4_types.hpp:347