|
Open Model Railroad Network (OpenMRN)
|
This class acts as a debouncer that uses one momentary input button, and switches the event state at every rising edge of that input button. More...
#include <Debouncer.hxx>
Public Types | |
| typedef Debouncer::Options | Options |
| Options type. | |
Public Member Functions | |
| ToggleDebouncer (const Options &options) | |
| Constructor. | |
| void | initialize (bool state) |
| Sets the initial state. | |
| void | override (bool state) |
| Forces the state to a given value. | |
| bool | current_state () |
| bool | update_state (bool state) |
| Inserts a single poll measurement. | |
Private Attributes | |
| Debouncer | impl_ |
| Implementation of the debounce logic. | |
| unsigned | eventState_: 1 |
| what the world thinks about the event | |
This class acts as a debouncer that uses one momentary input button, and switches the event state at every rising edge of that input button.
Internally it uses another debouncer to smooth the input button.
Definition at line 263 of file Debouncer.hxx.
| typedef Debouncer::Options ToggleDebouncer< Debouncer >::Options |
Options type.
Definition at line 267 of file Debouncer.hxx.
|
inline |
Constructor.
| options | specified options for the debouncer strategy. |
Definition at line 271 of file Debouncer.hxx.
|
inline |
Definition at line 292 of file Debouncer.hxx.
|
inline |
Sets the initial state.
| state | is the initial (or default) state. |
Definition at line 278 of file Debouncer.hxx.
|
inline |
Forces the state to a given value.
| state | is the forced state value. |
Definition at line 286 of file Debouncer.hxx.
|
inline |
Inserts a single poll measurement.
| state | is the measured state. |
Definition at line 300 of file Debouncer.hxx.
|
private |
what the world thinks about the event
Definition at line 317 of file Debouncer.hxx.
|
private |
Implementation of the debounce logic.
Definition at line 315 of file Debouncer.hxx.