Expand description
Backlight task initialization. Backlight task initialization and runtime loop.
StructsΒ§
- Backlight
State π - Full backlight state, kept in one place so any path can do a consistent redraw without losing information.
ConstantsΒ§
- CALIB_
ALL_ πDONE_ BLINK_ COUNT - Number of on/off cycles in the βall keys acceptedβ blink animation.
- CALIB_
ALL_ πDONE_ BLINK_ HALF_ MS - Duration of each on and each off half-period of the blink (milliseconds).
- CALIB_
AMBER π - Background colour during the zero-travel calibration phase and the EEPROM-write-failure signal (amber).
- CALIB_
DONE_ πHOLD_ MS - Duration in milliseconds to hold the solid-green display after calibration is successfully stored, before returning to normal white backlight.
- CALIB_
GREEN π - Solid colour used for the post-calibration success hold and for each individually confirmed key during the full-travel pass (green).
- CAPS_
LOCK_ πLED_ INDEX - LED index for the Caps Lock indicator key.
- INDICATOR_
BRIGHTNESS π - Brightness percentage applied to indicator LEDs (0β100).
- INDICATOR_
OFF π - RGB color for a disabled indicator (off).
- INDICATOR_
RED π - RGB color for the active-lock indicator state (red).
- INDICATOR_
WHITE π - RGB color for the inactive-lock indicator state (white).
- NUM_
LOCK_ πLED_ INDEX - LED index for the Num Lock indicator key.
- SOFTSTART_
RAMP_ πMS - Total duration of the soft-start ramp in milliseconds.
- SOFTSTART_
STEPS π - Number of brightness steps in the soft-start ramp.
- THERMAL_
POLL π - Interval between thermal register polls.
- THERMAL_
THROTTLE_ πBRIGHTNESS - Brightness percentage applied when a driver chip reports temperature β₯ 70 Β°C.
FunctionsΒ§
- backlight_
runner - Runs the backlight controller loop.
- correct π
- Apply brightness scaling and gamma correction to an RGB colour.
- correct_
color π - Apply
correctto a pre-packaged(R, G, B)colour tuple. - fill_
all_ πleds - Paint every LED with
coloratbrightnessand flush to hardware. - render_
all π - Writes every LED to hardware according to
state. - render_
calib π - Render the full-travel calibration frame.
- render_
indicators π - Writes only the two indicator LEDs according to
state. - scale π
- Scale
valuebybrightness_percent(0β100), rounding to nearest. - softstart π
- Performs a soft-start brightness ramp on all LEDs at initialization.
Type AliasesΒ§
- Backlight
Driver π - Concrete driver type for this keyboard.
- BusError π
- Bus error type shared by all async driver helpers.
- Transport π
- Concrete SPI transport type for this keyboard.