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

📄 access.lst

📁 keil c51平台,此代码可用于学习TFT LCD 之TCON,SCALER,OSD,(本人自己修改)
💻 LST
📖 第 1 页 / 共 2 页
字号:
 276   3      
 277   3                  array   = array + 2;
 278   3                  m       = array[0];
 279   3      
 280   3                  do
 281   3                  {
 282   4                      RTDSendByte(m);
 283   4                  }
 284   3                  while (--len);
 285   3      
 286   3                  array   = array + 1;
 287   3              }
 288   2              else
 289   2              {
 290   3                  RTDSendAddr(array[1], 0, array[0]);
 291   3      
 292   3                  array   = array + 2;
 293   3                  do
 294   3                  {
 295   4                      RTDSendByte(*array++);
 296   4                  }
 297   3                  while (--len);
 298   3              }
 299   2      
 300   2              bRTD_SCLK   = 0;
 301   2              bRTD_SCLK   = 1;
 302   2              bRTD_SCSB   = 1;
C51 COMPILER V7.50   ACCESS                                                                07/28/2008 16:10:58 PAGE 6   

 303   2          }
 304   1          while (1);
 305   1      }
 306          
 307          void RTDCodeW(unsigned char code *array)
 308          {
 309   1          unsigned char   len, m;
 310   1          do
 311   1          {
 312   2              if (0 == (array[0] & 0xfc))     return;
 313   2      
 314   2              len     = array[0] - 3;
 315   2              array   = array + 1;
 316   2      
 317   2              bRTD_SCSB   = 0;
 318   2      
 319   2              if (BURST == array[0])
 320   2              {
 321   3                  RTDSendAddr(array[1], 0, N_INC);
 322   3      
 323   3                  array   = array + 2;
 324   3                  m       = array[0];
 325   3                  
 326   3                  do
 327   3                  {
 328   4                      RTDSendByte(m);
 329   4                  }
 330   3                  while (--len);
 331   3      
 332   3                  array   = array + 1;
 333   3              }
 334   2              else
 335   2              {
 336   3                  RTDSendAddr(array[1], 0, array[0]);
 337   3      
 338   3                  array   = array + 2;
 339   3                  do
 340   3                  {
 341   4                      RTDSendByte(*array++);
 342   4                  }
 343   3                  while (--len);
 344   3              }
 345   2      
 346   2              bRTD_SCLK   = 0;
 347   2              bRTD_SCLK   = 1;
 348   2              bRTD_SCSB   = 1;
 349   2          }
 350   1          while (1);
 351   1      }
 352          
 353          
 354          void RTDSetByte(unsigned char addr, unsigned char val)
 355          {
 356   1          // Set Write Address
 357   1          bRTD_SCSB   = 0;   
 358   1          RTDSendAddr(addr, 0, 1);
 359   1      
 360   1          // Write one Byte
 361   1          RTDSendByte(val);
 362   1      
 363   1          bRTD_SCLK   = 0; 
 364   1          bRTD_SCLK   = 1;
C51 COMPILER V7.50   ACCESS                                                                07/28/2008 16:10:58 PAGE 7   

 365   1          bRTD_SCSB   = 1;
 366   1      }
 367          
 368          void RTDSetBit(unsigned char addr, unsigned char and, unsigned char or)
 369          {
 370   1          // Set Read Address
 371   1          bRTD_SCSB   = 0;
 372   1          RTDSendAddr(addr, 1, 1);
 373   1      
 374   1          // Read 1 Byte
 375   1          or      = (RTDGetByte() & and) | or;
 376   1      
 377   1          bRTD_SCLK   = 0;
 378   1          bRTD_SCLK   = 1; 
 379   1          bRTD_SCSB   = 1;  
 380   1      
 381   1          // Set Write Address
 382   1          bRTD_SCSB   = 0;   
 383   1          RTDSendAddr(addr, 0, 1);
 384   1      
 385   1          // Write one Byte
 386   1          RTDSendByte(or);
 387   1      
 388   1          bRTD_SCLK   = 0; 
 389   1          bRTD_SCLK   = 1;
 390   1          bRTD_SCSB   = 1;
 391   1      
 392   1      }
 393          
 394          void Load_Font(unsigned char code *array, unsigned char start, unsigned char end)
 395          {
 396   1          unsigned char   n, ucTemp;
 397   1      
 398   1          do
 399   1          {
 400   2              bRTD_SCSB   = 0;   
 401   2              RTDSendAddr(OSD_ROW_90, WRITE, Y_INC);
 402   2              RTDSendByte(0xc0);
 403   2      
 404   2      #if (SWAP_FONT_RAM)
                      RTDSendByte(start ^ 0x20);
              #else
 407   2              RTDSendByte(start);
 408   2      #endif
 409   2      
 410   2              bRTD_SCLK   = 0; 
 411   2              bRTD_SCLK   = 1;
 412   2              bRTD_SCSB   = 1;
 413   2              bRTD_SCSB   = 0;   
 414   2              RTDSendAddr(OSD_DATA_92, WRITE, N_INC);
 415   2      
 416   2              n   = 36;  
 417   2              do
 418   2              {
 419   3                  ucTemp  = *array;
 420   3      
 421   3                  bRTD_SDI    = (bit)(ucTemp & 0x01);
 422   3                  bRTD_SCLK   = 1;
 423   3                  bRTD_SCLK   = 0;
 424   3                  bRTD_SDI    = (bit)(ucTemp & 0x02);
 425   3                  bRTD_SCLK   = 1;
 426   3                  bRTD_SCLK   = 0;
C51 COMPILER V7.50   ACCESS                                                                07/28/2008 16:10:58 PAGE 8   

 427   3                  bRTD_SDI    = (bit)(ucTemp & 0x04);
 428   3                  bRTD_SCLK   = 1;
 429   3                  bRTD_SCLK   = 0;
 430   3                  bRTD_SDI    = (bit)(ucTemp & 0x08);
 431   3                  bRTD_SCLK   = 1;
 432   3                  bRTD_SCLK   = 0;
 433   3                  bRTD_SDI    = (bit)(ucTemp & 0x10);
 434   3                  bRTD_SCLK   = 1;
 435   3                  bRTD_SCLK   = 0;
 436   3                  bRTD_SDI    = (bit)(ucTemp & 0x20);
 437   3                  bRTD_SCLK   = 1;
 438   3                  bRTD_SCLK   = 0;
 439   3                  bRTD_SDI    = (bit)(ucTemp & 0x40);
 440   3                  bRTD_SCLK   = 1;
 441   3                  bRTD_SCLK   = 0;
 442   3                  bRTD_SDI    = (bit)(ucTemp & 0x80);
 443   3                  bRTD_SCLK   = 1;
 444   3                  bRTD_SCLK   = 0;
 445   3                  bRTD_SDI    = 1;
 446   3                  bRTD_SCLK   = 1;
 447   3      
 448   3                  array ++;
 449   3              }
 450   2              while (--n);
 451   2      
 452   2              bRTD_SCLK   = 0; 
 453   2              bRTD_SCLK   = 1;
 454   2              bRTD_SCSB   = 1;
 455   2          }
 456   1          while (end != start++);
 457   1      
 458   1      }
 459          
 460          
 461          #if(HDCP_ENABLE)
              void KEYCodeW(unsigned char code *array)
              {
                  unsigned int m;  
              
                 RTDSetBit(DVI_CTRL1_AF, 0x7f,0x00);  //Reset the HDCP key download index
                 RTDSetBit(DVI_CTRL1_AF, 0x7f,0x80);
                      
                  for(m = 0; m < 320; m++)   //Key 0 ~ Key39   
                  {
                              RTDSetByte(0xb1,array[m]);
                  }   
              
                  RTDSetBit(DVI_CTRL1_AF, 0x7f,0x00);  //Disable the Key Access Download port
                  RTDSetBit(TMDS_INPUT_ENA_A1, 0x7f, 0x00);   // Turn on HDCP DDC channel  
              }
              #endif
 478          
 479          
 480          #if (AUDIO_TYPE == AUDIO_62429)
              void I2CWrite2(unsigned char send)
              {
                  unsigned char   m;
              
              
                  if ( send > 0x57)        send = 0x57;
              
                  send    = (send >> 2 & 0x1f) | (send << 5 & 0x60);
C51 COMPILER V7.50   ACCESS                                                                07/28/2008 16:10:58 PAGE 9   

              
                  bA_SCL    = 0;
                  BitDly();
              
                  bA_SDA    = 1;
                  BitDly();
                  bA_SCL    = 1;              //D0
                  BitDly();
                  bA_SDA    = 0;
                  BitDly();
                  bA_SCL    = 0;
                  BitDly();
                      
                  bA_SDA    = 0;
                  BitDly();
                  bA_SCL    = 1;              //D1
                  BitDly();
                  bA_SDA    = 0;
                  BitDly();
                  bA_SCL    = 0;
                  BitDly();
              
                  for (m = 0; m < 7; m++)
                  {
                      bA_SDA    = (bit)(send & 0x01);   // Send D2~D8, LSB first
                      BitDly();
                      bA_SCL    = 1;
                      BitDly();
                      bA_SDA    = 0;
                      BitDly();       
                      bA_SCL    = 0;
                      BitDly();
                      
                      send    = send >> 1;
                  }
              
                  bA_SDA    = 1;
                  BitDly();
                  bA_SCL    = 1;              //D9
                  BitDly();
                  bA_SDA    = 0;
                  BitDly();       
                  bA_SCL    = 0;
                  BitDly();
                      
                  bA_SDA    = 1;
                  BitDly();
                  bA_SCL    = 1;              //D10
                  BitDly();
                  bA_SCL    = 0;    
                  BitDly();
                  bA_SDA    = 0;
              
              } 
              #endif


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    828    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
C51 COMPILER V7.50   ACCESS                                                                07/28/2008 16:10:58 PAGE 10  

   DATA SIZE        =     17      12
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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