65 inline bool RisingEdge()
const {
return updated_ ? state_ == 0x7f :
false; }
70 return updated_ ? state_ == 0x80 :
false;
74 inline bool Pressed()
const {
return state_ == 0xff; }
79 const bool raw = hw_gpio_.
Read();
101 float rising_edge_time_;
General Purpose I/O control.
Definition gpio.h:22
bool Read()
Reads the state of the GPIO.
Pull
Configures whether an internal Pull up or Pull down resistor is used.
Definition gpio.h:42
Definition leddriver.h:33
float TimeHeldMs() const
Definition switch.h:84
bool RisingEdge() const
Definition switch.h:65
bool RawState()
Definition switch.h:77
~Switch()
Definition switch.h:34
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:92
void Init(Pin pin, float update_rate, Type t, Polarity pol, GPIO::Pull pu=GPIO::Pull::PULLUP)
bool Pressed() const
Definition switch.h:74
Switch()
Definition switch.h:33
bool FallingEdge() const
Definition switch.h:68
void Init(Pin pin, float update_rate=0.f)
Polarity
Definition switch.h:28
@ POLARITY_INVERTED
Definition switch.h:30
@ POLARITY_NORMAL
Definition switch.h:29
Hardware defines and helpers for daisy field platform.
Definition index.h:2
representation of hardware port/pin combination
Definition daisy_core.h:193