ili9341: tested backlight dimming (doesn't work with my displays, either)

probably the LED pins are hardcoded with my displays. They respond neither
to PWM on the LED pin nor to ili9341 commands.
This commit is contained in:
Martin Preuss
2026-01-27 20:32:38 +01:00
parent 7411fd2a13
commit 74b4098608

View File

@@ -46,7 +46,7 @@ ILI9341_Init:
rcall ILI9341_Reset
rcall ILI9341_LeaveSleepMode
ldi r16, 0xff
ldi r16, 0x20
rcall ILI9341_SetBacklight
sec
@@ -146,13 +146,14 @@ ILI9341_SetBacklight:
ILI9341_SetBacklight_on:
sbi ILI9341_LED_OUTPUT, ILI9341_LED_PIN
ret ; DEBUG
push r16
rcall ili9341BeginSpi
ldi r16, ILI9341_CMD_WRITECTLDISPLAY
rcall ili9341SendCommand
; ldi r16, 0b00100100
ldi r16, 0x24
; BCTRL=1, DD=1, BL=1 (or: 0x24 reported to work)
ldi r16, (1<<5) | (1<<3) | (1<<2)
rcall ili9341SendData
ldi r16, ILI9341_CMD_SETDSPBRIGHTNESS
@@ -160,10 +161,10 @@ ret ; DEBUG
pop r16
rcall ili9341SendData
ldi r16, 0xbe
rcall ili9341SendCommand
ldi r16, 0x0f
rcall ili9341SendData
; ldi r16, 0xbe
; rcall ili9341SendCommand
; ldi r16, 0x0f
; rcall ili9341SendData
rcall ili9341EndSpi