ili9341: moved text functions to dedicated source file.
This commit is contained in:
@@ -157,6 +157,7 @@
|
|||||||
.include "modules/lcd2/ili9341/main.asm"
|
.include "modules/lcd2/ili9341/main.asm"
|
||||||
.include "modules/lcd2/ili9341/io_spi.asm"
|
.include "modules/lcd2/ili9341/io_spi.asm"
|
||||||
.include "modules/lcd2/ili9341/font8x8.asm"
|
.include "modules/lcd2/ili9341/font8x8.asm"
|
||||||
|
.include "modules/lcd2/ili9341/text.asm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -112,8 +112,23 @@ ILI9341_Init:
|
|||||||
mov r3, r16
|
mov r3, r16
|
||||||
|
|
||||||
; set character
|
; set character
|
||||||
ldi r16, 65
|
ldi r16, 'A'
|
||||||
rcall ili9341_WriteCharacterX4At
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
|
ldi r16, 'Q'
|
||||||
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
|
ldi r16, 'H'
|
||||||
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
|
ldi r16, 'O'
|
||||||
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
|
ldi r16, 'M'
|
||||||
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
|
ldi r16, 'E'
|
||||||
|
rcall ili9341PrintChar
|
||||||
|
|
||||||
sec
|
sec
|
||||||
ret
|
ret
|
||||||
@@ -121,6 +136,16 @@ ILI9341_Init:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ili9341PrintChar:
|
||||||
|
push zl
|
||||||
|
push zh
|
||||||
|
rcall ili9341_WriteCharacterX4At
|
||||||
|
pop zh
|
||||||
|
pop zl
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine ILI9341_Fini @global
|
; @routine ILI9341_Fini @global
|
||||||
|
|
||||||
@@ -433,7 +458,7 @@ ili9341BitBlit_loopW:
|
|||||||
; @param r9:r8 W
|
; @param r9:r8 W
|
||||||
; @param r11:r10 H
|
; @param r11:r10 H
|
||||||
; @param X source data pointer (RAM)
|
; @param X source data pointer (RAM)
|
||||||
; @clobbers r16, r22, r23, r24, r25, X (r17, r20, r21)
|
; @clobbers r16, r22, r23, r24, r25, X (r17, r18, r19, r20, r21)
|
||||||
|
|
||||||
ili9341BitBlitStretch2:
|
ili9341BitBlitStretch2:
|
||||||
push r15
|
push r15
|
||||||
@@ -589,107 +614,6 @@ ili9341BitBlitStretchNWriteLine_loop2:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine ili9341_WriteCharacterX1At
|
|
||||||
|
|
||||||
; @param R16 character to write
|
|
||||||
; @param r5:r4 X
|
|
||||||
; @param r7:r6 Y
|
|
||||||
; @param r1:r0 background color
|
|
||||||
; @param r3:r2 foreground color
|
|
||||||
; @param Z pointer to font
|
|
||||||
; @param X pointer to RAM to store data to
|
|
||||||
; @return r5:r4 new X (advanced by character width)
|
|
||||||
; @clobbers r16, r17, r18, r19, r24, r25, x, z
|
|
||||||
|
|
||||||
ili9341_WriteCharacterX1At:
|
|
||||||
; render character
|
|
||||||
push xl
|
|
||||||
push xh
|
|
||||||
rcall ili9341WriteCharacterFromFont8x8 ; (r17, r24, r25, x, z)
|
|
||||||
pop xh
|
|
||||||
pop xl
|
|
||||||
|
|
||||||
; set width and height
|
|
||||||
ldi r16, 8
|
|
||||||
mov r8, r16
|
|
||||||
clr r9
|
|
||||||
mov r10, r16
|
|
||||||
clr r11
|
|
||||||
|
|
||||||
rjmp ili9341BitBlit
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine ili9341_WriteCharacterX2At
|
|
||||||
|
|
||||||
; @param R16 character to write
|
|
||||||
; @param r5:r4 X
|
|
||||||
; @param r7:r6 Y
|
|
||||||
; @param r1:r0 background color
|
|
||||||
; @param r3:r2 foreground color
|
|
||||||
; @param Z pointer to font
|
|
||||||
; @param X pointer to RAM to store data to
|
|
||||||
; @return r5:r4 new X (advanced by character width)
|
|
||||||
; @clobbers r16, r17, r18, r19, r24, r25, x, z
|
|
||||||
|
|
||||||
ili9341_WriteCharacterX2At:
|
|
||||||
; render character
|
|
||||||
push xl
|
|
||||||
push xh
|
|
||||||
rcall ili9341WriteCharacterFromFont8x8 ; (r17, r24, r25, x, z)
|
|
||||||
pop xh
|
|
||||||
pop xl
|
|
||||||
|
|
||||||
; set width and height
|
|
||||||
ldi r16, 8
|
|
||||||
mov r8, r16
|
|
||||||
clr r9
|
|
||||||
mov r10, r8
|
|
||||||
clr r11
|
|
||||||
|
|
||||||
rjmp ili9341BitBlitStretch2
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine ili9341_WriteCharacterX4At
|
|
||||||
|
|
||||||
; @param R16 character to write
|
|
||||||
; @param r5:r4 X
|
|
||||||
; @param r7:r6 Y
|
|
||||||
; @param r1:r0 background color
|
|
||||||
; @param r3:r2 foreground color
|
|
||||||
; @param Z pointer to font
|
|
||||||
; @param X pointer to RAM to store data to
|
|
||||||
; @return r5:r4 new X (advanced by character width)
|
|
||||||
; @clobbers r16, r17, r18, r19, r24, r25, x, z
|
|
||||||
|
|
||||||
ili9341_WriteCharacterX4At:
|
|
||||||
; render character
|
|
||||||
push xl
|
|
||||||
push xh
|
|
||||||
rcall ili9341WriteCharacterFromFont8x8 ; (r17, r24, r25, x, z)
|
|
||||||
pop xh
|
|
||||||
pop xl
|
|
||||||
|
|
||||||
; set width and height
|
|
||||||
ldi r16, 8
|
|
||||||
mov r8, r16
|
|
||||||
clr r9
|
|
||||||
mov r10, r8
|
|
||||||
clr r11
|
|
||||||
|
|
||||||
rjmp ili9341BitBlitStretch4
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
125
avr/modules/lcd2/ili9341/text.asm
Normal file
125
avr/modules/lcd2/ili9341/text.asm
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
; ***************************************************************************
|
||||||
|
; copyright : (C) 2025 by Martin Preuss
|
||||||
|
; email : martin@libchipcard.de
|
||||||
|
;
|
||||||
|
; ***************************************************************************
|
||||||
|
; * This file is part of the project "AqHome". *
|
||||||
|
; * Please see toplevel file COPYING of that project for license details. *
|
||||||
|
; ***************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; code
|
||||||
|
|
||||||
|
.cseg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine ili9341_WriteCharacterX1At
|
||||||
|
|
||||||
|
; @param R16 character to write
|
||||||
|
; @param r5:r4 X
|
||||||
|
; @param r7:r6 Y
|
||||||
|
; @param r1:r0 background color
|
||||||
|
; @param r3:r2 foreground color
|
||||||
|
; @param Z pointer to font
|
||||||
|
; @param X pointer to RAM to store data to
|
||||||
|
; @return r5:r4 new X (advanced by character width)
|
||||||
|
; @clobbers r16 (r17, r20, r21, r22, r23, r24, r25, X)
|
||||||
|
|
||||||
|
ili9341_WriteCharacterX1At:
|
||||||
|
rcall ili9341PrepareCharFromFont ; (r16, r17, r24, r25, z)
|
||||||
|
rcall ili9341BitBlit ; (r16, r17, r20, r21, r22, r23, r24, r25, X)
|
||||||
|
ldi r16, 8
|
||||||
|
add r4, r16
|
||||||
|
adc r5, r16
|
||||||
|
sub r5, r16
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine ili9341_WriteCharacterX2At
|
||||||
|
|
||||||
|
; @param R16 character to write
|
||||||
|
; @param r5:r4 X
|
||||||
|
; @param r7:r6 Y
|
||||||
|
; @param r1:r0 background color
|
||||||
|
; @param r3:r2 foreground color
|
||||||
|
; @param Z pointer to font
|
||||||
|
; @param X pointer to RAM to store data to
|
||||||
|
; @return r5:r4 new X (advanced by character width)
|
||||||
|
; @clobbers r16 (r17, r18, r19, r20, r21, r22, r23, r24, r25, X)
|
||||||
|
|
||||||
|
ili9341_WriteCharacterX2At:
|
||||||
|
rcall ili9341PrepareCharFromFont ; (r16, r17, r24, r25, z)
|
||||||
|
rcall ili9341BitBlitStretch2 ; (r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, X)
|
||||||
|
ldi r16, 16
|
||||||
|
add r4, r16
|
||||||
|
adc r5, r16
|
||||||
|
sub r5, r16
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine ili9341_WriteCharacterX4At
|
||||||
|
|
||||||
|
; @param R16 character to write
|
||||||
|
; @param r5:r4 X
|
||||||
|
; @param r7:r6 Y
|
||||||
|
; @param r1:r0 background color
|
||||||
|
; @param r3:r2 foreground color
|
||||||
|
; @param Z pointer to font
|
||||||
|
; @param X pointer to RAM to store data to
|
||||||
|
; @return r5:r4 new X (advanced by character width)
|
||||||
|
; @clobbers r16, r17, r18, r19, r24, r25, x, z
|
||||||
|
|
||||||
|
ili9341_WriteCharacterX4At:
|
||||||
|
rcall ili9341PrepareCharFromFont ; (r16, r17, r24, r25, z)
|
||||||
|
rcall ili9341BitBlitStretch4
|
||||||
|
ldi r16, 32
|
||||||
|
add r4, r16
|
||||||
|
adc r5, r16
|
||||||
|
sub r5, r16
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine ili9341PrepareCharFromFont
|
||||||
|
|
||||||
|
; @param R16 character to write
|
||||||
|
; @param Z pointer to font
|
||||||
|
; @param X pointer to RAM to store data to
|
||||||
|
; @param r9:r8 character width in points
|
||||||
|
; @param r11:r10 character height in points
|
||||||
|
; @clobbers r16 (r17, r24, r25, z)
|
||||||
|
|
||||||
|
ili9341PrepareCharFromFont:
|
||||||
|
; render character
|
||||||
|
push xl
|
||||||
|
push xh
|
||||||
|
rcall ili9341WriteCharacterFromFont8x8 ; (r17, r24, r25, x, z)
|
||||||
|
pop xh
|
||||||
|
pop xl
|
||||||
|
|
||||||
|
; set width and height
|
||||||
|
ldi r16, 8
|
||||||
|
mov r8, r16
|
||||||
|
clr r9
|
||||||
|
mov r10, r16
|
||||||
|
clr r11
|
||||||
|
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user