⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ks0108_12864lcd.lis

📁 ks0108 avr单片机1284显示
💻 LIS
📖 第 1 页 / 共 5 页
字号:
 0310 602F              mov R22,R16
 0312 2197              sbiw R28,1
 0314                   .dbline -1
 0314                   .dbline 303
 0314           ;    }
 0314           ; 
 0314           ; /*----------------------------------------------------------------------------*-
 0314           ;   
 0314           ;    LCD_Set_XY()
 0314           ; 
 0314           ;    Set the DDRAM to a particular address.
 0314           ; 
 0314           ;    Used to determine where we write to in the LCD RAM and - thus -
 0314           ;    whether the text appears on Page 0, page 1, Column 0, Column 1, etc.
 0314           ; 
 0314           ;    Params (X, Y) : The DDRAM address we wish to write to. 
 0314           ;    
 0314           ;    X range : (Page 0 ~ Page 7), Y range : (0 ~ 127)
 0314           ; 
 0314           ; -*----------------------------------------------------------------------------*/
 0314           ; static void LCD_Set_XY(uInt8 X, uInt8 Y)
 0314           ;    {
 0314                   .dbline 304
 0314           ;    if (Y >= 64)
 0314 4034              cpi R20,64
 0316 80F0              brlo L62
 0318           X17:
 0318                   .dbline 305
 0318           ;       {
 0318                   .dbline 306
 0318           ;       LCD_INSTR_PORT &= ~LCD_CS1; // Select right side
 0318 9498              cbi 0x12,4
 031A                   .dbline 307
 031A           ;       LCD_INSTR_PORT |=  LCD_CS2;
 031A 959A              sbi 0x12,5
 031C                   .dbline 308
 031C           ;       LCD_Send_Byte((DISPLAY_PAGE_SET + X), COMMAND, NORMAL); // Set page 
 031C 2224              clr R2
 031E 2882              std y+0,R2
 0320 2227              clr R18
 0322 062F              mov R16,R22
 0324 0854              subi R16,72    ; addi 184
 0326 D6DF              xcall _LCD_Send_Byte
 0328                   .dbline 309
 0328           ;       LCD_Send_Byte((DISPLAY_COLUMN_SET + Y - 64), COMMAND, NORMAL); // Set column
 0328 2224              clr R2
 032A 2882              std y+0,R2
 032C 2227              clr R18
 032E 042F              mov R16,R20
 0330 005C              subi R16,192    ; addi 64
 0332 0054              subi R16,64
 0334 CFDF              xcall _LCD_Send_Byte
 0336                   .dbline 310
 0336           ;         }
 0336 0EC0              xjmp L63
 0338           L62:
 0338                   .dbline 312
 0338           ;    else
 0338           ;       {
 0338                   .dbline 313
 0338           ;       LCD_INSTR_PORT |=  LCD_CS1; // Select left side
 0338 949A              sbi 0x12,4
 033A                   .dbline 314
 033A           ;       LCD_INSTR_PORT &= ~LCD_CS2;
 033A 9598              cbi 0x12,5
 033C                   .dbline 315
 033C           ;         LCD_Send_Byte((DISPLAY_PAGE_SET + X), COMMAND, NORMAL); // Set page 
 033C 2224              clr R2
 033E 2882              std y+0,R2
 0340 2227              clr R18
 0342 062F              mov R16,R22
 0344 0854              subi R16,72    ; addi 184
 0346 C6DF              xcall _LCD_Send_Byte
 0348                   .dbline 316
 0348           ;       LCD_Send_Byte((DISPLAY_COLUMN_SET + Y), COMMAND, NORMAL); // Set column
 0348 2224              clr R2
 034A 2882              std y+0,R2
 034C 2227              clr R18
 034E 042F              mov R16,R20
 0350 005C              subi R16,192    ; addi 64
 0352 C0DF              xcall _LCD_Send_Byte
 0354                   .dbline 317
 0354           ;         }               
 0354           L63:
 0354                   .dbline -2
 0354           L61:
 0354                   .dbline 0 ; func end
 0354 2196              adiw R28,1
 0356 6991              ld R22,y+
 0358 4991              ld R20,y+
 035A 0895              ret
 035C                   .dbsym r Y 20 c
 035C                   .dbsym r X 22 c
 035C                   .dbend
 035C                   .dbfunc s LCD_Disp_a_Char _LCD_Disp_a_Char fV
 035C           ;             cl -> R20
 035C           ;     Video_Mode -> y+11
 035C           ;     Char_Value -> R22
 035C           ;              Y -> R10
 035C           ;              X -> R12
                        .even
 035C           _LCD_Disp_a_Char:
 035C 0E940000          xcall push_xgsetF03C
 0360 A22E              mov R10,R18
 0362 C02E              mov R12,R16
 0364 2197              sbiw R28,1
 0366 6985              ldd R22,y+9
 0368                   .dbline -1
 0368                   .dbline 343
 0368           ;    }
 0368           ;   
 0368           ; /*----------------------------------------------------------------------------*-
 0368           ; 
 0368           ;    LCD_Disp_a_Char()    
 0368           ;  
 0368           ;    Used to determine where we want to dispaly a char on the LCD panel 
 0368           ;    and - thus - whether the text appears on Page 0, page 1, Column 0, 
 0368           ;    Column 1, etc.
 0368           ; 
 0368           ;    Parameters:  
 0368           ;    ---------------------------------------------------------------------------
 0368           ;    X : range (Page 0 ~ Page 7)    
 0368           ;    Y : range (0 ~ 127)
 0368           ;    Params (X, Y) : The DDRAM address we wish to write to.
 0368           ; 
 0368           ;    Char_Value : The character value which's going to be displayed 
 0368           ;                 on the LCD panel 
 0368           ;                          
 0368           ;    Video_Mode : If Video_Mode == INVERSE(1), inverse video mode                          
 0368           ;                 If Video_Mode == NORMAL(0), normal video mode
 0368           ;                          
 0368           ; -*----------------------------------------------------------------------------*/
 0368           ; static void LCD_Disp_a_Char(uInt8 X, uInt8 Y, uInt8 Char_Value, 
 0368           ;                             uInt8 Video_Mode)
 0368           ;    {
 0368                   .dbline 348
 0368           ;    uInt8 cl;
 0368           ;    
 0368           ;    // Fine the char in the lookup table
 0368           ;    // See "FONT6x8.C" for details
 0368           ;    Char_Value -= 32;
 0368 6052              subi R22,32
 036A                   .dbline 350
 036A           ;      
 036A           ;    for (cl = 0; cl < 6; cl++)
 036A 4427              clr R20
 036C 15C0              xjmp L68
 036E           L65:
 036E                   .dbline 351
 036E           ;       {
 036E                   .dbline 352
 036E           ;         LCD_Set_XY(X, Y + cl);
 036E 2A2D              mov R18,R10
 0370 240F              add R18,R20
 0372 0C2D              mov R16,R12
 0374 CADF              xcall _LCD_Set_XY
 0376                   .dbline 353
 0376           ;       LCD_Send_Byte(FONT6x8[Char_Value][cl], D_DATA, Video_Mode);
 0376 0B84              ldd R0,y+11
 0378 0882              std y+0,R0
 037A 21E0              ldi R18,1
 037C 86E0              ldi R24,6
 037E 869F              mul R24,R22
 0380 1001              movw R2,R0
 0382 80E0              ldi R24,<_FONT6x8
 0384 90E0              ldi R25,>_FONT6x8
 0386 280E              add R2,R24
 0388 391E              adc R3,R25
 038A E42F              mov R30,R20
 038C FF27              clr R31
 038E E20D              add R30,R2
 0390 F31D              adc R31,R3
 0392 0491              lpm R16,Z
 0394 9FDF              xcall _LCD_Send_Byte
 0396                   .dbline 354
 0396           ;         }
 0396           L66:
 0396                   .dbline 350
 0396 4395              inc R20
 0398           L68:
 0398                   .dbline 350
 0398 4630              cpi R20,6
 039A 48F3              brlo L65
 039C           X18:
 039C                   .dbline -2
 039C           L64:
 039C                   .dbline 0 ; func end
 039C 2196              adiw R28,1
 039E 0C940000          xjmp pop_xgsetF03C
 03A2                   .dbsym r cl 20 c
 03A2                   .dbsym l Video_Mode 11 c
 03A2                   .dbsym r Char_Value 22 c
 03A2                   .dbsym r Y 10 c
 03A2                   .dbsym r X 12 c
 03A2                   .dbend
 03A2                   .dbfunc s LCD_Disp_String _LCD_Disp_String fV
 03A2           ;     Video_Mode -> y+11
 03A2           ;        pString -> R20,R21
 03A2           ;              Y -> R22
 03A2           ;              X -> R10
                        .even
 03A2           _LCD_Disp_String:
 03A2 0E940000          xcall push_xgsetF00C
 03A6 622F              mov R22,R18
 03A8 A02E              mov R10,R16
 03AA 2397              sbiw R28,3
 03AC 4985              ldd R20,y+9
 03AE 5A85              ldd R21,y+10
 03B0                   .dbline -1
 03B0                   .dbline 380
 03B0           ;    }
 03B0           ; 
 03B0           ; /*----------------------------------------------------------------------------*-
 03B0           ;    
 03B0           ;    LCD_Disp_String()
 03B0           ; 
 03B0           ;    Used to determine where we want to dispaly a string on the LCD panel 
 03B0           ;    and - thus - whether the text appears on Page 0, page 1, Column 0, 
 03B0           ;    Column 1, etc.
 03B0           ; 
 03B0           ;    Parameters: 
 03B0           ;    ---------------------------------------------------------------------------
 03B0           ;    X : range (Page 0 ~ Page 7)    
 03B0           ;    Y : range (0 ~ 127)
 03B0           ;    Params (X, Y) : The DDRAM address we wish to write to.
 03B0           ; 
 03B0           ;    pString    : The string pointer point out the string which's going to 
 03B0           ;                 be displayed on the LCD panel
 03B0           ; 
 03B0           ;    Video_Mode : If Video_Mode == INVERSE(1), inverse video mode                          
 03B0           ;                 If Video_Mode == NORMAL(0), normal video mode
 03B0           ;                                               
 03B0           ; -*----------------------------------------------------------------------------*/
 03B0           ; static void LCD_Disp_String(uInt8 X, uInt8 Y, flash uInt8 * pString, 
 03B0           ;                             uInt8 Video_Mode)
 03B0           ;    {
 03B0 0BC0              xjmp L71
 03B2           L70:
 03B2                   .dbline 382
 03B2           ;    while (* pString) 
 03B2           ;       {
 03B2                   .dbline 383
 03B2           ;       LCD_Disp_a_Char(X, Y, * pString, Video_Mode);
 03B2 0B84              ldd R0,y+11
 03B4 0A82              std y+2,R0
 03B6 FA01              movw R30,R20
 03B8 2490              lpm R2,Z
 03BA 2882              std y+0,R2
 03BC 262F              mov R18,R22
 03BE 0A2D              mov R16,R10
 03C0 CDDF              xcall _LCD_Disp_a_Char
 03C2                   .dbline 384
 03C2           ;         Y += 6; // Characters are 6x8 pixel
 03C2 6A5F              subi R22,250    ; addi 6
 03C4                   .dbline 385
 03C4           ;         pString++;      
 03C4 4F5F              subi R20,255  ; offset = 1
 03C6 5F4F              sbci R21,255
 03C8                   .dbline 386
 03C8           ;       }
 03C8           L71:
 03C8                   .dbline 381
 03C8 FA01              movw R30,R20
 03CA 2490              lpm R2,Z
 03CC 2220              tst R2
 03CE 89F7              brne L70
 03D0           X19:
 03D0                   .dbline -2
 03D0           L69:
 03D0                   .dbline 0 ; func end
 03D0 2396              adiw R28,3
 03D2 0C940000          xjmp pop_xgsetF00C
 03D6                   .dbsym l Video_Mode 11 c
 03D6                   .dbsym r pString 20 pkc
 03D6                   .dbsym r Y 22 c
 03D6                   .dbsym r X 10 c
 03D6                   .dbend
 03D6                   .dbfunc s LCD_Disp_Chinese_String _LCD_Disp_Chinese_String fV
 03D6           ;             nm -> R10
 03D6           ;             cl -> R22
 03D6           ;     Video_Mode -> y+21
 03D6           ;     pCN_String -> y+19
 03D6           ;       Char_Gap -> y+17
 03D6           ;     Start_Char -> y+15
 03D6           ;    Char_Amount -> y+13
 03D6           ;    Char_Length -> R12
 03D6           ;              Y -> R14
 03D6           ;              X -> R20
                        .even
 03D6           _LCD_Disp_Chinese_String:
 03D6 0E940000          xcall push_xgsetF0FC
 03DA E22E              mov R14,R18
 03DC 402F              mov R20,R16
 03DE 2197              sbiw R28,1
 03E0 CB84              ldd R12,y+11
 03E2                   .dbline -1
 03E2                   .dbline 413
 03E2           ;    }   
 03E2           ; 
 03E2           ; /*----------------------------------------------------------------------------*-
 03E2           ; 
 03E2           ;    LCD_Disp_Chinese_String()
 03E2           ;   
 03E2           ;    Display a Chinese String on the LCD panel.
 03E2           ;   
 03E2           ;    Parameters: 
 03E2           ;    ---------------------------------------------------------------------------
 03E2           ;    X, Y        : The Chinese String start coordinates on the LCD panel
 03E2           ;     
 03E2           ;    Char_Length : The Chinese character's length (in pixel)
 03E2           ;    Char_Amount : The amount of Chinese characters 
 03E2           ;    Start_Char  : Which Chinese character should be display first in the array
 03E2           ;    Char_Gap    : The space between on characters to another (in pixel)
 03E2           ;    
 03E2           ;    Video_Mode  : If Video_Mode == INVERSE(1), inverse video mode                         
 03E2           ;                  If Video_Mode == NORMAL(0), normal video mode

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -