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

📄 1335.lis

📁 AVR单片机
💻 LIS
📖 第 1 页 / 共 5 页
字号:
                        .module _1335.c
                        .area text(rom, con, rel)
 0000                   .dbfile F:\avr\lcdsd1330\1335.c
 0000                   .dbfunc e lcd_delay _lcd_delay fV
 0000           ;              x -> R20,R21
 0000           ;              y -> R22,R23
 0000           ;              i -> R16,R17
                        .even
 0000           _lcd_delay::
 0000 0E940000          xcall push_xgsetF000
 0004                   .dbline -1
 0004                   .dbline 55
 0004           ; 
 0004           ; /*
 0004           ; *******************************************************************************
 0004           ; *
 0004           ; *                                 保定建通制造有限责任公司
 0004           ; *
 0004           ; *                  BAODING JIANTONG ELECTRICAL APPLIANCE MANUFACTURING CO.,LTD.
 0004           ; *
 0004           ; *                  http://www.jtdq.com.cn/
 0004           ; *                  email:jtdq@jtdq.com.cn
 0004           ; *
 0004           ; *文件名称:
 0004           ; *
 0004           ; *包含函数:
 0004           ; *
 0004           ; *函数说明:
 0004           ; *
 0004           ; *
 0004           ; *
 0004           ; *
 0004           ; *
 0004           ; *
 0004           ; *作者:段胜柱     duanshengzhu@126.com
 0004           ; *
 0004           ; *时间:
 0004           ; ***************************************************************************
 0004           ; */ 
 0004           ; 
 0004           ; /***********************************************************************
 0004           ; Content: Graphic library for Epson SED-1335 based LCD displays.
 0004           ; Last modified: 15.05.2003
 0004           ; Copyrights: Free to use, free to change, free to delete :-)
 0004           ; Compiler: ImageCraft AVR
 0004           ; Written by: Knut Baardsen @ Baardsen Software, Norway
 0004           ; Updates: http://www.baso.no
 0004           ; ***********************************************************************/
 0004           ; 
 0004           ; /***********************************************************************
 0004           ; This software is provided "as is"; Without warranties either express or
 0004           ; implied, including any warranty regarding merchantability, fitness for 
 0004           ; a particular purpose or noninfringement. 
 0004           ; In no event shall Baardsen Software or its suppliers be liable for any 
 0004           ; special,indirect,incidential or concequential damages resulting from 
 0004           ; the use or inability to use this software.
 0004           ; ***********************************************************************/
 0004           ; 
 0004           ; #include"global.h"
 0004           ; 
 0004           ; 
 0004           ; 
 0004           ; /***********************************************************************
 0004           ; Makes a delay at approximate 2mS at 8MHz
 0004           ; ***********************************************************************/
 0004           ; void lcd_delay(unsigned int i)
 0004           ; {
 0004                   .dbline 57
 0004           ;   int x ,y;
 0004           ;   for (x = 0; x < i; x++)
 0004 4427              clr R20
 0006 5527              clr R21
 0008 0BC0              xjmp L5
 000A           L2:
 000A                   .dbline 58
 000A           ;   {
 000A                   .dbline 59
 000A           ;      for (y = 0; y <200; y++)
 000A 6627              clr R22
 000C 7727              clr R23
 000E           L6:
 000E                   .dbline 60
 000E           ;      asm("WDR");
 000E A895              WDR
 0010           L7:
 0010                   .dbline 59
 0010 6F5F              subi R22,255  ; offset = 1
 0012 7F4F              sbci R23,255
 0014                   .dbline 59
 0014 683C              cpi R22,200
 0016 E0E0              ldi R30,0
 0018 7E07              cpc R23,R30
 001A CCF3              brlt L6
 001C           X0:
 001C                   .dbline 61
 001C           ;   }
 001C           L3:
 001C                   .dbline 57
 001C 4F5F              subi R20,255  ; offset = 1
 001E 5F4F              sbci R21,255
 0020           L5:
 0020                   .dbline 57
 0020 4017              cp R20,R16
 0022 5107              cpc R21,R17
 0024 90F3              brlo L2
 0026           X1:
 0026                   .dbline -2
 0026           L1:
 0026                   .dbline 0 ; func end
 0026 0C940000          xjmp pop_xgsetF000
 002A                   .dbsym r x 20 I
 002A                   .dbsym r y 22 I
 002A                   .dbsym r i 16 i
 002A                   .dbend
 002A                   .dbfunc e lcd_write_command _lcd_write_command fV
 002A           ;        command -> R16
                        .even
 002A           _lcd_write_command::
 002A                   .dbline -1
 002A                   .dbline 70
 002A           ; }
 002A           ; 
 002A           ; 
 002A           ; /***********************************************************************
 002A           ; Write specified command to LCD panel.
 002A           ; This is an internal function...
 002A           ; ***********************************************************************/
 002A           ; void lcd_write_command(unsigned char command)
 002A           ; {
 002A                   .dbline 71
 002A           ;   LCDDATAPORT = command;
 002A 0BBB              out 0x1b,R16
 002C                   .dbline 72
 002C           ;   LCDCTLPORT |= A0;   
 002C AD9A              sbi 0x15,5
 002E                   .dbline 73
 002E           ;   LCDCTLPORT &= ~(WR);
 002E AC98              cbi 0x15,4
 0030                   .dbline 74
 0030           ;   LCDCTLPORT |= WR;   
 0030 AC9A              sbi 0x15,4
 0032                   .dbline -2
 0032           L10:
 0032                   .dbline 0 ; func end
 0032 0895              ret
 0034                   .dbsym r command 16 c
 0034                   .dbend
 0034                   .dbfunc e lcd_write_data _lcd_write_data fV
 0034           ;           data -> R16
                        .even
 0034           _lcd_write_data::
 0034                   .dbline -1
 0034                   .dbline 83
 0034           ; }
 0034           ; 
 0034           ; 
 0034           ; /***********************************************************************
 0034           ; Write specified data to LCD panel.
 0034           ; This is an internal function...
 0034           ; ***********************************************************************/
 0034           ; void lcd_write_data(unsigned char data)
 0034           ; {
 0034                   .dbline 84
 0034           ;   LCDDATAPORT = data;
 0034 0BBB              out 0x1b,R16
 0036                   .dbline 85
 0036           ;   LCDCTLPORT &= ~(A0);
 0036 AD98              cbi 0x15,5
 0038                   .dbline 86
 0038           ;   LCDCTLPORT &= ~(WR);
 0038 AC98              cbi 0x15,4
 003A                   .dbline 87
 003A           ;   LCDCTLPORT |= WR;   
 003A AC9A              sbi 0x15,4
 003C                   .dbline -2
 003C           L11:
 003C                   .dbline 0 ; func end
 003C 0895              ret
 003E                   .dbsym r data 16 c
 003E                   .dbend
 003E                   .dbfunc e lcd_read_data _lcd_read_data fc
 003E           ;              i -> <dead>
 003E           ;           data -> R16
                        .even
 003E           _lcd_read_data::
 003E                   .dbline -1
 003E                   .dbline 96
 003E           ; }
 003E           ; 
 003E           ; 
 003E           ; /***********************************************************************
 003E           ; Read data from LCD panel at position given by lcd_pixel command.
 003E           ; This is an internal function...
 003E           ; ***********************************************************************/
 003E           ; unsigned char lcd_read_data(void)
 003E           ; {
 003E                   .dbline 99
 003E           ;   unsigned char data;
 003E           ;   int i;
 003E           ;   LCDDATADDR = 0x00;    
 003E 2224              clr R2
 0040 2ABA              out 0x1a,R2
 0042                   .dbline 100
 0042           ;   LCDCTLPORT |= A0;     
 0042 AD9A              sbi 0x15,5
 0044                   .dbline 101
 0044           ;   LCDCTLPORT &= ~(RD);  
 0044 AB98              cbi 0x15,3
 0046                   .dbline 102
 0046           ;   data = LCDDATAPIN;    
 0046 09B3              in R16,0x19
 0048                   .dbline 103
 0048           ;   data = LCDDATAPIN;    
 0048 09B3              in R16,0x19
 004A                   .dbline 104
 004A           ;   data = LCDDATAPIN;    
 004A 09B3              in R16,0x19
 004C                   .dbline 105
 004C           ;   LCDCTLPORT |= RD;     
 004C AB9A              sbi 0x15,3
 004E                   .dbline 106
 004E           ;   LCDDATADDR = 0xff;    
 004E 8FEF              ldi R24,255
 0050 8ABB              out 0x1a,R24
 0052                   .dbline 107
 0052           ;   return data;
 0052                   .dbline -2
 0052           L12:
 0052                   .dbline 0 ; func end
 0052 0895              ret
 0054                   .dbsym l i 1 I
 0054                   .dbsym r data 16 c
 0054                   .dbend
 0054                   .dbfunc e lcd_init _lcd_init fV
 0054           ;              i -> R20,R21
                        .even
 0054           _lcd_init::
 0054 4A93              st -y,R20
 0056 5A93              st -y,R21
 0058                   .dbline -1
 0058                   .dbline 116
 0058           ; }
 0058           ; 
 0058           ; 
 0058           ; /***********************************************************************
 0058           ; Initialize the LCD controller. Read the documentation for the 
 0058           ; controller in use. If any other than SED1335 values can be wrong ! 
 0058           ; ***********************************************************************/
 0058           ; void lcd_init(void)
 0058           ; {
 0058                   .dbline 119
 0058           ;   int i;
 0058           ;   // Setup LCD Data bus port as output
 0058           ;   LCDDATAPORT  = 0xff;
 0058 8FEF              ldi R24,255
 005A 8BBB              out 0x1b,R24
 005C                   .dbline 120
 005C           ;   LCDDATADDR   = 0xff; 
 005C 8ABB              out 0x1a,R24
 005E                   .dbline 123
 005E           ;    
 005E           ;   // Setup LCD control bus port as output
 005E           ;   LCDCTLDDR |= 0xff; 
 005E 84B3              in R24,0x14
 0060 8F6F              ori R24,255
 0062 84BB              out 0x14,R24
 0064                   .dbline 124
 0064           ;   LCDCTLPORT = 0xff;
 0064 8FEF              ldi R24,255
 0066 85BB              out 0x15,R24
 0068                   .dbline 125
 0068           ;   LCDCTLPORT = LCDCTLPORT&CSEL;
 0068 85B3              in R24,0x15
 006A 8F77              andi R24,127
 006C 85BB              out 0x15,R24
 006E                   .dbline 128
 006E           ; 
 006E           ;           
 006E           ;   LCDCTLPORT |= WR;           
 006E AC9A              sbi 0x15,4
 0070                   .dbline 129
 0070           ;   LCDCTLPORT |= RD;           
 0070 AB9A              sbi 0x15,3
 0072                   .dbline 131
 0072           ;   // Reset the LCD
 0072           ;   LCDCTLPORT |= RST;
 0072 AE9A              sbi 0x15,6
 0074                   .dbline 132
 0074           ;   lcd_delay(5);
 0074 05E0              ldi R16,5
 0076 10E0              ldi R17,0
 0078 C3DF              xcall _lcd_delay
 007A                   .dbline 133
 007A           ;   LCDCTLPORT &= ~RST;
 007A AE98              cbi 0x15,6
 007C                   .dbline 134
 007C           ;   for (i=0; i<50; i++) lcd_delay(5);
 007C 4427              clr R20
 007E 5527              clr R21
 0080           L14:
 0080                   .dbline 134
 0080 05E0              ldi R16,5
 0082 10E0              ldi R17,0
 0084 BDDF              xcall _lcd_delay
 0086           L15:
 0086                   .dbline 134
 0086 4F5F              subi R20,255  ; offset = 1
 0088 5F4F              sbci R21,255
 008A                   .dbline 134
 008A 4233              cpi R20,50
 008C E0E0              ldi R30,0
 008E 5E07              cpc R21,R30
 0090 BCF3              brlt L14
 0092           X2:
 0092                   .dbline 135
 0092           ;   LCDCTLPORT |= RST; 
 0092 AE9A              sbi 0x15,6
 0094                   .dbline 139
 0094           ;   
 0094           ;  
 0094           ;   // System
 0094           ;   lcd_write_command(0x40); 
 0094 00E4              ldi R16,64
 0096 C9DF              xcall _lcd_write_command
 0098                   .dbline 140
 0098           ;   lcd_write_data(0x30);////////////////////////////P1   0  0 B 1 WS M2 M1 M0
 0098 00E3              ldi R16,48
 009A CCDF              xcall _lcd_write_data
 009C                   .dbline 141

⌨️ 快捷键说明

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