Struct daisy::DigitalControl¶
ClassList > daisy > DigitalControl
#include <digital_control.h>
Public Attributes¶
| Type | Name |
|---|---|
| bool | flip_ |
| uint32_t | rising_edge_time_ |
| uint8_t | state_ |
Public Functions¶
| Type | Name |
|---|---|
| void | Debounce (bool input) |
| DigitalControl () |
|
| bool | FallingEdge () const |
| void | Init (bool flip) |
| bool | Pressed () const |
| bool | RisingEdge () const |
| uint32_t | TimeHeldMs () const |
Detailed Description¶
Debouncer for non-GPIO switch inputs independent of their source. For getting Switch like behavior from inputs connected to shiftregisters, etc.
Maintains the state and allows checks for transitions, timing, etc.
Unlike AnalogControl, this does not take a pointer to an externally updated value. This is because the input to this may often be a callable (e.g. shiftreg.State(x), gpio.Read()) that may not be stateful.
Public Attributes Documentation¶
variable flip_¶
variable rising_edge_time_¶
variable state_¶
Public Functions Documentation¶
function Debounce¶
function DigitalControl¶
function FallingEdge¶
function Init¶
function Pressed¶
function RisingEdge¶
function TimeHeldMs¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/digital_control.h