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

📄 12864zk.lst

📁 这是液晶的操作源代码,希望对做这个工作的朋友有一定的帮助
💻 LST
📖 第 1 页 / 共 3 页
字号:
*** ERROR C202 IN LINE 129 OF 12864ZK.C: 'dat': undefined identifier
 130   2                              }
 131   1                      SDA_12864 = 0;
*** ERROR C202 IN LINE 131 OF 12864ZK.C: 'SDA_12864': undefined identifier
 132   1                      for(i=0;i<4;i++)        //四个空闲脉冲
*** ERROR C202 IN LINE 132 OF 12864ZK.C: 'i': undefined identifier
 133   1                              {       
 134   2                                      SCK_12864 = 1;                          
*** ERROR C202 IN LINE 134 OF 12864ZK.C: 'SCK_12864': undefined identifier
 135   2                                      SCK_12864 = 0;
*** ERROR C202 IN LINE 135 OF 12864ZK.C: 'SCK_12864': undefined identifier
 136   2                              }
 137   1                      CS_12864  = 0;
*** ERROR C202 IN LINE 137 OF 12864ZK.C: 'CS_12864': undefined identifier
 138   1                      SDA_12864 = 1;
*** ERROR C202 IN LINE 138 OF 12864ZK.C: 'SDA_12864': undefined identifier
 139   1                                              
 140   1              } 
 141          
 142          /*******************************************
 143          * 函数功能 :LCD串行写字节数据
 144          * 入口参数 : (uchar dat)
 145          * 占用资源 : (void)
 146          * 返回参数 : (void)
 147          * 操作时间 : 72us
 148          ********************************************/
 149          void    Lcd_Write_Dat(uchar     formal_dat)
