Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
button.h File Reference

Interface for the physical components of the push button. More...

Go to the source code of this file.

Classes

struct  lampda::physical::button::ButtonStateTy
 Store the button status and characteristics. More...
 

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::physical
 Handle the physical modules drivers.
 
namespace  lampda::physical::button
 Handle the button inputs and multiple click detection.
 

Functions

void lampda::physical::button::init (const bool isSystemStartedFromButton)
 Start the button handler.
 
ButtonStateTy lampda::physical::button::get_button_state ()
 Get a copy of the raw internal button state.
 
platform::gpio::DigitalPin::GPIO lampda::physical::button::get_button_pin ()
 Return the pin used for the button.
 
void lampda::physical::button::set_button_pin (const platform::gpio::DigitalPin::GPIO buttonPin)
 Only on system start, set the pin where the button is wired.
 
int lampda::physical::button::get_button_pin_RAW ()
 get the button pin index in system. USE WITH CAUTION
 

Variables

static constexpr uint32_t lampda::physical::button::thread_throttle_time_ms = 5
 thread run frequency timing
 
static constexpr uint32_t lampda::physical::button::RELEASE_BETWEEN_CLICKS = 50
 minimum release timing (debounce)
 
static constexpr uint32_t lampda::physical::button::RELEASE_TIMING_CLICKS_MS = 250
 time to release the button after clicks stops
 
static constexpr uint32_t lampda::physical::button::RELEASE_TIMING_HOLDS_MS = 125
 time to release the button after hold stops
 
static constexpr uint32_t lampda::physical::button::HOLD_BUTTON_MIN_MS = 500
 press and hold delay (ms)
 

Detailed Description

Interface for the physical components of the push button.