more work on c02 and lcd drivers.

This commit is contained in:
Martin Preuss
2025-11-07 17:04:08 +01:00
parent 660f2502c1
commit 9300e515e7
7 changed files with 279 additions and 72 deletions

View File

@@ -120,7 +120,7 @@ ILI9341_Reset:
rcall Utils_WaitForMilliSecs
rcall ili9341BeginSpi
ldi r16, 0x29
ldi r16, 0x29 ; display on
rcall ili9341SendCommand
rcall ili9341EndSpi
@@ -145,7 +145,7 @@ ILI9341_SetBacklight:
ret
ILI9341_SetBacklight_on:
sbi ILI9341_LED_OUTPUT, ILI9341_LED_PIN
ret ; DEBUG
push r16
rcall ili9341BeginSpi
@@ -175,18 +175,29 @@ ILI9341_SetBacklight_on:
ILI9341_LeaveSleepMode:
rcall ili9341BeginSpi
ldi r16, 0x11 ; sleep out
rcall ili9341SendCommand
rcall ili9341EndSpi
ldi r16, 5
ldi r16, 120
rcall Utils_WaitForMilliSecs
rcall ili9341BeginSpi
ldi r16, 0x38 ; idle mode off
rcall ili9341SendCommand
rcall ili9341EndSpi
rcall ili9341BeginSpi
ldi r16, 0x13 ; normal mode on
rcall ili9341SendCommand
rcall ili9341EndSpi
ret
; @end
ili9341InitCommands:
#if 1
; display off
.db 0x28, 0
; PowerCtlA
@@ -235,6 +246,32 @@ ili9341InitCommands:
; end
.db 0xff, 0xff
#else
.db 0xef, 3, 0x03, 0x80, 0x02, 0x00
.db 0xcf, 3, 0x00, 0xc1, 0x30, 0x00
.db 0xed, 4, 0x64, 0x03, 0x12, 0x81
.db 0xe8, 3, 0x85, 0x00, 0x78, 0x00
.db 0xcb, 5, 0x39, 0x2c, 0x00, 0x34, 0x02, 0x00
.db 0xf7, 1, 0x20, 0x00
.db 0xea, 2, 0x00, 0x00
.db 0xc0, 1, 0x23, 0x00
.db 0xc1, 1, 0x10, 0x00
.db 0xc5, 2, 0x3e, 0x28
; .db 0xc7, 1, 0x86, 0x00
.db 0xc7, 1, 0xb7, 0x00
.db 0x36, 1, 0b11101000, 0x00
.db 0x3a, 1, 0x55, 0x00
.db 0xb1, 2, 0x00, ILI9341_FRAMERATE_100_HZ
.db 0xb6, 3, 0x08, 0x82, 0x27, 0x00
.db 0xf2, 1, 0x00, 0x00
.db 0x26, 1, 0x01, 0x00
.db 0xe0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1
.db 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, 0x00
.db 0xe1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1
.db 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, 0x00
; end
.db 0xff, 0xff
#endif ; AQH_AVR_ILI9341_MAIN_ASM