*** ERROR C141 IN LINE 149 OF 12864ZK.C: syntax error near 'formal_dat', expected ')'
 150                  {
 151   1                       Lcd_Write_DI(formal_dat,DAT);
*** ERROR C202 IN LINE 151 OF 12864ZK.C: 'formal_dat': undefined identifier
 152   1                       Delay_10us(8);//延时80us
 153   1              }
 154          /*******************************************
 155          * 函数功能 :LCD串行写字节命令
 156          * 入口参数 : (uchar com)
 157          * 占用资源 : (void)
 158          * 返回参数 : (void)
 159          * 操作时间 : 72us
 160          ********************************************/
 161          void    Lcd_Write_Command(uchar f_com) 
 162                  {
 163   1                       Lcd_Write_DI(f_com,INST);
 164   1                       Delay_10us(8);//延时80us
 165   1              }
 166          
 167          #endif
 168          
 169          /*****************基本指令集******************/ 
 170          #define Basic_Instruction_Enable        
 171          //--------------------------------
 172          #ifdef  Basic_Instruction_Enable
 173          //--------------------------------
 174          
 175          /*******************************************
 176          * 函数功能 :LCD功能设定
 177          * 入口参数 : (void)
 178          * 占用资源 : (void)
 179          * 返回参数 : (void)
 180          * 说明     :
 181                                  功能设定(36H/30H/34H) 0 0 1 1 X  RE G 0 
C51 COMPILER V8.02   12864ZK                                                               01/01/2000 10:44:02 PAGE 5   

 182                                  RE=1: 扩充指令集动作,RE=0: 基本指令集动作,
 183                                  G=1 :绘图显示ON ,G=0 :绘图显示OFF
 184          ********************************************/
 185          #define         Basic_Instruction_Com           0x30                    //精简指令
 186          #define         Expand_Instruction_Com          0x34                    //扩充指令
 187          #define         GraphRAM_On_Com                         0x36                    //绘图功能开
 188          //---------------------------------------       
 189          static void     Function_Setting(void)
 190                  {
 191   1                       Lcd_Write_Command(Basic_Instruction_Com);              //8bits format,basic instruction set,graph function disable.
 192   1                       Lcd_Write_Command(Basic_Instruction_Com);
 193   1              } 
 194          /*******************************************
 195          * 函数功能 :LCD显示与游标开关
 196          * 入口参数 : (void)
 197          * 占用资源 : (void)
 198          * 返回参数 : (void)
 199          * 说明     :
 200                                  显示状态 开/关(08H/0CH/0EH/0FH)
 201                                  L L L L L L H D C B
 202                                  D=1;整体显示ON C=1;游标ON B=1;游标位置ON
 203          ********************************************/ 
 204          #define All_On_Com                                      0x0f
 205          #define Display_On_Only_Com                     0x0c
 206          #define Display_On_Cursor_On_Com        0x0e
 207          #define All_Off_Com                                     0x08
 208          //--------------------------------------
 209          void    NoniusOn(void)
 210                  {
 211   1                      Lcd_Write_Command(Basic_Instruction_Com);
 212   1                      Lcd_Write_Command(All_On_Com);
 213   1              }
 214          //---------------------------------------
 215          void    NoniusOff(void)
 216                  {
 217   1                      Lcd_Write_Command(Basic_Instruction_Com);
 218   1                      Lcd_Write_Command(Display_On_Only_Com);
 219   1              }
 220          /*******************************************
 221          * 函数功能 :LCD状态设置
 222          * 入口参数 : (void)
 223          * 占用资源 : (void)
 224          * 返回参数 : (void)
 225          * 说明     :
 226          ********************************************/
 227          //---------------------------------------
 228          static void     Display_State(void)
 229                  {
 230   1                      NoniusOff();            //display enable,cursor off,cursor position off.
 231   1              }
 232          /*******************************************
 233          * 函数功能 :LCD设置光标及移动方向
 234          * 入口参数 : (void)
 235          * 占用资源 : (void)
 236          * 返回参数 : (void)
 237          * 说明     :
 238                                  点设定(07H/04H/05H/06H)
 239                                  L L L L L L L H I/D S
 240                                  I/D=1 光标右移,I/D=0 光标左移。
 241                                  SH=1 且DDRAM 为写状态:整体显示移动,
 242                                  方向由I/D 决定(I/D=1 左移,I/D=0 右移)
 243                                  SH=0 或DDRAM 为读状态:整体显示不移动
C51 COMPILER V8.02   12864ZK                                                               01/01/2000 10:44:02 PAGE 6   

 244          ********************************************/
 245          #define Cursor_Right_No_Move_Com                0x06
 246          #define Cursor_Right_Move_Left_Com              0x07
 247          #define Cursor_Left_No_Move_Com                 0x04
 248          #define Cursor_Left_Move_Right_Com              0x05
 249          //---------------------------------------       
 250          static void     Entry_Mode(void)
 251                  {       
 252   1                      Lcd_Write_Command(Basic_Instruction_Com);
 253   1                      Lcd_Write_Command(Cursor_Right_No_Move_Com);
 254   1              } 
 255          /*******************************************
 256          * 函数功能 :LCD清屏
 257          * 入口参数 : (void)
 258          * 占用资源 : (void)
 259          * 返回参数 : (void)
 260          * 操作时间 : 4.2ms
 261          ********************************************/
 262          void    DisplayClear(void)
 263                  {
 264   1                      Lcd_Write_Command(Basic_Instruction_Com);
 265   1                      Lcd_Write_Command(0x01);
 266   1                      #ifdef  Series_Operation_Mode
 267   1                      Delay_ms(5);//延时5ms
 268   1                      #endif
 269   1              }
 270          /*******************************************
 271          * 函数功能 :LCD设置XY地址
 272          * 入口参数 : (uchar x,uchar y)
 273          * 占用资源 : (void)
 274          * 返回参数 : (void)
 275          * 说明     :
 276          ********************************************/
 277          
 278          void    GotoXY(uchar fx,uchar fy)
 279                  {
 280   1                      uchar   x,y,xy;
 281   1                      Lcd_Write_Command(Basic_Instruction_Com);
 282   1                      x       =       fx;
 283   1                      y       =       fy;
 284   1                      x       &=      0x07;
 285   1                      y       &=      0x03;
 286   1      //xy coordinate is 0x80 in line 0,0x90 in line 1,0x88 in line 2,0x98 ine line 3.
 287   1                      if(y==0)                                xy=0x80;
 288   1                              else    if(y==1)        xy=0x90;
 289   1                              else    if(y==2)        xy=0x88;
 290   1                              else    if(y==3)        xy=0x98;
 291   1                              else    xy=0x80;
 292   1                      xy      +=      x;              
 293   1                      Lcd_Write_Command(xy);
 294   1              }
 295          /*******************************************
 296          * 函数功能 :LCD数据串输出
 297          * 入口参数 : (uchar x,uchar y,uchar *str)
 298          * 占用资源 : (void)
 299          * 返回参数 : (void)
 300          * 说明     :
 301          ********************************************/
 302          
 303          void    Print(uchar x,uchar y,uchar *str)
 304                  {       
 305   1                      uchar   i=0;
C51 COMPILER V8.02   12864ZK                                                               01/01/2000 10:44:02 PAGE 7   

 306   1                      GotoXY(x,y);                            
 307   1                      Lcd_Write_Command(Basic_Instruction_Com);
 308   1                      while(((*str)!='\0')&&(i<16))   
 309   1                      {

⌨️ 快捷键说明

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