📄 spi-lcd.lss
字号:
000009cc <S1D15G00ClearLcd>:
}
/*----------------------------------------------------------*\
| S1D15G00 Clear LCD |
\*----------------------------------------------------------*/
void S1D15G00ClearLcd(void) {
9cc: cf 93 push r28
9ce: df 93 push r29
unsigned int i;
S1D15G00SetPageArea(0, 0, GLCD_X_END, GLCD_Y_END);
9d0: 23 e8 ldi r18, 0x83 ; 131
9d2: 42 2f mov r20, r18
9d4: 60 e0 ldi r22, 0x00 ; 0
9d6: 86 2f mov r24, r22
9d8: de df rcall .-68 ; 0x996 <S1D15G00SetPageArea>
9da: cf e0 ldi r28, 0x0F ; 15
9dc: d4 e4 ldi r29, 0x44 ; 68
// S1D15G00WriteCommand(RAMWR);
for(i=0; i<(GLCD_PIXELX*GLCD_PIXELY);i++)//(GLCD_PIXELX*GLCD_PIXELY)
{
S1D15G00WriteData(0xFF);
9de: 8f ef ldi r24, 0xFF ; 255
9e0: 99 df rcall .-206 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0xFF);
9e2: 8f ef ldi r24, 0xFF ; 255
9e4: 97 df rcall .-210 ; 0x914 <S1D15G00WriteData>
9e6: 21 97 sbiw r28, 0x01 ; 1
9e8: d7 ff sbrs r29, 7
9ea: f9 cf rjmp .-14 ; 0x9de <S1D15G00ClearLcd+0x12>
9ec: df 91 pop r29
9ee: cf 91 pop r28
9f0: 08 95 ret
000009f2 <Delay>:
}
}
/*----------------------------------------------------------*\
| Delay |
\*----------------------------------------------------------*/
void Delay(INT32U dly) {
INT32U i;
for(; dly>0; dly--)
9f2: 00 97 sbiw r24, 0x00 ; 0
9f4: 51 f0 breq .+20 ; 0xa0a <Delay+0x18>
for(i=0; i<50000; i++);
9f6: 20 e0 ldi r18, 0x00 ; 0
9f8: 30 e0 ldi r19, 0x00 ; 0
9fa: 2e 5c subi r18, 0xCE ; 206
9fc: 3f 4f sbci r19, 0xFF ; 255
9fe: 43 ec ldi r20, 0xC3 ; 195
a00: 20 35 cpi r18, 0x50 ; 80
a02: 34 07 cpc r19, r20
a04: d0 f3 brcs .-12 ; 0x9fa <Delay+0x8>
a06: 01 97 sbiw r24, 0x01 ; 1
a08: f4 cf rjmp .-24 ; 0x9f2 <Delay>
a0a: 08 95 ret
00000a0c <S1D15G00Init>:
}
/*----------------------------------------------------------*\
| S1D15G00 Initial |
\*----------------------------------------------------------*/
void S1D15G00Init(void) {
sbi(LCD_CR_DDR,LCD_DATA);
a0c: 89 9a sbi 0x11, 1 ; 17
sbi(LCD_CR_DDR,LCD_CS);
a0e: 8a 9a sbi 0x11, 2 ; 17
sbi(LCD_CR_DDR,LCD_CLK);
a10: 8c 9a sbi 0x11, 4 ; 17
sbi(LCD_CR_DDR,LCD_RST);
a12: 8b 9a sbi 0x11, 3 ; 17
sbi(LCD_CR_PORT,LCD_CS);
a14: 92 9a sbi 0x12, 2 ; 18
Delay(1);
a16: 81 e0 ldi r24, 0x01 ; 1
a18: 90 e0 ldi r25, 0x00 ; 0
a1a: eb df rcall .-42 ; 0x9f2 <Delay>
cbi(LCD_CR_PORT,LCD_RST);
a1c: 93 98 cbi 0x12, 3 ; 18
Delay(6);
a1e: 86 e0 ldi r24, 0x06 ; 6
a20: 90 e0 ldi r25, 0x00 ; 0
a22: e7 df rcall .-50 ; 0x9f2 <Delay>
sbi(LCD_CR_PORT,LCD_RST);
a24: 93 9a sbi 0x12, 3 ; 18
Delay(6);
a26: 86 e0 ldi r24, 0x06 ; 6
a28: 90 e0 ldi r25, 0x00 ; 0
a2a: e3 df rcall .-58 ; 0x9f2 <Delay>
sbi(LCD_CR_PORT,LCD_DATA);
a2c: 91 9a sbi 0x12, 1 ; 18
sbi(LCD_CR_PORT,LCD_CLK);
a2e: 94 9a sbi 0x12, 4 ; 18
Delay(6);
a30: 86 e0 ldi r24, 0x06 ; 6
a32: 90 e0 ldi r25, 0x00 ; 0
a34: de df rcall .-68 ; 0x9f2 <Delay>
// S1D15G00SpiInit();
S1D15G00WriteCommand(SOFT_RESET); //Temperature gradient set
a36: 81 e0 ldi r24, 0x01 ; 1
a38: 2c df rcall .-424 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteCommand(BOOSTER_ON); //Internal oscillation on
a3a: 83 e0 ldi r24, 0x03 ; 3
a3c: 2a df rcall .-428 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteCommand(SLEEP_OUT); //Sleep out
a3e: 81 e1 ldi r24, 0x11 ; 17
a40: 28 df rcall .-432 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteCommand(COLOR_INTERFACE); //Partial display out
a42: 8a e3 ldi r24, 0x3A ; 58
a44: 26 df rcall .-436 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteData(COLOR_16_BIT);
a46: 85 e0 ldi r24, 0x05 ; 5
a48: 65 df rcall .-310 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteCommand(COLOR_SET); //256-color position set
a4a: 8d e2 ldi r24, 0x2D ; 45
a4c: 22 df rcall .-444 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteData(0x00);
a4e: 80 e0 ldi r24, 0x00 ; 0
a50: 61 df rcall .-318 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x02);
a52: 82 e0 ldi r24, 0x02 ; 2
a54: 5f df rcall .-322 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x04);
a56: 84 e0 ldi r24, 0x04 ; 4
a58: 5d df rcall .-326 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x06);
a5a: 86 e0 ldi r24, 0x06 ; 6
a5c: 5b df rcall .-330 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x09);
a5e: 89 e0 ldi r24, 0x09 ; 9
a60: 59 df rcall .-334 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0B);
a62: 8b e0 ldi r24, 0x0B ; 11
a64: 57 df rcall .-338 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0D);
a66: 8d e0 ldi r24, 0x0D ; 13
a68: 55 df rcall .-342 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0F);
a6a: 8f e0 ldi r24, 0x0F ; 15
a6c: 53 df rcall .-346 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x00);
a6e: 80 e0 ldi r24, 0x00 ; 0
a70: 51 df rcall .-350 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x02);
a72: 82 e0 ldi r24, 0x02 ; 2
a74: 4f df rcall .-354 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x04);
a76: 84 e0 ldi r24, 0x04 ; 4
a78: 4d df rcall .-358 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x06);
a7a: 86 e0 ldi r24, 0x06 ; 6
a7c: 4b df rcall .-362 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x09);
a7e: 89 e0 ldi r24, 0x09 ; 9
a80: 49 df rcall .-366 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0B);
a82: 8b e0 ldi r24, 0x0B ; 11
a84: 47 df rcall .-370 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0D);
a86: 8d e0 ldi r24, 0x0D ; 13
a88: 45 df rcall .-374 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0F);
a8a: 8f e0 ldi r24, 0x0F ; 15
a8c: 43 df rcall .-378 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x00);
a8e: 80 e0 ldi r24, 0x00 ; 0
a90: 41 df rcall .-382 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x04);
a92: 84 e0 ldi r24, 0x04 ; 4
a94: 3f df rcall .-386 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0B);
a96: 8b e0 ldi r24, 0x0B ; 11
a98: 3d df rcall .-390 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(0x0F);
a9a: 8f e0 ldi r24, 0x0F ; 15
a9c: 3b df rcall .-394 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteCommand(MEM_CONTROL); //Display control
a9e: 86 e3 ldi r24, 0x36 ; 54
aa0: f8 de rcall .-528 ; 0x892 <S1D15G00WriteCommand>
S1D15G00WriteData((0 << MEM_MX) | (1 << MEM_MY) | (1 << MEM_RGB) | (0 << MEM_VW) | (0 << MEM_LAO));
aa2: 88 e8 ldi r24, 0x88 ; 136
aa4: 37 df rcall .-402 ; 0x914 <S1D15G00WriteData>
Delay(60);
aa6: 8c e3 ldi r24, 0x3C ; 60
aa8: 90 e0 ldi r25, 0x00 ; 0
aaa: a3 df rcall .-186 ; 0x9f2 <Delay>
S1D15G00WriteCommand(DISPLAY_ON); //Display control
aac: 89 e2 ldi r24, 0x29 ; 41
aae: f1 de rcall .-542 ; 0x892 <S1D15G00WriteCommand>
ab0: 08 95 ret
00000ab2 <PutChar>:
}
#include "8X16.h"
void PutChar(INT8U x, INT8U y, char c, INT16U f, INT16U b) {
ab2: 9f 92 push r9
ab4: af 92 push r10
ab6: bf 92 push r11
ab8: cf 92 push r12
aba: df 92 push r13
abc: ef 92 push r14
abe: ff 92 push r15
ac0: 0f 93 push r16
ac2: 1f 93 push r17
ac4: cf 93 push r28
ac6: 78 2f mov r23, r24
ac8: 94 2e mov r9, r20
unsigned int i,j;
INT8U fRed,fGreenBlue,bRed,bGreenBlue;
fRed = (f>>8) & 0xFF; fGreenBlue = f & 0xFF;
aca: 83 2f mov r24, r19
acc: 99 27 eor r25, r25
ace: a8 2e mov r10, r24
ad0: b2 2e mov r11, r18
bRed = (b>>8) & 0xFF; bGreenBlue = b & 0xFF;
ad2: 81 2f mov r24, r17
ad4: 99 27 eor r25, r25
ad6: c8 2e mov r12, r24
ad8: d0 2e mov r13, r16
S1D15G00SetPageArea(x, y, x+8-1, y+16-1);
ada: 86 2f mov r24, r22
adc: 81 5f subi r24, 0xF1 ; 241
ade: 97 2f mov r25, r23
ae0: 99 5f subi r25, 0xF9 ; 249
ae2: 28 2f mov r18, r24
ae4: 49 2f mov r20, r25
ae6: 87 2f mov r24, r23
ae8: 56 df rcall .-340 ; 0x996 <S1D15G00SetPageArea>
for(i=0; i<16;i++) {
aea: ee 24 eor r14, r14
aec: ff 24 eor r15, r15
INT8U m=pgm_read_byte(font+c*16+i);
aee: e9 2d mov r30, r9
af0: ff 27 eor r31, r31
af2: 84 e0 ldi r24, 0x04 ; 4
af4: ee 0f add r30, r30
af6: ff 1f adc r31, r31
af8: 8a 95 dec r24
afa: e1 f7 brne .-8 ; 0xaf4 <PutChar+0x42>
afc: ee 0d add r30, r14
afe: ff 1d adc r31, r15
b00: ea 5d subi r30, 0xDA ; 218
b02: ff 4f sbci r31, 0xFF ; 255
b04: c4 91 lpm r28, Z
b06: 07 e0 ldi r16, 0x07 ; 7
b08: 10 e0 ldi r17, 0x00 ; 0
for(j=0;j<8;j++) {
if((m&0x80)==0x80) {
b0a: c7 ff sbrs r28, 7
b0c: 04 c0 rjmp .+8 ; 0xb16 <PutChar+0x64>
S1D15G00WriteData(fRed);
b0e: 8a 2d mov r24, r10
b10: 01 df rcall .-510 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(fGreenBlue);
b12: 8b 2d mov r24, r11
b14: 03 c0 rjmp .+6 ; 0xb1c <PutChar+0x6a>
}
else {
S1D15G00WriteData(bRed);
b16: 8c 2d mov r24, r12
b18: fd de rcall .-518 ; 0x914 <S1D15G00WriteData>
S1D15G00WriteData(bGreenBlue);
b1a: 8d 2d mov r24, r13
b1c: fb de rcall .-522 ; 0x914 <S1D15G00WriteData>
}
m<<=1;
b1e: cc 0f add r28, r28
b20: 01 50 subi r16, 0x01 ; 1
b22: 10 40 sbci r17, 0x00 ; 0
b24: 17 ff sbrs r17, 7
b26: f1 cf rjmp .-30 ; 0xb0a <PutChar+0x58>
b28: 08 94 sec
b2a: e1 1c adc r14, r1
b2c: f1 1c adc r15, r1
b2e: 80 e1 ldi r24, 0x10 ; 16
b30: e8 16 cp r14, r24
b32: f1 04 cpc r15, r1
b34: e0 f2 brcs .-72 ; 0xaee <PutChar+0x3c>
b36: cf 91 pop r28
b38: 1f 91 pop r17
b3a: 0f 91 pop r16
b3c: ff 90 pop r15
b3e: ef 90 pop r14
b40: df 90 pop r13
b42: cf 90 pop r12
b44: bf 90 pop r11
b46: af 90 pop r10
b48: 9f 90 pop r9
b4a: 08 95 ret
00000b4c <PutString>:
}
}
}
void PutString(INT8U x, INT8U y, char *s, INT16U f, INT16U b) {
b4c: 9f 92 push r9
b4e: af 92 push r10
b50: bf 92 push r11
b52: cf 92 push r12
b54: df 92 push r13
b56: ef 92 push r14
b58: ff 92 push r15
b5a: 0f 93 push r16
b5c: 1f 93 push r17
b5e: cf 93 push r28
b60: df 93 push r29
b62: 98 2e mov r9, r24
b64: c6 2e mov r12, r22
b66: ea 01 movw r28, r20
b68: 59 01 movw r10, r18
b6a: 78 01 movw r14, r16
INT8U l=0;
b6c: dd 24 eor r13, r13
while(*s) {
PutChar(x+l*8,y,*s,f,b);
s++;l++;
b6e: 88 81 ld r24, Y
b70: 88 23 and r24, r24
b72: 71 f0 breq .+28 ; 0xb90 <PutString+0x44>
b74: 8d 2d mov r24, r13
b76: 88 0f add r24, r24
b78: 88 0f add r24, r24
b7a: 88 0f add r24, r24
b7c: 87 01 movw r16, r14
b7e: 95 01 movw r18, r10
b80: 49 91 ld r20, Y+
b82: 6c 2d mov r22, r12
b84: 89 0d add r24, r9
b86: 95 df rcall .-214 ; 0xab2 <PutChar>
b88: d3 94 inc r13
b8a: 88 81 ld r24, Y
b8c: 88 23 and r24, r24
b8e: 91 f7 brne .-28 ; 0xb74 <PutString+0x28>
b90: df 91 pop r29
b92: cf 91 pop r28
b94: 1f 91 pop r17
b96: 0f 91 pop r16
b98: ff 90 pop r15
b9a: ef 90 pop r14
b9c: df 90 pop r13
b9e: cf 90 pop r12
ba0: bf 90 pop r11
ba2: af 90 pop r10
ba4: 9f 90 pop r9
ba6: 08 95 ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -