Skip to main content

Module init

Module init 

Source
Expand description

Backlight task initialization. Backlight task initialization and runtime loop.

StructsΒ§

BacklightState πŸ”’
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 correct to a pre-packaged (R, G, B) colour tuple.
fill_all_leds πŸ”’
Paint every LED with color at brightness and 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 value by brightness_percent (0–100), rounding to nearest.
softstart πŸ”’
Performs a soft-start brightness ramp on all LEDs at initialization.

Type AliasesΒ§

BacklightDriver πŸ”’
Concrete driver type for this keyboard.
BusError πŸ”’
Bus error type shared by all async driver helpers.
Transport πŸ”’
Concrete SPI transport type for this keyboard.