M5Unified
m5::Button_Class Class Reference

#include <Button_Class.hpp>

Public Types

enum  button_state_t : std::uint8_t { state_nochange , state_clicked , state_hold , state_decide_click_count }
 

Public Member Functions

bool wasClicked (void) const
 Returns true when the button is pressed briefly and released. More...
 
bool wasHold (void) const
 Returns true when the button has been held pressed for a while. More...
 
bool wasSingleClicked (void) const
 Returns true when some time has passed since the button was single clicked. More...
 
bool wasDoubleClicked (void) const
 Returns true when some time has passed since the button was double clicked. More...
 
bool wasDecideClickCount (void) const
 Returns true when some time has passed since the button was multiple clicked. More...
 
bool wasDeciedClickCount (void) const
 
std::uint8_t getClickCount (void) const
 
bool isHolding (void) const
 Returns true if the button is currently held pressed. More...
 
bool wasChangePressed (void) const
 
bool isPressed (void) const
 
bool isReleased (void) const
 
bool wasPressed (void) const
 
bool wasReleased (void) const
 
bool wasReleasedAfterHold (void) const
 
bool wasReleaseFor (std::uint32_t ms) const
 
bool wasReleasefor (std::uint32_t ms) const
 
bool pressedFor (std::uint32_t ms) const
 
bool releasedFor (std::uint32_t ms) const
 
void setDebounceThresh (std::uint32_t msec)
 
void setHoldThresh (std::uint32_t msec)
 
void setRawState (std::uint32_t msec, bool press)
 
void setState (std::uint32_t msec, button_state_t state)
 
button_state_t getState (void) const
 
std::uint32_t lastChange (void) const
 
std::uint32_t getDebounceThresh (void) const
 
std::uint32_t getHoldThresh (void) const
 
std::uint32_t getUpdateMsec (void) const
 

Detailed Description

Definition at line 11 of file Button_Class.hpp.

Member Enumeration Documentation

◆ button_state_t

enum m5::Button_Class::button_state_t : std::uint8_t
Enumerator
state_nochange 
state_clicked 
state_hold 
state_decide_click_count 

Definition at line 14 of file Button_Class.hpp.

Member Function Documentation

◆ getClickCount()

std::uint8_t m5::Button_Class::getClickCount ( void  ) const
inline

Definition at line 39 of file Button_Class.hpp.

◆ getDebounceThresh()

std::uint32_t m5::Button_Class::getDebounceThresh ( void  ) const
inline

Definition at line 65 of file Button_Class.hpp.

◆ getHoldThresh()

std::uint32_t m5::Button_Class::getHoldThresh ( void  ) const
inline

Definition at line 66 of file Button_Class.hpp.

◆ getState()

button_state_t m5::Button_Class::getState ( void  ) const
inline

Definition at line 62 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ getUpdateMsec()

std::uint32_t m5::Button_Class::getUpdateMsec ( void  ) const
inline

Definition at line 68 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ isHolding()

bool m5::Button_Class::isHolding ( void  ) const
inline

Returns true if the button is currently held pressed.

Definition at line 42 of file Button_Class.hpp.

◆ isPressed()

bool m5::Button_Class::isPressed ( void  ) const
inline

Definition at line 45 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ isReleased()

bool m5::Button_Class::isReleased ( void  ) const
inline

Definition at line 46 of file Button_Class.hpp.

◆ lastChange()

std::uint32_t m5::Button_Class::lastChange ( void  ) const
inline

Definition at line 63 of file Button_Class.hpp.

◆ pressedFor()

bool m5::Button_Class::pressedFor ( std::uint32_t  ms) const
inline

Definition at line 54 of file Button_Class.hpp.

◆ releasedFor()

bool m5::Button_Class::releasedFor ( std::uint32_t  ms) const
inline

Definition at line 55 of file Button_Class.hpp.

◆ setDebounceThresh()

void m5::Button_Class::setDebounceThresh ( std::uint32_t  msec)
inline

Definition at line 57 of file Button_Class.hpp.

◆ setHoldThresh()

void m5::Button_Class::setHoldThresh ( std::uint32_t  msec)
inline

Definition at line 58 of file Button_Class.hpp.

◆ setRawState()

void m5::Button_Class::setRawState ( std::uint32_t  msec,
bool  press 
)

Definition at line 41 of file Button_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setState()

void m5::Button_Class::setState ( std::uint32_t  msec,
button_state_t  state 
)

Definition at line 8 of file Button_Class.cpp.

Here is the caller graph for this function:

◆ wasChangePressed()

bool m5::Button_Class::wasChangePressed ( void  ) const
inline

Definition at line 43 of file Button_Class.hpp.

◆ wasClicked()

bool m5::Button_Class::wasClicked ( void  ) const
inline

Returns true when the button is pressed briefly and released.

Definition at line 22 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ wasDecideClickCount()

bool m5::Button_Class::wasDecideClickCount ( void  ) const
inline

Returns true when some time has passed since the button was multiple clicked.

Definition at line 34 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ wasDeciedClickCount()

bool m5::Button_Class::wasDeciedClickCount ( void  ) const
inline

Definition at line 37 of file Button_Class.hpp.

Here is the call graph for this function:

◆ wasDoubleClicked()

bool m5::Button_Class::wasDoubleClicked ( void  ) const
inline

Returns true when some time has passed since the button was double clicked.

Definition at line 31 of file Button_Class.hpp.

◆ wasHold()

bool m5::Button_Class::wasHold ( void  ) const
inline

Returns true when the button has been held pressed for a while.

Definition at line 25 of file Button_Class.hpp.

◆ wasPressed()

bool m5::Button_Class::wasPressed ( void  ) const
inline

Definition at line 47 of file Button_Class.hpp.

◆ wasReleased()

bool m5::Button_Class::wasReleased ( void  ) const
inline

Definition at line 48 of file Button_Class.hpp.

◆ wasReleasedAfterHold()

bool m5::Button_Class::wasReleasedAfterHold ( void  ) const
inline

Definition at line 49 of file Button_Class.hpp.

◆ wasReleaseFor()

bool m5::Button_Class::wasReleaseFor ( std::uint32_t  ms) const
inline

Definition at line 50 of file Button_Class.hpp.

Here is the caller graph for this function:

◆ wasReleasefor()

bool m5::Button_Class::wasReleasefor ( std::uint32_t  ms) const
inline

Definition at line 53 of file Button_Class.hpp.

Here is the call graph for this function:

◆ wasSingleClicked()

bool m5::Button_Class::wasSingleClicked ( void  ) const
inline

Returns true when some time has passed since the button was single clicked.

Definition at line 28 of file Button_Class.hpp.


The documentation for this class was generated from the following files: