Skip to content

Commit c840530

Browse files
Fri3d 2026: add CH32 LCD backlight setting
1 parent aeaa77e commit c840530

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Future release (next version)
33

44
Add changes that have been made to the code but haven't made it into a release here.
55

6+
Board Support:
7+
- Fri3d 2026: add CH32 LCD backlight setting
8+
9+
610
0.9.3
711
=====
812

internal_filesystem/lib/mpos/board/fri3d_2026.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ def get_voltage(force_refresh=False, raw_adc_value=None):
149149

150150
# LCD reset using the CH32 microcontroller
151151
time.sleep_ms(10) # make sure writes are spaced out to workaround Fri3dCamp/badge_2026_fw/issues/2
152-
expander.config= 0x01 # 3v3 aux on + LCD off
152+
expander.config = 0x01 # 3v3 aux on + LCD off
153153
time.sleep_ms(100)
154-
expander.config= 0x03 # 3v3 aux + LCD on
154+
expander.config = 0x03 # 3v3 aux + LCD on
155155

156156
# see ./lvgl_micropython/api_drivers/py_api_drivers/frozen/display/display_driver_framework.py
157157
mpos.ui.main_display = st7789.ST7789(
@@ -166,10 +166,15 @@ def get_voltage(force_refresh=False, raw_adc_value=None):
166166
# reset_pin is driven by the CH32 microcontroller
167167
) # calls lv.init()
168168

169+
def ch32_backlight(percent):
170+
time.sleep_ms(10) # workaround Fri3dCamp/badge_2026_fw/issues/2
171+
expander.lcd_brightness = percent
172+
169173
mpos.ui.main_display.init()
170174
mpos.ui.main_display.set_power(True)
171175
mpos.ui.main_display.set_backlight(100)
172176
mpos.ui.main_display.set_color_inversion(True)
177+
mpos.ui.main_display.set_backlight = ch32_backlight
173178

174179
# Touch handling:
175180
# touch pad interrupt TP Int is on ESP.IO13

0 commit comments

Comments
 (0)