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

📄 ks0108.lst

📁 LCD12864的嵌入式C程序 很有参考价值!
💻 LST
📖 第 1 页 / 共 3 页
字号:
 205   3                      }
 206   2              }
 207   1      
 208   1              for(i=0;i<8;i++)
 209   1              {
 210   2                      OutTI(0xb8|i);  
 211   2                      for(j=0;j<64;j++)
 212   2                      {
 213   3                              OutTI(j|0x40);
 214   3                              OutTD(0);
 215   3                      }
 216   2              }
 217   1      }
 218          
 219          /*------------------------------------------------------------------------------
 220          --
 221          Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3;
 222          Width is the large Chinese ideograph width;bmp is the table's name 
 223          --------------------------------------------------------------------------------
 224          -*/
 225          void DrawBmp_large_char(uchar x_add,uchar layer,uchar width,uchar *bmp)
 226          { 
 227   1              unsigned char x;
 228   1              unsigned int i=0;
 229   1      
 230   1          for(x=x_add;x<x_add+width;x++)
 231   1          {
 232   2              if (x>127)                                                      /*The Third KS0108*/
 233   2              {
 234   3                              OutTI((x-128)|0x40);                    /*Set the x address*/
 235   3                              OutTI(layer|0xb8);                              /*Set the y address*/
 236   3                              OutTD(bmp[i]);                                  /*Send thd data to LCD ram*/
 237   3      
 238   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 239   3                              OutTI((layer|0xb8)+1);  
 240   3                              i++;                                                    /*Display zimo table address add 1*/
 241   3                              OutTD(bmp[i]);
C51 COMPILER V7.50   KS0108                                                                11/23/2005 17:17:07 PAGE 5   

 242   3      
 243   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 244   3                              OutTI((layer|0xb8)+2);  
 245   3                              i++;                                                    /*Display zimo table address add 1*/
 246   3                              OutTD(bmp[i]);
 247   3      
 248   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 249   3                              OutTI((layer|0xb8)+3);  
 250   3                              i++;                                                    /*Display zimo table address add 1*/
 251   3                              OutTD(bmp[i]);
 252   3                      }
 253   2              else if (x>63)                                          /*The Second ks0108*/                                  
 254   2              {
 255   3                              OutSI((x-64)|0x40);
 256   3                              OutSI(layer|0xb8);
 257   3                              OutSD(bmp[i]);
 258   3                      
 259   3                              OutSI((x-64)|0x40);
 260   3                              OutSI((layer|0xb8)+1);  
 261   3                              i++;
 262   3                              OutSD(bmp[i]);
 263   3      
 264   3                              OutSI((x-64)|0x40);
 265   3                              OutSI((layer|0xb8)+2);  
 266   3                              i++;
 267   3                              OutSD(bmp[i]);
 268   3      
 269   3                              OutSI((x-64)|0x40);
 270   3                              OutSI((layer|0xb8)+3);  
 271   3                              i++;
 272   3                              OutSD(bmp[i]);
 273   3                      }
 274   2      
 275   2                      else                                                            /*The First ks0108*/
 276   2                      {
 277   3                              OutFI(x|0x40);
 278   3                              OutFI(layer|0xb8);
 279   3                              OutFD(bmp[i]);
 280   3      
 281   3                              OutFI(x|0x40);
 282   3                              OutFI((layer|0xb8)+1);  
 283   3                              i++;                                                    
 284   3                              OutFD(bmp[i]);
 285   3      
 286   3                              OutFI(x|0x40);
 287   3                              OutFI((layer|0xb8)+2);  
 288   3                              i++;                                                    
 289   3                              OutFD(bmp[i]);
 290   3      
 291   3                              OutFI(x|0x40);
 292   3                              OutFI((layer|0xb8)+3);  
 293   3                              i++;                                                    
 294   3                              OutFD(bmp[i]);
 295   3      
 296   3                      }
 297   2              i++;
 298   2      
 299   2              }
 300   1      }
 301          
 302          /*------------------------------------------------------------------------------
 303          --
C51 COMPILER V7.50   KS0108                                                                11/23/2005 17:17:07 PAGE 6   

 304          Display indention; x_add is the x address;It has 4 layers,0,1,2,3;
 305          Width is the Chinese ideograph width
 306          --------------------------------------------------------------------------------
 307          --*/
 308          void _DrawBmp_large_(uchar x_add,uchar layer,uchar width)
 309          { 
 310   1              unsigned char x;
 311   1              unsigned int i=0;
 312   1      
 313   1          for(x=x_add;x<x_add+width;x++)
 314   1          {
 315   2              if (x>127)                                                      /*The Third KS0108*/
 316   2              {
 317   3                              OutTI((x-128)|0x40);                    /*Set the x address*/
 318   3                              OutTI(layer|0xb8);                              /*Set the y address*/
 319   3                              OutTD(0);                                               /*Send thd data to LCD ram*/
 320   3      
 321   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 322   3                              OutTI((layer|0xb8)+1);  
 323   3                              i++;                                                    /*Display zimo table address add 1*/
 324   3                              OutTD(0);
 325   3      
 326   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 327   3                              OutTI((layer|0xb8)+2);  
 328   3                              i++;                                                    /*Display zimo table address add 1*/
 329   3                              OutTD(0);
 330   3      
 331   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 332   3                              OutTI((layer|0xb8)+3);  
 333   3                              i++;                                                    /*Display zimo table address add 1*/
 334   3                              OutTD(0);
 335   3                      }
 336   2              else if (x>63)                                          /*The Second ks0108*/                                  
 337   2              {
 338   3                              OutSI((x-64)|0x40);
 339   3                              OutSI(layer|0xb8);
 340   3                              OutSD(0);
 341   3                      
 342   3                              OutSI((x-64)|0x40);
 343   3                              OutSI((layer|0xb8)+1);  
 344   3                              i++;
 345   3                              OutSD(0);
 346   3      
 347   3                              OutSI((x-64)|0x40);
 348   3                              OutSI((layer|0xb8)+2);  
 349   3                              i++;
 350   3                              OutSD(0);
 351   3      
 352   3                              OutSI((x-64)|0x40);
 353   3                              OutSI((layer|0xb8)+3);  
 354   3                              i++;
 355   3                              OutSD(0);
 356   3                      }
 357   2      
 358   2                      else                                                            /*The First ks0108*/
 359   2                      {
 360   3                              OutFI(x|0x40);
 361   3                              OutFI(layer|0xb8);
 362   3                              OutFD(0);
 363   3      
 364   3                              OutFI(x|0x40);
 365   3                              OutFI((layer|0xb8)+1);  
C51 COMPILER V7.50   KS0108                                                                11/23/2005 17:17:07 PAGE 7   

 366   3                              i++;                                                    
 367   3                              OutFD(0);
 368   3      
 369   3                              OutFI(x|0x40);
 370   3                              OutFI((layer|0xb8)+2);  
 371   3                              i++;                                                    
 372   3                              OutFD(0);
 373   3      
 374   3                              OutFI(x|0x40);
 375   3                              OutFI((layer|0xb8)+3);  
 376   3                              i++;                                                    
 377   3                              OutFD(0);
 378   3      
 379   3                      }
 380   2              i++;
 381   2      
 382   2              }
 383   1      }
 384          
 385          /*------------------------------------------------------------------------------
 386          --
 387          Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3;
 388          Width is the Chinese ideograph width;bmp is the table's name 
 389          --------------------------------------------------------------------------------
 390          -*/
 391          void DrawBmp(uchar x_add,uchar layer,uchar width,uchar *bmp)
 392          { 
 393   1              unsigned char x;
 394   1              unsigned int i=0;
 395   1              
 396   1          for(x=x_add;x<x_add+width;x++)
 397   1          {
 398   2              if (x>127)                                                      /*The Third KS0108*/
 399   2              {
 400   3                              OutTI((x-128)|0x40);                    /*Set the x address*/
 401   3                              OutTI(layer|0xb8);                              /*Set the y address*/
 402   3                              OutTD(bmp[i]);                                  /*Send thd data to LCD ram*/
 403   3      
 404   3                              OutTI((x-128)|0x40);                    /*Display the down screen*/
 405   3                              OutTI((layer|0xb8)+1);  
 406   3                              i++;                                                    /*Display zimo table address add 1*/
 407   3                              OutTD(bmp[i]);
 408   3                      }
 409   2              else if (x>63)                                          /*The Second ks0108*/                                  
 410   2              {
 411   3                              OutSI((x-64)|0x40);
 412   3                              OutSI(layer|0xb8);
 413   3                              OutSD(bmp[i]);
 414   3                      
 415   3                              OutSI((x-64)|0x40);
 416   3                              OutSI((layer|0xb8)+1);  
 417   3                              i++;

⌨️ 快捷键说明

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