2.9 KiB
2.9 KiB
French Language & Addressable RGB LED (XL-2020RGBC-2812B) Implementation Plan
Goal Description
Modify the wristband firmware to support French-only UI display and replace the discrete 3-pin LED control with the single-wire addressable RGB LED (XL-2020RGBC-2812B) protocol (WS2812B timing compatible).
User Review Required
Important
- RGB LED (WS2812B) Control Pin: The single-wire addressable RGB LED requires a high-speed bit-stream control pin (DIN). We will use the P0.0 pin (originally
LED_Rnet) to drive the WS2812B DIN. P0.0 is already configured as a Push-Pull output. PinsP2.7(originallyLED_G) andP2.6(originallyLED_B) will be disabled (set to standard inputs or high logic).- French Translations: All UI strings will be replaced with French equivalents formatted to fit the 120-pixel wide OLED screen (max 15 characters per line).
Open Questions
None. The specifications are fully understood and mapping is direct.
Proposed Changes
Hardware / Drivers
[MODIFY] lcd_font.h
No change needed for font, but we might include character translations if custom accent characters were needed. Since we use standard French without accents (like "ARME" instead of "ARMÉ") to avoid custom font complexity, no changes to lcd_font.h are required.
Application Logic
[MODIFY] main.c
- Redefine LED output:
- Redefine
LED_R,LED_G,LED_Bas virtual/soft registers (bitvariables). This allows the current logic inTimer1_Isr(which computes blink rates, colors, and vibrations) to remain 100% unchanged.
- Redefine
- Implement WS2812B bit-bang driver:
- Write a precise assembly/C bit-bang function
WS2812_Write24Bit(u8 g, u8 r, u8 b)that drivesP0.0(DIN) with the correct WS2812 high-speed timing (typicalT0H = 0.35us,T0L = 0.9us,T1H = 0.8us,T1L = 0.4us). - Implement
WS2812_Reset()by holding DI low for>80usto latch data.
- Write a precise assembly/C bit-bang function
- Trigger RGB updates:
- At the end of
Timer1_Isr(or during main loop), monitor changes to the virtualLED_R,LED_G,LED_Bvariables. If any changes are detected, output the 24-bit color to the WS2812 LED using the bit-bang driver.
- At the end of
- French UI Translation:
- Translate all string literals displayed on the screen into French (e.g. menu items, sensor default names, and system state texts).
Verification Plan
Automated Tests
- Build code with Keil C251 to ensure 0 compile/link errors.
Manual Verification
- Test using UART simulation commands:
- Verify that the simulated LED output in the serial log shows correct R/G/B status changes for different states.
- Verify that French strings are printed correctly on the screen simulator or display.
- Test pairing, confirmation, alarm, and SOS states to verify correct RGB LED color outputs.