📄 lcd.lst
字号:
243 5 x += 8;
244 5 n++;
245 5 }
246 4 if(x>=128)
247 4 return;
248 4 continue;
249 4 }
250 3 r1 = api_s8GetFont16x16BMP(*str++, FALSE);
251 3 if(r1 == 0)
252 3 {
253 4 if(lcd_putc_16x16(x, y, 0))
254 4 {
255 5 x += 16;
256 5 n += 2;
257 5 }
258 4 }
259 3 }
260 2 if(x>=128)
261 2 return;
262 2 }
263 1 }
264
265 void lcd_puts_unicode(UINT8 x, UINT8 y, UINT16 *str, UINT16 *str1,UINT8 fontsize,UINT8 mode)
266 {
267 1 UINT8 data n;
268 1 n = 0;
269 1
270 1 while(1)
271 1 {
272 2 if(mode == 0 && *str == '\0')
273 2 return;
274 2 else if(mode == 1 && *str == '\0')
275 2 {
276 3 if(u8Scrollinit == 1 && x<128 && u8ScrollPos ==0)
277 3 {
278 4 u8Scrollinit = 0;
279 4 bNeedScroll = 0;
280 4 return;
281 4 }
282 3 if(x==0)
283 3 u8ScrollPos = 0;
284 3 str = str1;
285 3 x+=16;
286 3 }
287 2 if(fontsize == FONTSIZE_8x8)
288 2 {
289 3 if(lcd_putc_8x8(x, y, *str++))
290 3 {
291 4 x += 8;
292 4 n++;
293 4 }
294 3 }
295 2 else {
296 3 if((fontsize == FONTSIZE_8x16) ||
297 3 (fontsize == FONTSIZE_HYPER && *str <= 0x80))
298 3 {
299 4 if(lcd_putc_8x16(x, y, *str++))
300 4 {
301 5 x += 8;
C51 COMPILER V7.50 LCD 08/18/2008 13:43:44 PAGE 6
302 5 n++;
303 5 }
304 4 if(x>=128)
305 4 return;
306 4 continue;
307 4 }
308 3 if(lcd_putc_16x16(x, y, *str++))
309 3 {
310 4 x += 16;
311 4 n += 2;
312 4 }
313 3 }
314 2 if(x>=128)
315 2 return;
316 2 }
317 1 }
318
319 void lcd_clear(void)
320 {
321 1 UINT8 i;
322 1 lcd_set_rw_area(0, 0, XRES, YRES);
323 1 memset(pixel_buf, 0x0, sizeof(pixel_buf));
324 1 for(i = 0; i < YRES; i++)
325 1 lcd_put_data((UINT16)pixel_buf, XRES << 1);
326 1 }
327
328
329 #if 0
void lcd_set_brightness(UINT8 v)
{
#if 1
api_vLcdPinSelect();
writec(0x2a);
writec(0xce+v); //90 0xde c8
delay(20);
writec(0x2b);
writec(0x44+v); //90 0x54 c8
api_vLcdPinRecover();
#else
api_vLcdPinSelect();
writec(0x2a);
writec(v*8); //90 0xde c8
delay(20);
writec(0x2b);
writec(v*8); //90 0x54 c8
api_vLcdPinRecover();
#endif
}
#endif
351
352 void lcd_init(void)
353 {
354 1 // Print("LCD Init\n");
355 1 #if 0
api_vLcdInit(LCM_INTERFACE_6800);
api_vLcdPinSelect();
XBYTE[0XF400] = 0XFF;
XBYTE[0XF401] = 0XFF;
//
bLCD_PIN_RESET = 0;
delay(100);
bLCD_PIN_RESET = 1;
C51 COMPILER V7.50 LCD 08/18/2008 13:43:44 PAGE 7
CDIR = 0;
delay(100);
//-------------------------------------------------
writec(0x2C);
delay(20);
//-------------------------------------------------
writec(0x02);
writec(0x01);
delay(20);
//-------------------------------------------------
writec(0x26);
writec(0x01);
delay(20);
writec(0x26);
writec(0x09);
delay(20);
writec(0x26);
writec(0x0b);
delay(20);
writec(0x26);
writec(0x0f);
delay(20);
//------------------------------------------------
writec(0x10);
writec(0x23); // 21,25
delay(5);
//-------------------------------------------------
writec(0x20);
writec(0x03); //20
delay(20);
//-------------------------------------------------
writec(0x22);
writec(0x11);
delay(5);
//------------------------------------------------
writec(0x24);
writec(0x11); //00
delay(20);
//-------------------------------------------------
writec(0x28);
writec(0x01);
delay(20);
//------------------------------------------------
writec(0x2a);
writec(0xc8); //90 0xde
delay(20);
//------------------------------------------------
writec(0x2b);
writec(0xc8); //90 0x54
delay(10);
//------------------------------------------------
writec(0x30);
writec(0x09); //0b
delay(20);
//------------------------------------------------
writec(0x32);
writec(0x0E);
delay(20);
//-----------------------------------------------
writec(0x34);
C51 COMPILER V7.50 LCD 08/18/2008 13:43:44 PAGE 8
writec(0x08);//0d
delay(20);
//-------------------------------------------------
writec(0x36);
writec(0x00);
delay(20);
//---------显示模式----------
writec(0x40);
writec(0x00);//显示模式08和 00相反 竖屏
writec(0x10);
writec(0x22);
delay(20);
//------------------------------------------------
writec(0x43);
writec(0x00);
writec(0x7F);
delay(20);
//------------------------------------------------
writec(0x42);
writec(0x00);
writec(0x9F);
delay(20);
//------------------------------------------------
writec(0x53);
writec(0x00);
delay(20);
//-------------------------------------------------
writec(0xEB);
delay(20);
//-------------------------------------------------
writec(0x45);
writec(0x00);
//-------------------------------------------------
writec(0x55);
writec(0x00);
delay(20);
//------------------------------------------------
writec(0x5A);
writec(0x00);
delay(20);
//------------------------------------------------
writec(0x51);
delay(40);
api_vLcdPinRecover();
#endif
479 1 }
480
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1462 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 773 45
PDATA SIZE = ---- ----
C51 COMPILER V7.50 LCD 08/18/2008 13:43:44 PAGE 9
DATA SIZE = ---- 3
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 + -