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

📄 hdc1600.lst

📁 Display driver for Hyvix HDC1600 LCD controller in Keil C for 8051
💻 LST
📖 第 1 页 / 共 3 页
字号:
 222   1              cDispWrCmd(71+p);
 223   1              cDispWrCmd(74+p);
 224   1      
 225   1              cDispWrCmd(77+p);
 226   1              cDispWrCmd(80+p);
 227   1              cDispWrCmd(83+p);
 228   1              cDispWrCmd(86+p);
 229   1              cDispWrCmd(89+p);
 230   1              cDispWrCmd(92+p);
 231   1              cDispWrCmd(95+p);
 232   1              cDispWrCmd(99+p);
 233   1              cDispWrCmd(103+p);
 234   1              cDispWrCmd(109+p);
 235   1      
 236   1              cDispWrCmd(117+p);
 237   1              cDispWrCmd(127);
 238   1      
 239   1      // BLUE
C51 COMPILER V7.09   HDC1600                                                               08/24/2007 15:55:02 PAGE 5   

 240   1              p = PALETTE_BLUE;
 241   1              cDispWrCmd(BLUE_PALETTE_SET);
 242   1              cDispWrCmd(0);
 243   1              cDispWrCmd(10+p);
 244   1              cDispWrCmd(18+p);
 245   1              cDispWrCmd(24+p);
 246   1              cDispWrCmd(28+p);
 247   1              cDispWrCmd(32+p);
 248   1              cDispWrCmd(35+p);
 249   1              cDispWrCmd(38+p);
 250   1              cDispWrCmd(41+p);
 251   1              cDispWrCmd(44+p);
 252   1      
 253   1              cDispWrCmd(47+p);
 254   1              cDispWrCmd(50+p);
 255   1              cDispWrCmd(53+p);
 256   1              cDispWrCmd(56+p);
 257   1              cDispWrCmd(59+p);
 258   1              cDispWrCmd(62+p);
 259   1              cDispWrCmd(65+p);
 260   1              cDispWrCmd(68+p);
 261   1              cDispWrCmd(71+p);
 262   1              cDispWrCmd(74+p);
 263   1      
 264   1              cDispWrCmd(77+p);
 265   1              cDispWrCmd(80+p);
 266   1              cDispWrCmd(83+p);
 267   1              cDispWrCmd(86+p);
 268   1              cDispWrCmd(89+p);
 269   1              cDispWrCmd(92+p);
 270   1              cDispWrCmd(95+p);
 271   1              cDispWrCmd(99+p);
 272   1              cDispWrCmd(103+p);
 273   1              cDispWrCmd(109+p);
 274   1      
 275   1              cDispWrCmd(117+p);
 276   1              cDispWrCmd(127);
 277   1      
 278   1      // GREEN
 279   1              p = PALETTE_GREEN;
 280   1              cDispWrCmd(GREEN_PALETTE_SET);
 281   1              cDispWrCmd(0);
 282   1              cDispWrCmd(5+p);
 283   1              cDispWrCmd(10+p);
 284   1              cDispWrCmd(14+p);
 285   1              cDispWrCmd(18+p);
 286   1              cDispWrCmd(21+p);
 287   1              cDispWrCmd(24+p);
 288   1              cDispWrCmd(26+p);
 289   1              cDispWrCmd(28+p);
 290   1              cDispWrCmd(30+p);
 291   1      
 292   1              cDispWrCmd(32+p);
 293   1              cDispWrCmd(34+p);
 294   1              cDispWrCmd(35+p);
 295   1              cDispWrCmd(37+p);
 296   1              cDispWrCmd(38+p);
 297   1              cDispWrCmd(40+p);
 298   1              cDispWrCmd(41+p);
 299   1              cDispWrCmd(43+p);
 300   1              cDispWrCmd(44+p);
 301   1              cDispWrCmd(46+p);
