|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Button configuration. More...
Public Attributes | |
| idfxx::gpio | pin = gpio::nc() |
| GPIO pin (required) | |
| enum mode | mode = mode::poll |
| Detection mode. | |
| gpio::level | pressed_level = gpio::level::low |
| GPIO level when pressed. | |
| bool | enable_pull = true |
| Enable internal pull resistor. | |
| bool | autorepeat = false |
| Enable autorepeat (disables long press) | |
| std::chrono::microseconds | dead_time {std::chrono::milliseconds{50}} |
| Debounce delay. | |
| std::chrono::microseconds | long_press_time {std::chrono::milliseconds{1000}} |
| Long press threshold. | |
| std::chrono::microseconds | autorepeat_timeout {std::chrono::milliseconds{500}} |
| Autorepeat start delay. | |
| std::chrono::microseconds | autorepeat_interval {std::chrono::milliseconds{250}} |
| Autorepeat repeat interval. | |
| std::chrono::microseconds | poll_interval {std::chrono::milliseconds{10}} |
| Polling interval. | |
| std::move_only_function< void(event_type)> | callback |
| Event callback (required) | |
Button configuration.
All fields have sensible defaults, but you must set pin and callback at minimum.
Definition at line 86 of file button.hpp.
Enable autorepeat (disables long press)
Definition at line 91 of file button.hpp.
| std::chrono::microseconds idfxx::button::config::autorepeat_interval {std::chrono::milliseconds{250}} |
Autorepeat repeat interval.
Definition at line 95 of file button.hpp.
| std::chrono::microseconds idfxx::button::config::autorepeat_timeout {std::chrono::milliseconds{500}} |
Autorepeat start delay.
Definition at line 94 of file button.hpp.
| std::move_only_function<void(event_type)> idfxx::button::config::callback |
Event callback (required)
Definition at line 97 of file button.hpp.
| std::chrono::microseconds idfxx::button::config::dead_time {std::chrono::milliseconds{50}} |
Debounce delay.
Definition at line 92 of file button.hpp.
Enable internal pull resistor.
Definition at line 90 of file button.hpp.
| std::chrono::microseconds idfxx::button::config::long_press_time {std::chrono::milliseconds{1000}} |
Long press threshold.
Definition at line 93 of file button.hpp.
| enum mode idfxx::button::config::mode = mode::poll |
Detection mode.
Definition at line 88 of file button.hpp.
| idfxx::gpio idfxx::button::config::pin = gpio::nc() |
GPIO pin (required)
Definition at line 87 of file button.hpp.
| std::chrono::microseconds idfxx::button::config::poll_interval {std::chrono::milliseconds{10}} |
Polling interval.
Definition at line 96 of file button.hpp.
| gpio::level idfxx::button::config::pressed_level = gpio::level::low |
GPIO level when pressed.
Definition at line 89 of file button.hpp.