📄 funclcd.lst
字号:
C51 COMPILER V7.50 FUNCLCD 06/10/2006 08:26:02 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE FUNCLCD
OBJECT MODULE PLACED IN FuncLCD.OBJ
COMPILER INVOKED BY: D:\ExpertTools\Keil\C51\BIN\C51.EXE FuncLCD.C OPTIMIZE(5,SPEED) BROWSE DEBUG OBJECTEXTEND
line level source
1 /*********************************************************************
2 *Description: SW680GAM Machine LCD Drive Program
3 *File Name: LCD_DISPLAY.C
4 *Use Compile Lanague: KEIL C51
5 *Version : V1.0
6 *Code Author: zhouhuanxi
7 *Date: 2005-01-14
8 CopyRight(C) 2005 -- SHENZHEN XINSANWEI Machine&Electronics CO.,LTD.
9 *********************************************************************/
10 //==== FILE Include And Macro Declare Segment====
11
12 #define LCD_DISP_DEF
13 #include "Config.H"
14
15
16 /*************************************************/
17 //============ FUNCTION CODE SEGMENT =============
18 //*************************************************
19
20 #ifdef MYUSE
//=================================================
//Function: Display_Engils_Line
//Description: Display one System Main Menu
//Parameters: num,page_y_in,startcol,len,flag
//Call:
//Returns: NO.
//Side Effects:
//=================================================
void Display_Engils_Line( uint8 page_y_in,
uint8 startcol,uint8 len, bool flag, uint8** menuitem)
{
uint8 i;
if ((len*8)>(128-startcol)) return;
for(i=0;i<len;i++)
{
Msingle_font_pattern(menuitem[i],page_y_in,startcol,flag);
startcol=startcol+8;
}
}
//==========================================================
//Function: Display_Pic
//Description: Display one picture(16*128)
//Parameters: DispContent--- picture array
// page0--- display picture row
//Call:
//Returns: NO.
//=================================================
/*void MsgBox(uint8 page0,uint8 *DispContent[])
{
uint8 k,j;
for(j=0;j<2;j++)
{
SetRAMAddr(page0+j,0);
C51 COMPILER V7.50 FUNCLCD 06/10/2006 08:26:02 PAGE 2
for(k=0;k<=127;k++)
{
SingleData(k,DispContent[j][k]);
}
}
}*/
//=================================================
//Function: del_line
//Description: Send a Command Data to Clear LCD's ROws RAM,Let LCD's Status to Zero
//Parameters: row,start_col,end_col
//startp ---- Clear LCD RAM First Line Number
//endp ---- Clear LCD RAM Last Line Number
//Call: SetRAMAddr(),SingleData
//Returns: NO.
//Side Effects: NO.
//=================================================
void Delete_Line(uint8 row,uint8 start_col,uint8 end_col)
{
data uint8 u8page,u8Column;
for(u8page=row;u8page<=row+1;u8page++)
{
SetRAMAddr(u8page,0x00);
for (u8Column = start_col; u8Column <= end_col; u8Column++)
{
SingleData(u8Column,0x00); // erase a column
}
}
}
//=================================================
//Function: delchar
//Description: Send a Command Data to Clear LCD's ROws RAM,Let LCD's Status to Zero
//Parameters: page,cury1,charnum
//page ---- Clear LCD RAM First Line Number
//cury1 ---- Clear LCD RAM Last Line Number
//charnum ----
//Call: SetRAMAddr(),SingleData
//Returns: NO.
//Side Effects: NO.
//=================================================
void Delete_Char(uint8 *page,uint8 *cury1,uint8 *charnum)
{
uint8 i,cury0;
cury0=(*cury1)-8;
if(cury0==0)cury0=0;
if((*charnum)>0)
{
SetRAMAddr(*page,cury0);
for(i=cury0;i<*cury1;i++)
{
SingleData(i,0x00);
}
SetRAMAddr((*page)+1,cury0);
C51 COMPILER V7.50 FUNCLCD 06/10/2006 08:26:02 PAGE 3
for(i=cury0;i<*cury1;i++)
{
SingleData(i,0x00);
}
*charnum=(*charnum)-1;
(*cury1)=cury0;
if((*cury1)<8&&(*page)>=2)
{
(*page)=(*page)-2;
(*cury1)=120;
}
}
}
//==========================================================
//Function: DealWith_MenuFunction
//Description: Display one System Main Menu Item's SubMenu
//Parameters: menu --- main menu(0),submenu(1),subsubmenu(2)
// menuitem--- Current menu item index
// special_falg --- special function flag,0:no special function
//Call:
//Returns: NO.
//=================================================
void Display_FH(uint8 pagen,uint8 coln)
{
uint8 i;
SetRAMAddr(pagen,coln);
if(coln<64)
{
for (i=coln;i<=63;i++)
SingleData(i,0x0f);
}
else
{
for (i=coln;i<=127;i++)
SingleData(i,0x0f);
}
}
#endif
160
161 //=================================================
162 //Function: clearRAM
163 //Description: Send a Command Data to Clear LCD's ROws RAM,Let LCD's Status to Zero
164 //Parameters: startp,endp
165 //startp ---- Clear LCD RAM First Line Number
166 //endp ---- Clear LCD RAM Last Line Number
167 //Call: SetRAMAddr(),SingleData
168 //Returns: NO.
169 //Side Effects: NO.
170 //=================================================
171 void ClearRAM(uint8 startp,uint8 endp)
172 {
173 1 data uint8 u8Page,u8Column;
174 1
175 1 for (u8Page = startp; u8Page < endp; u8Page++)
176 1 {
177 2 SetRAMAddr(u8Page,0x00);
178 2
179 2 for (u8Column = 0; u8Column < 128; u8Column++)
C51 COMPILER V7.50 FUNCLCD 06/10/2006 08:26:02 PAGE 4
180 2 {
181 3 SingleData(u8Column,0x00); // erase a column
182 3 }
183 2 }
184 1 }
185
186 //=================================================
187 //Function: Display_cursor
188 //Description: 光标控制
189 //Parameters: page_in --- Row address
190 // col_in --- Col Address
191 // fflag --- Cursor Display or Not Display
192 //Call: SingleData,SetRAMAddr
193 //Returns: NO.
194 //Side Effects:
195 //=================================================
196 void Display_cursor(uint8* Content,uint8 page_in,uint8 col_in,bool fflag)
197 {
198 1 if(Cursor_Count<8 && fflag==1)
199 1 {
200 2 //SetRAMAddr(page_in,col_in);
201 2 //SingleData(col_in, 0xf0);
202 2 //SetRAMAddr(page_in+1,col_in);
203 2 //SingleData(col_in, 0x0f);
204 2 Msingle_font_pattern(Content, page_in, col_in, 1);
205 2 }
206 1 else
207 1 {
208 2 //SetRAMAddr(page_in,col_in);
209 2 //SingleData(col_in, 0x00);
210 2 //SetRAMAddr(page_in+1,col_in);
211 2 //SingleData(col_in, 0x00);
212 2 Msingle_font_pattern(Content, page_in, col_in, 0);
213 2 }
214 1 if(Cursor_Count>16) Cursor_Count=0;
215 1 }
216
217 //=================================================
218 //Function: Msingle_font_pattern
219 //Description: Send a 8 X 16 Dot of ASCII CHAR to LCD Display
220 //Parameters: *page_num,page_y_in,col_x_in,flag
221 //*page_num --- LCD Display Content's First Address
222 //page_y_in --- LCD Display Char of Row Address
223 //col_x_in --- LCD Display Char of Col Address
224 //flag --- 0 = Normal Display ;1 = Negative Display
225 //Call: SetRAMAddr(),SingleData()
226 //Returns: NO.
227 //Side Effects: NO.
228 //=================================================
229 void Msingle_font_pattern(uint8 *page_num, uint8 page_y,
230 uint8 col_x,bool flag)
231 {
232 1 data uint8 i;
233 1
234 1 SetRAMAddr(page_y,col_x);
235 1
236 1 for (i=0;i<8;i++)
237 1 {
238 2 if(flag==0)
239 2 SingleData(col_x,page_num[i]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -