PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
light.h File Reference
#include <stdint.h>
#include <kernel/pebble_tasks.h>
#include <shell/prefs.h>

Functions

void light_init (void)
 Initialize the backlight service at startup.
 
void light_handle_color_prefs_changed (void)
 Reschedule the day/night color switch after a backlight color pref is loaded or changed.
 
void light_handle_clock_change (void)
 Re-apply the system color after the wall clock or time zone changes.
 
void light_button_pressed (void)
 Handle a button press.
 
void light_button_released (void)
 Handle a button release.
 
void light_touch_down (void)
 Handle a touch finger-down.
 
void light_touch_moved (void)
 Handle a touch moving while down.
 
void light_touch_up (void)
 Release the hold taken by light_touch_down().
 
void light_enable (bool enable)
 Turn the watch's backlight on or put it back into automatic control.
 
void light_enable_respect_settings (bool enable)
 light_enable() that respects the user's backlight settings.
 
void light_enable_interaction (void)
 Trigger the backlight and schedule a timer to automatically disable the backlight after a short delay.
 
void light_reset_user_controlled_by_task (PebbleTask task)
 Return to the normal state machine if task forced the light with light_enable().
 
void light_set_color_rgb888 (uint32_t rgb)
 Tint the backlight LED to a packed 24-bit RGB value.
 
void light_set_system_color (void)
 Restore the backlight to the user's default color.
 
void light_system_color_request (void)
 Make the system color take precedence over any app color.
 
void light_system_color_release (void)
 Release a light_system_color_request().
 
void light_toggle_enabled (void)
 Toggle the user's backlight enabled setting.
 
void light_toggle_ambient_sensor_enabled (void)
 Toggle the user's ambient light sensor setting.
 
void light_set_dynamic_mode (BacklightDynamicMode mode)
 Set the dynamic backlight mode.
 
void light_allow (bool allowed)
 Allow or disallow the backlight, e.g.
 
uint8_t light_get_current_brightness_percent (void)
 Get the current backlight brightness.
 
bool light_is_on (void)
 Check whether the backlight is on.
 
bool light_is_lit_by_touch (void)
 Check whether the backlight was lit by touch alone.
 
uint32_t light_get_ambient_lux (void)
 Get the ambient light level.
 
uint32_t light_get_ambient_gate_lux (void)
 Get the ambient light level the backlight wake gate compares against the dark threshold.
 
uint32_t light_get_dark_threshold (void)
 Get the ambient light level below which the backlight turns on.
 
void light_set_dark_threshold (uint32_t threshold)
 Set the ambient light level below which the backlight turns on.