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

📄 lcd.lst

📁 彩屏控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
 182   1              x1+=2;
 183   1              x2+=2;
 184   1              y1+=3;
 185   1              y2+=3;  
 186   1      
 187   1          LCDWR ( LCDCOM, 0x2A);
 188   1              LCDWR ( LCDDAT,  x1>>8);
 189   1              LCDWR ( LCDDAT, x1);
 190   1              LCDWR ( LCDDAT,  x2>>8);
 191   1              LCDWR ( LCDDAT, x2 + 0); 
 192   1      
 193   1              LCDWR ( LCDCOM, 0x2B);
 194   1              LCDWR ( LCDDAT,  y1>>8);
 195   1              LCDWR ( LCDDAT, y1); 
 196   1              LCDWR ( LCDDAT,  y2>>8);
 197   1              LCDWR ( LCDDAT, y2); 
 198   1              LCDWR ( LCDCOM, 0x2C);
 199   1      }
 200          /*
 201          ========================================================================================================
 202          Name: LCDDrawDollop
 203          Function: Draw a dollop at a special area
 204          Input:  1. *dollop : The pointer of a DOLLOP struct
 205          Output: None
 206          Note: The value of the input structrue must be correct, This function does not check the parameters.
 207          Author: LiYong
 208          Date  : 2008.08.09
 209          ========================================================================================================
 210          */
 211          void    LCDDrawDollop( DOLLOP* dollop )
 212          {
 213   1              INT8U x,y;
 214   1      
 215   1              LCDSetArea(dollop->xs, dollop->ys, dollop->xe, dollop->ye);     //Set a area at the screen
 216   1              for( x = 0; x < dollop->xe - dollop->xs + 1; x ++ )                                     //Display rows
 217   1              {
 218   2                      for( y = 0; y < dollop->ye - dollop->ys + 1; y ++ )                             //Display columns
 219   2                      {
 220   3                              LCDWR( LCDDAT, dollop->Color>>8 );
 221   3                              LCDWR( LCDDAT, dollop->Color );
 222   3                      }
 223   2              }
 224   1      }
 225          /*
 226          ========================================================================================================
 227          Name: LCDDrawPoint( );
 228          Function: Draw a point
 229          Input:  -pPoint, A structure pointer
 230          Output: None
 231          ========================================================================================================
 232          */
 233          void LCDDrawPoint( POINT* pPoint )
 234          {
 235   1          LCDSetArea( pPoint->x, pPoint->y, pPoint->x, pPoint->y );
 236   1              LCDWR ( LCDDAT,  ( pPoint->Color >> 8 ) & 0xff );
 237   1              LCDWR ( LCDDAT,  pPoint->Color & 0xff );
 238   1      }
 239          /*
 240          ========================================================================================================
C51 COMPILER V7.50   LCD                                                                   03/30/2011 19:43:22 PAGE 5   

 241          Name: LCDDrawHRLine( );
 242          Function: Draw a line
 243          Input:  -pLine, A structure pointer to a line
 244          Output: None
 245          ========================================================================================================
 246          */
 247          void LCDDrawHRLine( LINE* pLine )
 248          {
 249   1              INT8U x0, x1, y0, y1;
 250   1              if( pLine->xs != pLine->xe && pLine->ys != pLine->ye )   return;
 251   1              if( pLine->ys > pLine->ye )
 252   1              {
 253   2                      y0 = pLine->ye;
 254   2                      y1 = pLine->ys;
 255   2              }
 256   1              else
 257   1              {
 258   2                      y0 = pLine->ys;
 259   2                      y1 = pLine->ye;
 260   2              }
 261   1              if( pLine->xs > pLine->xe )
 262   1              {
 263   2                      x0 = pLine->xe;
 264   2                      x1 = pLine->xs;
 265   2              }
 266   1              else
 267   1              {
 268   2                      x0 = pLine->xs;
 269   2                      x1 = pLine->xe;
 270   2              }
 271   1              LCDSetArea( x0, y0, x1, y1 );
 272   1              x0 = x1 - x0;
 273   1              if( x0 == 0 ) x0 = y1 - y0;
 274   1              for( y0 = 0; y0 < x0; y0 ++ )
 275   1              {
 276   2                      LCDWR( LCDDAT, pLine->Color >> 8 );
 277   2                      LCDWR( LCDDAT, pLine->Color );
 278   2              }
 279   1      }
 280          /*
 281          ========================================================================================================
 282          Name: PrintBitBlock
 283          Function: Print a special block in the screen.
 284          Input:  pBitBlock: This is a pointer, It points to a block whitch contains informations of the block,
 285                  eg. height, width, and so on.
 286          Output: None
 287          Note:   None
 288          Author: LiYong
 289          Date  : 2008.08.09
 290          ========================================================================================================
 291          */
 292          void    PrintBitBlock( BitBlock *pBitBlock )
 293          {
 294   1          INT8U       Row, Column;
 295   1              INT32U  BytesAbs;
 296   1              INT8U   RowBytes;
 297   1      
 298   1              LCDSetArea( pBitBlock->xs, pBitBlock->ys,
 299   1                      pBitBlock->xs + pBitBlock->Width - 1, pBitBlock->ys + pBitBlock->Height - 1 );
 300   1      
 301   1              RowBytes = pBitBlock->Width >> 3;
 302   1              if( pBitBlock->Width & 0x07 )
C51 COMPILER V7.50   LCD                                                                   03/30/2011 19:43:22 PAGE 6   

 303   1              {
 304   2                      RowBytes ++;
 305   2              }
 306   1              for( Row = 0; Row <  pBitBlock->Height; Row ++ )
 307   1              {
 308   2                      for( Column = 0; Column < pBitBlock->Width; Column ++ )
 309   2                      {
 310   3                              BytesAbs = Row * RowBytes + ( Column >> 3 )     ;
 311   3                              if( *( pBitBlock->pData + BytesAbs )    & ( 1<<( Column & 0x07 )) )
 312   3                              {
 313   4                                      LCDWR( LCDDAT, pBitBlock->Color >> 8 );
 314   4                                      LCDWR( LCDDAT, pBitBlock->Color );
 315   4                              }
 316   3                              else
 317   3                              {
 318   4                                      LCDWR( LCDDAT, pBitBlock->BackColor >> 8 );
 319   4                                      LCDWR( LCDDAT, pBitBlock->BackColor );
 320   4                              }
 321   3                      }
 322   2              }
 323   1      }
 324          /*
 325          ========================================================================================================
 326          Name: GUI_Image( )
 327          Function: Print a image
 328          Input:  point to a struct which contains the informations of the image
 329          Output: None
 330          Note:   None
 331          Author: LiYong
 332          Date  : 2008.08.09
 333          ========================================================================================================
 334          */
 335          void GUI_Image( IMAGE *pImage )
 336          {
 337   1          INT8U x, y;
 338   1          INT16U datacount = 0;
 339   1          LCDSetArea( pImage->xs, pImage->ys, pImage->xs + pImage->length - 1, pImage->ys + pImage->height - 1 )
             -;
 340   1      
 341   1          for( x = 0; x < pImage->length; x ++ )
 342   1          {
 343   2              for( y = 0; y < pImage->height; y ++ )
 344   2              {
 345   3                  LCDWR( LCDDAT, *( pImage->pData + datacount++ ) );
 346   3                  LCDWR( LCDDAT, *( pImage->pData + datacount++ ) );
 347   3      
 348   3              }
 349   2          }
 350   1      }
 351          /*
 352          ================================================================================
 353          -----------------------------------End of file----------------------------------
 354          ================================================================================
 355          */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1990    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----      35
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
C51 COMPILER V7.50   LCD                                                                   03/30/2011 19:43:22 PAGE 7   

   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 + -