LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
lsh_user_macros.hpp
Go to the documentation of this file.
1
21#ifndef LSHCORE_LSH_USER_MACROS_HPP
22#define LSHCORE_LSH_USER_MACROS_HPP
23
24// This file provides the user-facing macros. It needs the definitions of the
25// classes it instantiates and the bridge to the user's configuration.
26
32#include "util/debug/debug.hpp"
33
40#define LSH_ACTUATOR(var_name, pin, id) \
41 static_assert((id) > 0, "Actuator ID must be > 0. Please use positive IDs starting from 1."); \
42 Actuator var_name((pin), (id))
43
50#define LSH_BUTTON(var_name, pin, id) \
51 static_assert((id) > 0, "Button ID must be > 0. Please use positive IDs starting from 1."); \
52 Clickable var_name((pin), (id))
53
59#define LSH_INDICATOR(var_name, pin) \
60 Indicator var_name((pin))
61
62#endif // LSHCORE_LSH_USER_MACROS_HPP
Defines the Actuator class, representing a physical relay or digital output.
Defines the Clickable class for handling button inputs and click logic.
Declares the static Configurator class used for device setup in user code.
Declares debugging macros (DP, DPL) and helper functions.
Defines the Indicator class, representing an LED or status light.
Internal bridge that imports user-defined macros into the library's scope.