-
-
Notifications
You must be signed in to change notification settings - Fork 710
Introduce RGB LED effects #5597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
[no changelog]
[no changelog]
[no changelog]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces RGB LED effects functionality to the Trezor T3W1 device, enabling dynamic LED animations driven by system timers. The implementation adds support for predefined effects like bootloader breathing and charging animations.
- Adds RGB LED effects infrastructure with systimer-based callbacks for 50Hz effect updates
- Introduces two predefined effects: bootloader breathe (blue) and charging (yellow) with configurable cycle counts
- Extends prodtest commands and API exposure to support effect control and testing
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
core/site_scons/models/T3W1/*.py |
Adds rgb_led_effects.c source file to build configuration |
core/embed/sys/syscall/stm32/syscall_*.c |
Implements syscall stubs and dispatch for new effect start/stop functions |
core/embed/sys/syscall/inc/sys/syscall_numbers.h |
Adds syscall numbers for RGB LED effect operations |
core/embed/rust/build.rs |
Exposes new RGB LED effect types and functions to Rust bindings |
core/embed/projects/prodtest/cmd/prodtest_rgbled.c |
Adds prodtest commands for starting and stopping RGB LED effects |
core/embed/projects/prodtest/README.md |
Documents new prodtest commands for RGB LED effects |
core/embed/io/rgb_led/unix/rgb_led.c |
Provides stub implementations for Unix platform |
core/embed/io/rgb_led/stm32u5/rgb_led_lp.c |
Core RGB LED driver with effect management and systimer integration |
core/embed/io/rgb_led/stm32u5/rgb_led_internal.h |
Internal driver structures and effect callback definitions |
core/embed/io/rgb_led/stm32u5/rgb_led_effects.c |
Effect implementations with linear interpolation and timing logic |
core/embed/io/rgb_led/inc/io/rgb_led.h |
Public API definitions, color palette, and effect types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
[no changelog]
…ion. [no changelog]
b089499
to
d88a60e
Compare
|
model | device_test | click_test | persistence_test |
---|---|---|---|
T2T1 | |||
T3B1 | |||
T3T1 | |||
T3W1 |
Latest CI run: 17124684426
This PR introduces LED effects into the rgb_led driver.
LED effects
The rgb_led driver effects are driven by an internal systimer which interrupts every 20ms (50Hz) when an effect is started. The interrupt then calls an effect callback from the lookup table which returns the actual RGB LED color based on the elapsed time.
API
The rgb_led API introduces two functions:
rgb_led_effect_start
- starts the selected effect for the requested number of cycles (or indefinitely)rgb_led_effect_stop
- stops the ongoing effectThe already available
rgb_led_set_color
function will stop any ongoing effect and override the LED color.API was exposed to FW via stubs.
Color palette and effect LUT
The driver was updated with a color palette defined by designers, and introduces two effects (BOOTLOADER BREATE, CHARGING) according to FW and bootloader flow. Both the palette and effects will probably be subject to fine-tuning to meet design expectations.
Prodtest
In order to allow testing, prodtest was extended with
rgbled-effect-start
andrgbled-effect-stop
commands.