Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
lampda::logic::inputs Namespace Reference

Handle the system input, the behavior associated to the button inputs. More...

Namespaces

namespace  __private
 private handling namespace, used for unit testing
 

Functions

void button_clicked_callback (const uint8_t consecutiveButtonCheck, const bool isFirstClick)
 
void button_hold_callback (const uint8_t consecutiveButtonCheck, const uint32_t buttonHoldDuration, const bool isEndOfPress, const bool isFirstClick)
 
void init (const bool wasPoweredByUserInterrupt)
 Call once on system start.
 
void loop ()
 Call often to handle button updates.
 
void button_disable_usermode ()
 disable custom user modes
 
bool is_button_usermode_enabled ()
 return true if custom user modes are enabled
 
bool add_button_click_event (uint32_t clickCount)
 Signal a button click event.
 
bool add_button_press_event (uint32_t clickCount, uint32_t pressDuration, bool isEndOfPress)
 Signal a button press event.
 

Variables

static constexpr uint32_t BRIGHTNESS_RAMP_DURATION_MS = 2000
 duration of the brightness ramp
 
static constexpr uint32_t BRIGHTNESS_LOOP_UPDATE_EVERY = 20
 frequency update of the ramp
 
static constexpr uint32_t BRIGHTNESS_RAMP_SATURATION_MAX_DURATION_MS
 duration of the brightness ramp saturation before switching behavior
 
bool isSystemOn = false
 holds the state of system on
 
bool isButtonUsermodeEnabled = false
 hold the boolean that configures if button's usermode UI is enabled
 

Detailed Description

Handle the system input, the behavior associated to the button inputs.

Function Documentation

◆ init()

void lampda::logic::inputs::init ( const bool  wasPoweredByUserInterrupt)

Call once on system start.

Parameters
[in]wasPoweredByUserInterruptIndicates if the system was powered by the user button interrupt

Variable Documentation

◆ BRIGHTNESS_RAMP_SATURATION_MAX_DURATION_MS

constexpr uint32_t lampda::logic::inputs::BRIGHTNESS_RAMP_SATURATION_MAX_DURATION_MS
staticconstexpr
Initial value:
=
5000

duration of the brightness ramp saturation before switching behavior