Sygaldry
Loading...
Searching...
No Matches
sygsp-button: Button Gesture Model

Classes

struct  sygaldry::sygsp::ButtonGestureModel
 Component modelling gestures performed with a single bi-state push button. More...
 

Enumerations

enum class  sygaldry::sygsp::ButtonActive : char { Low = 0 , High = 1 }
 Enumeration for button activity to button logical state mapping. More...
 

Detailed Description

Enumeration Type Documentation

◆ ButtonActive

enum class sygaldry::sygsp::ButtonActive : char
strong

Enumeration for button activity to button logical state mapping.

When a button is active high, it implies that the logical voltage state of the button is high (1, VCC) when the button is "activated", e.g. when a push-button is pushed, and low (0, GND) when the button is not activated. Similarly, a button that is active low reads logic low (0, GND) when activated and logic high (1, VCC) when not activated.

Button implementations are expected to set the button_state toggle to 1 when the button is active, as in e.g. inputs.button_state = read_gpio() == active_level where read_gpio() reads the GPIO the button is attached to and active_level is a ButtonActive value.