70 inline bool RisingEdge()
const {
return updated_ ? state_ == 0x7f :
false; }
75 return updated_ ? state_ == 0x80 :
false;
79 inline bool Pressed()
const {
return state_ == 0xff; }
105 float rising_edge_time_;
Definition leddriver.h:33
void Init(dsy_gpio_pin pin, float update_rate=0.f)
float TimeHeldMs() const
Definition switch.h:88
bool RisingEdge() const
Definition switch.h:70
bool RawState()
Definition switch.h:82
~Switch()
Definition switch.h:42
void Init(dsy_gpio_pin pin, float update_rate, Type t, Polarity pol, Pull pu)
Type
Definition switch.h:22
@ TYPE_TOGGLE
Definition switch.h:23
@ TYPE_MOMENTARY
Definition switch.h:24
void SetUpdateRate(float update_rate)
Definition switch.h:96
Pull
Definition switch.h:35
@ PULL_UP
Definition switch.h:36
@ PULL_NONE
Definition switch.h:38
@ PULL_DOWN
Definition switch.h:37
bool Pressed() const
Definition switch.h:79
Switch()
Definition switch.h:41
bool FallingEdge() const
Definition switch.h:73
Polarity
Definition switch.h:28
@ POLARITY_INVERTED
Definition switch.h:30
@ POLARITY_NORMAL
Definition switch.h:29
uint8_t dsy_gpio_read(const dsy_gpio *p)
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition daisy_core.h:205