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

📄 display.lst

📁 LCD及键盘、RS232通信控制源代码、采用keil c51环境编译
💻 LST
字号:
C51 COMPILER V6.14  DISPLAY                                                                07/15/2005 09:38:51 PAGE 1   


C51 COMPILER V6.14, COMPILATION OF MODULE DISPLAY
OBJECT MODULE PLACED IN .\Display.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE .\Display.C DEBUG OBJECTEXTEND

stmt level    source

   1          /*********************************************************************************
   2          *                                                                                *
   3          *	FileName:	Display.c                                                        *
   4          *	Function:	monitor controller                                               *
   5          *	SystemName:	NDS18000-BSC                                                     *
   6          *	CPU:		ATMEL AT89C52                                                    *
   7          *	Startup:	14/Oct/2002                                                      *
   8          *	Author:		XuYiBo                                                           *
   9          *                                                                                *
  10          *********************************************************************************/
  11          #include <AT89X52.H>
  12          
  13          #include "NDSBSCUI.H"
  14          #include "display.h"
  15          #include "General.h"
  16          
  17          //unsigned char data ucDisBuffer[40];	//display buffer
  18          //unsigned char data ucCursorType;	//Cursor Type:0=turn off,1=turn on,2=blink,others no define
  19          //unsigned char data ucCursorPos;		//Cursor Position:range 0-40
  20          
  21          unsigned char xdata ucDisplayDat _at_ 0x4000;
  22          unsigned char xdata ucDisplayCom _at_ 0x4001;
  23          
  24          extern UIMemory	xdata UIDataArea;	//define in NDSBSCUI.C
  25          
  26          /////////////////////////////////////////////////////////////////////////////////////////////////
  27          /***********************************************************
  28          *                                                          *
  29          *	Initialize display parameter                           *
  30          *                                                          *
  31          ***********************************************************/
  32          void InitDisplay(void)
  33          {
  34   1      //	ucCursorType= 0;
  35   1      //	ucCursorPos	= 40;
  36   1      	ResetLCD();
  37   1      }
  38          
  39          /***********************************************************
  40          *                                                          *
  41          *	write display buffer(code area to data area)           *
  42          *                                                          *
  43          ***********************************************************/
  44          /*
  45          void WriteDisBuf_c(unsigned char code *pStr_Sour)
  46          {
  47          unsigned char data *pstr_Tmp;
  48          	pstr_Tmp = ucDisBuffer;
  49          	while( pstr_Tmp != ucDisBuffer+40)
  50          	{
  51          		*(pstr_Tmp++) = *(pStr_Sour++);
  52          	}
  53          }
  54          */
  55          /***********************************************************
C51 COMPILER V6.14  DISPLAY                                                                07/15/2005 09:38:51 PAGE 2   

  56          *                                                          *
  57          *	write display buffer(xdata area to data area)          *
  58          *                                                          *
  59          ***********************************************************/
  60          /*
  61          void WriteDisBuf_x(void)
  62          {
  63          unsigned char data *pstr_Des;
  64          unsigned char xdata *pstr_Sour;
  65          
  66          	pstr_Des = ucDisBuffer;
  67          	pstr_Sour= UIDataArea.DisBuffer.DisplayBuffer;
  68          	while( pstr_Des != ucDisBuffer+40)
  69          	{
  70          		*(pstr_Des++) = *(pstr_Sour++);
  71          	}
  72          	ucCursorType= UIDataArea.DisBuffer.CursorType;
  73          	ucCursorPos	= UIDataArea.DisBuffer.CursorPos;
  74          }
  75          */
  76          /***********************************************************
  77          *                                                          *
  78          *	Initialize the LCD panel                               *
  79          *                                                          *
  80          ***********************************************************/
  81          void ResetLCD(void)
  82          {
  83   1      	ucDisplayCom = 0x01;		//Clear Display
  84   1      	DelayTime(0x02);
  85   1      	ucDisplayCom = 0x38;		//8Bit BUS/2Line display mode/5*11 dots
  86   1      	DelayCycle(0x16);
  87   1      	ucDisplayCom = 0x0c;		//Display on/Cursor off/Cursor blink off
  88   1      	DelayCycle(0x16);
  89   1      	ucDisplayCom = 0x06;		//
  90   1      	DelayCycle(0x16);
  91   1      }
  92          
  93          /***********************************************************
  94          *                                                          *
  95          *	将DisBuffer中40Bytes送显示屏,设置光标位置、类型等      *
  96          *                                                          *
  97          ***********************************************************/
  98          /*
  99          void Display(void)
 100          {
 101          unsigned char data *pstr_Tmp;
 102          	ucDisplayCom = 0x80;
 103          	DelayCycle(0x08);
 104          
 105          	pstr_Tmp = ucDisBuffer;
 106          	while( pstr_Tmp != ucDisBuffer+20)
 107          	{
 108          		ucDisplayDat = *(pstr_Tmp++);
 109          		DelayCycle(0x08);
 110          	}
 111          
 112          	ucDisplayCom = 0xc0;	//Second line
 113          	DelayCycle(0x08);
 114          
 115          	while( pstr_Tmp != ucDisBuffer+40)
 116          	{
 117          		ucDisplayDat = *(pstr_Tmp++);
C51 COMPILER V6.14  DISPLAY                                                                07/15/2005 09:38:51 PAGE 3   

 118          		DelayCycle(0x08);
 119          	}
 120          
 121          	if( ucCursorPos >= 20 )	//Set cursor position
 122          	{
 123          		ucDisplayCom = (ucCursorPos+44) | 0x80;
 124          	}
 125          	else
 126          	{
 127          		ucDisplayCom = ucCursorPos | 0x80;
 128          	}
 129          	DelayCycle(0x08);
 130          	
 131          	if( ucCursorType == 0x00)	//Cursor type
 132          	{
 133          		ucDisplayCom = 0x0c;	//turn off the cursor
 134          	}
 135          	else if( ucCursorType == 0x01)
 136          	{
 137          		ucDisplayCom = 0x0e;	//turn on the cursor
 138          	}
 139          	else if( ucCursorType == 0x02)
 140          	{
 141          		ucDisplayCom = 0x0f;	//blink
 142          	}
 143          	DelayCycle(0x08);
 144          }
 145          */
 146          /***************************************************************
 147          *                                                              *
 148          *	将双口RAM中显示缓冲区的内容送显示屏,设置光标位置、类型等   *
 149          *                                                              *
 150          ***************************************************************/
 151          void DisplayEx(void)
 152          {
 153   1      unsigned char xdata *pstr_Tmp;
 154   1      unsigned char ucTmp;
 155   1      	ucDisplayCom = 0x80;	//first line
 156   1      	DelayCycle(0x08);
 157   1      
 158   1      	pstr_Tmp = UIDataArea.DisBuffer.DisplayBuffer;
 159   1      	ucTmp = 20;
 160   1      	while( ucTmp-- )
 161   1      	{
 162   2      		ucDisplayDat = *(pstr_Tmp++);
 163   2      		DelayCycle(0x06);
 164   2      	}
 165   1      
 166   1      	ucDisplayCom = 0xc0;	//Second line
 167   1      	DelayCycle(0x08);
 168   1      
 169   1      	ucTmp = 20;
 170   1      	while( ucTmp-- )
 171   1      	{
 172   2      		ucDisplayDat = *(pstr_Tmp++);
 173   2      		DelayCycle(0x06);
 174   2      	}
 175   1      
 176   1      	if( UIDataArea.DisBuffer.CursorPos >= 20 )	//Set cursor position
 177   1      	{
 178   2      		ucDisplayCom = (UIDataArea.DisBuffer.CursorPos+44) | 0x80;
 179   2      	}
C51 COMPILER V6.14  DISPLAY                                                                07/15/2005 09:38:51 PAGE 4   

 180   1      	else
 181   1      	{
 182   2      		ucDisplayCom = UIDataArea.DisBuffer.CursorPos | 0x80;
 183   2      	}
 184   1      	DelayCycle(0x08);
 185   1      	
 186   1      	if( UIDataArea.DisBuffer.CursorType == 0x00)	//Cursor type
 187   1      	{
 188   2      		ucDisplayCom = 0x0c;	//turn off the cursor
 189   2      	}
 190   1      	else if( UIDataArea.DisBuffer.CursorType == 0x01)
 191   1      	{
 192   2      		ucDisplayCom = 0x0e;	//turn on the cursor
 193   2      	}
 194   1      	else if( UIDataArea.DisBuffer.CursorType == 0x02)
 195   1      	{
 196   2      		ucDisplayCom = 0x0f;	//blink
 197   2      	}
 198   1      	DelayCycle(0x08);
 199   1      }
 200          
 201          /***************************************************************
 202          *                                                              *
 203          *	将指定的ROM区的内容送显示屏                                *
 204          *                                                              *
 205          ***************************************************************/
 206          void DisplayRom(unsigned char code *pstr_Tmp)
 207          {
 208   1      unsigned char ucTmp;
 209   1      	ucDisplayCom = 0x80;	//first line
 210   1      	DelayCycle(0x08);
 211   1      
 212   1      	ucTmp = 20;
 213   1      	while( ucTmp-- )
 214   1      	{
 215   2      		ucDisplayDat = *(pstr_Tmp++);
 216   2      		DelayCycle(0x06);
 217   2      	}
 218   1      
 219   1      	ucDisplayCom = 0xc0;	//Second line
 220   1      	DelayCycle(0x08);
 221   1      
 222   1      	ucTmp = 20;
 223   1      	while( ucTmp-- )
 224   1      	{
 225   2      		ucDisplayDat = *(pstr_Tmp++);
 226   2      		DelayCycle(0x06);
 227   2      	}
 228   1      }
 229          /***********************************************************
 230          *                                                          *
 231          *	set type of the cursor:                                *
 232          *		0=turn off                                         *
 233          *		1=turn on,not blink                                *
 234          *		2=turn on,blink                                    *
 235          *                                                          *
 236          ***********************************************************/
 237          /*void SetCursorType(unsigned char ucType)
 238          {
 239          	if( ucType == 0x00)	//Cursor type
 240          	{
 241          		ucDisplayCom = 0x0c;	//turn off
C51 COMPILER V6.14  DISPLAY                                                                07/15/2005 09:38:51 PAGE 5   

 242          	}
 243          	else if( ucType == 0x01)
 244          	{
 245          		ucDisplayCom = 0x0e;	//turn on,not blink
 246          	}
 247          	else if( ucType == 0x02)
 248          	{
 249          		ucDisplayCom = 0x0f;	//blink
 250          	}
 251          	DelayCycle(0x08);
 252          }
 253          */
 254          /***********************************************************
 255          *                                                          *
 256          *	set position of the cursor                             *
 257          *                                                          *
 258          ***********************************************************/
 259          void SetCursorPos(unsigned char ucPos)
 260          {
 261   1      	if( ucPos >= 20 )
 262   1      	{//first line
 263   2      		ucDisplayCom = (ucPos+44) | 0x80;
 264   2      	}
 265   1      	else
 266   1      	{//second line
 267   2      		ucDisplayCom = ucPos | 0x80;
 268   2      	}
 269   1      	DelayCycle(0x08);
 270   1      }
 271          
 272          /***********************************************************
 273          *                                                          *
 274          *	display a char at current position                     *
 275          *                                                          *
 276          ***********************************************************/
 277          void DisplayChar(unsigned char ucDisByte)
 278          {
 279   1      	ucDisplayDat = ucDisByte;
 280   1      	DelayCycle(0x08);
 281   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    366    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       6
   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 + -