|
ISF15ACP4 Driver 0.1.0
API reference
|
The switch debouncer: a time-injected state machine with press, release, long-press and repeat events. More...
Go to the source code of this file.
Classes | |
| struct | isf15acp4::ButtonUpdate |
One result of ButtonDebouncer::Update(). More... | |
| class | isf15acp4::ButtonDebouncer |
| Debounces a switch sampled at any rate and classifies the press. More... | |
Namespaces | |
| namespace | isf15acp4 |
The ISF15ACP4 driver: everything it declares lives here; internals in detail. | |
The switch debouncer: a time-injected state machine with press, release, long-press and repeat events.
The switch is an SPST normally-open contact (NKK sheet E4: "Leave actuator: 1 - 2 OFF, push
actuator: 1 - 2 ON"). The sheet gives no bounce time, so the debounce time is ButtonConfig's knob. ButtonDebouncer has no port, no clock and no I/O: the caller passes the sampled level and a millisecond timestamp. All time arithmetic is unsigned subtraction, so a wrapping 32-bit counter is handled.