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

Handle the LED output brightness. More...

Classes

struct  BrightnessParameters
 Store the brigthness characteristics. More...
 

Functions

brightness_t get_brightness ()
 Return the current brightness value (in range 0 - brightness::absoluteMaximumBrightness). It's value depends on a lot of factors and can be cantrolled by any actors.
 
brightness_t get_max_brightness ()
 Return the maximum allowed brightness.
 
brightness_t get_max_user_brightness ()
 Return the maximum allowed brightness for the user modes.
 
void set_max_brightness (const brightness_t brg)
 Set the new max brightness.
 
void set_max_user_brightness (const brightness_t brg)
 Set the maximum allowed brightness for the user modes.
 
void update_saved_brightness ()
 Update the saved brightness value with the current brightness.
 
brightness_t get_saved_brightness ()
 Return the saved brightness level. This shoudl be the prefered option in all computations.
 
void update_brightness (const brightness_t newBrightness, const bool shouldCallUserBrightnessCallback=false)
 update the internal brightness values
 
void force_brightness_user_callback ()
 force an update call to the user brightness callback
 
uint32_t when_last_update_brightness ()
 Get time in milliseconds when brightness was last updated.
 

Variables

BrightnessParameters __internal
 

Detailed Description

Handle the LED output brightness.

Function Documentation

◆ set_max_brightness()

void lampda::logic::brightness::set_max_brightness ( const brightness_t  brg)

Set the new max brightness.

Parameters
[in]brgNew brightness, limited to brightness::absoluteMaximumBrightness

◆ update_brightness()

void lampda::logic::brightness::update_brightness ( const brightness_t  newBrightness,
const bool  shouldCallUserBrightnessCallback = false 
)

update the internal brightness values

Parameters
[in]newBrightnessthe new brightness value
[in]shouldCallUserBrightnessCallbackTrue if this will call the user callback call