This debouncer will update state if for N consecutive attempts the input value is the same.
More...
#include <Debouncer.hxx>
|
| typedef uint8_t | Options |
| | Type declaring what opeions we can supply to this class.
|
| |
|
| unsigned | count_: 8 |
| | How many times we've seen the proposed new state.
|
| |
| unsigned | waitCount_: 8 |
| | Configuration: what is the quiesce count we have to reach.
|
| |
| unsigned | currentState_: 1 |
| | Current visible state.
|
| |
This debouncer will update state if for N consecutive attempts the input value is the same.
Definition at line 66 of file Debouncer.hxx.
◆ Options
Type declaring what opeions we can supply to this class.
Definition at line 70 of file Debouncer.hxx.
◆ QuiesceDebouncer()
| QuiesceDebouncer::QuiesceDebouncer |
( |
const Options & |
wait_count | ) |
|
|
inline |
Constructor.
- Parameters
-
| wait_count | defines how many poll cycles the input has to quiesce (not change) before we accept that input and forward to the caller. |
Definition at line 75 of file Debouncer.hxx.
◆ current_state()
| bool QuiesceDebouncer::current_state |
( |
| ) |
|
|
inline |
- Returns
- the currently visible (accepted) state.
Definition at line 104 of file Debouncer.hxx.
◆ initialize()
| void QuiesceDebouncer::initialize |
( |
bool |
state | ) |
|
|
inline |
Initializes the debouncer.
- Parameters
-
| state | is the externally forced state. |
Definition at line 91 of file Debouncer.hxx.
◆ override()
| void QuiesceDebouncer::override |
( |
bool |
new_state | ) |
|
|
inline |
- Parameters
-
| state | is the externally forced state. |
Definition at line 98 of file Debouncer.hxx.
◆ reset_options()
| void QuiesceDebouncer::reset_options |
( |
const Options & |
opts | ) |
|
|
inline |
Re-creates the debouncer with new options.
- Parameters
-
Definition at line 84 of file Debouncer.hxx.
◆ update_state()
| bool QuiesceDebouncer::update_state |
( |
bool |
state | ) |
|
|
inline |
Iteration function of the debouncer.
- Parameters
-
| state | is the new state read. |
- Returns
- true if the state has just changed (the visible state just flipped from being != state to being == state). False if the visible state was not changed by this poll cycle.
Definition at line 113 of file Debouncer.hxx.
◆ count_
| unsigned QuiesceDebouncer::count_ |
|
private |
How many times we've seen the proposed new state.
Definition at line 132 of file Debouncer.hxx.
◆ currentState_
| unsigned QuiesceDebouncer::currentState_ |
|
private |
◆ waitCount_
| unsigned QuiesceDebouncer::waitCount_ |
|
private |
Configuration: what is the quiesce count we have to reach.
Definition at line 134 of file Debouncer.hxx.
The documentation for this class was generated from the following file: