avr: work on simple GUI module to be used by node c02.

This commit is contained in:
Martin Preuss
2025-11-03 17:23:40 +01:00
parent b4fee78ad8
commit e58e9b846c
38 changed files with 1951 additions and 2422 deletions

View File

@@ -7,6 +7,11 @@
; * Please see toplevel file COPYING of that project for license details. *
; ***************************************************************************
#ifndef AQH_AVR_ILI9341_IO_SPI_ASM
#define AQH_AVR_ILI9341_IO_SPI_ASM
; generally we use the following parameters here:
; @param r1:r0 background color
; @param r3:r2 foreground color
@@ -59,7 +64,7 @@ ILI9341IoInit:
ili9341BeginSpi:
ldi r16, ILI9341_SPIMODE
ldi r17, ILI9341_DEVICENUM
rjmp SPIHW_MasterStart ; (R18)
rjmp SPIHW_MasterStart ; (R17)
; @end
@@ -75,17 +80,31 @@ ili9341EndSpi:
; ---------------------------------------------------------------------------
; @routine ili9341SendCommand
;
; @param r16 byte to send
; @return r16 byte received
; @clobbers r16
ili9341SendCommand:
cbi SPIHW_SS_OUTPUT, SPIHW_SS_PIN ; SS low
cbi ILI9341_DC_OUTPUT, ILI9341_DC_PIN ; D low
nop
rcall SPIHW_MasterTransfer
rcall SPIHW_MasterTransfer ; (none)
sbi SPIHW_SS_OUTPUT, SPIHW_SS_PIN ; SS low
ret
; @end
; ---------------------------------------------------------------------------
; @routine ili9341SendData
;
; @param r16 byte to send
; @return r16 byte received
; @clobbers r16
ili9341SendData:
cbi SPIHW_SS_OUTPUT, SPIHW_SS_PIN ; SS low
sbi ILI9341_DC_OUTPUT, ILI9341_DC_PIN ; D high
@@ -96,7 +115,12 @@ ili9341SendData:
; ---------------------------------------------------------------------------
; @routine ili9341Send16BitData
;
; @param r19:18 data
; @clobbers r16
ili9341Send16BitData:
cbi SPIHW_SS_OUTPUT, SPIHW_SS_PIN ; SS low
sbi ILI9341_DC_OUTPUT, ILI9341_DC_PIN ; D high
@@ -110,3 +134,5 @@ ili9341Send16BitData:
#endif ; AQH_AVR_ILI9341_IO_SPI_ASM