C51 COMPILER V7.09   HDC1600                                                               08/24/2007 15:55:02 PAGE 6   

 302   1      
 303   1              cDispWrCmd(47+p);
 304   1              cDispWrCmd(49+p);
 305   1              cDispWrCmd(50+p);
 306   1              cDispWrCmd(52+p);
 307   1              cDispWrCmd(53+p);
 308   1              cDispWrCmd(55+p);
 309   1              cDispWrCmd(56+p);
 310   1              cDispWrCmd(58+p);
 311   1              cDispWrCmd(59+p);
 312   1              cDispWrCmd(61+p);
 313   1      
 314   1              cDispWrCmd(62+p);
 315   1              cDispWrCmd(63+p);
 316   1              cDispWrCmd(64+p);
 317   1              cDispWrCmd(65+p);
 318   1              cDispWrCmd(67+p);
 319   1              cDispWrCmd(68+p);
 320   1              cDispWrCmd(70+p);
 321   1              cDispWrCmd(71+p);
 322   1              cDispWrCmd(73+p);
 323   1              cDispWrCmd(74+p);
 324   1      
 325   1              cDispWrCmd(76+p);
 326   1              cDispWrCmd(77+p);
 327   1              cDispWrCmd(79+p);
 328   1              cDispWrCmd(80+p);
 329   1              cDispWrCmd(82+p);
 330   1              cDispWrCmd(83+p);
 331   1              cDispWrCmd(85+p);
 332   1              cDispWrCmd(86+p);
 333   1              cDispWrCmd(88+p);
 334   1              cDispWrCmd(89+p);
 335   1      
 336   1              cDispWrCmd(91+p);
 337   1              cDispWrCmd(92+p);
 338   1              cDispWrCmd(94+p);
 339   1              cDispWrCmd(95+p);
 340   1              cDispWrCmd(97+p);
 341   1              cDispWrCmd(99+p);
 342   1              cDispWrCmd(101+p);
 343   1              cDispWrCmd(103+p);
 344   1              cDispWrCmd(106+p);
 345   1              cDispWrCmd(109+p);
 346   1              cDispWrCmd(113+p);
 347   1              cDispWrCmd(117+p);
 348   1              cDispWrCmd(121+p); 
 349   1              cDispWrCmd(127);
 350   1      
 351   1      */
 352   1              cDispWrCmd(DISPLAY_ON); 
 353   1      }
 354          
 355          
 356          /*
 357          *********************************************************************************************************
 358          *                                                       DISPLAY ON/OFF SWITCH
 359          *
 360          * Description : This function turns display ON/OFF by writing the command DISPLAY_ON / DISPLAY_OFF
 361          * Arguments   : (BOOLEAN) 'sw'          ENABLE for turning ON defined under hdc1600.h
 362          *                                                                       DISABLE for turning OFF defined under hdc1600.h
 363          *                               
C51 COMPILER V7.09   HDC1600                                                               08/24/2007 15:55:02 PAGE 7   

 364          * Returns     : none
 365          * Notes           : Internal status and display RAM data not changed by switching between ON and OFF
 366          *********************************************************************************************************
 367          */
 368          void cDispSwitch(BOOLEAN sw)
 369          {
 370   1              (sw==ENABLE)? cDispWrCmd(DISPLAY_ON):cDispWrCmd(DISPLAY_OFF);
 371   1      }
 372          
 373          /*
 374          *********************************************************************************************************
 375          *                               CLEAR DISPLAY BY WRITING PURE COLOR TO THE WHOLE SCREEN
 376          *
 377          * Description : This function writes a fixed int to all pixels making use of the automatic
 378          *                               address increment feature for X and Y address counters
 379          *                               
 380          * Arguments   : 'color' is in 16-bit, [R4R3R2R1R0][G5G4G3G2G1G0][B4B3B2B1B0] 
 381          *                                               Writing color=0xFFFF equivalent to white color
 382          *                                               color=0x0000 eq. black
 383          *                                               color=0xF800 eq. red
 384          *                                               color=0x07E0 eq. green
 385          *                                               color=0x001F eq. blue
 386          *                               
 387          * Returns     : none
 388          *********************************************************************************************************
 389          */
 390          void cDispClr(INT16U color)
 391          {
 392   1              INT8U x,y,hiByte,lowByte;
 393   1      
 394   1              hiByte  = color>>8;
 395   1              lowByte = (INT8U)color;
 396   1      
 397   1                      for(x=0;x<MAX_ROW_PIXEL;x++)
 398   1                      {
 399   2                              for(y=0;y<MAX_COL_PIXEL;y++)
 400   2                              {
 401   3                              cDispWrDat(hiByte);
 402   3                              cDispWrDat(lowByte);
 403   3                              }
 404   2                      }
 405   1      }
 406          
 407          
 408          /*
 409          *********************************************************************************************************
 410          *                                                       SET PIXEL AT x, y POSITION
 411          *
 412          * Description : This function sets a pixel with (INT16U)color at a position defined by (x,y) following 
 413          *                               Cartesian coordinate system. Coordinates (0,0) at the top left corner, 
 414          *                               coordinates (127,159) at the lower right corner of the LCD screen, w/ CM50010ACT6_BO
 415          *                               in a verticle manner (J1 pins 1-20 verticle, pin 1 upward)
 416          *
 417          * Arguments   : 'x'             0....MAX_COL_PIXEL-1 is the matrix position in x-axis (left ->right)
 418          *                               'y'             0....MAX_ROW_PIXEL-1 is the matrix position in y-axis (up -> down)
 419          *                               'color'         sets 16-bit color
 420          * Returns     : none
 421          * Notes           : Should apply the local function cDispRstArea() to reset display area 128*160
 422          *********************************************************************************************************
 423          */
 424          void cDispSetPixel(INT8U x, INT8U y, INT16U color)
 425          {
C51 COMPILER V7.09   HDC1600                                                               08/24/2007 15:55:02 PAGE 8   

 426   1              INT8U hiByte, lowByte;
 427   1              x = MAX_COL_PIXEL-1-x;
 428   1              y = MAX_ROW_PIXEL-1-y;
 429   1      
 430   1              hiByte  = color>>8;
 431   1              lowByte = (INT8U)color;
 432   1      
 433   1              cDispWrCmd(X_ADDRESS_AREA_SET);         //X-address area set in the 160 pixel direction (y-axis)
 434   1              cDispWrCmd(y);                                          //offset for scan COM from 0~159
 435   1              cDispWrCmd(y++);
 436   1              cDispWrCmd(Y_ADDRESS_AREA_SET);         //Y-address area set in the 128 pixel direction (x-axis)
 437   1              cDispWrCmd(x);                                          //offset for scan SEG from 0~127
 438   1              cDispWrCmd(x++);
 439   1      
 440   1              cDispWrDat(hiByte);
 441   1              cDispWrDat(lowByte);    
 442   1      
 443   1              cDispRstArea();
 444   1      }
 445          
 446          /*
 447          *********************************************************************************************************
 448          *                 CONVERT A STRING FROM DATA MEMORY (RAM) TO PIXEL DATA AND DISPLAY AT x,y
 449          *
 450          * Description : This function outputs a string in RAM in graphic mode (pixel-by-pixel) at a position
 451          *                               (x,y) following Cartesian coordinate system with variable font spacing def by fontSpace.

⌨️ 快捷键说明

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