📄 lcd128x64.lst
字号:
242 0x00,0x00,0x0C,0x0F,0x0F,0x0F,0x0C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
243 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x0F,0x0F,0x0F,0x0C,0x0C,0x00,0x00,0x00,
244 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x07,0x07,0x03,0x03,
245 0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
246 0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,
247 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x38,0x39,0x39,
248 0x39,0x1F,0x1F,0x1F,0x1D,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,
249 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
250 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x70,0x40,0x40,0xC0,
251 0x40,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
252 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
253 0x00,0x00,0x80,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
254 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
255 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
256 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
257 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
258 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xA1,0x33,0x10,0x0E,0x04,0x0A,0x09,0x12,
259 0x04,0x00,0x00,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
260 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA2,0x80,0x01,
261 0x80,0x80,0x00,0x80,0x80,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
262 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
263 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
264 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
265 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
266 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
267 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
268 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x12,0x20,0x00,
269 0x80,0x20,0x00,0x00,0x20,0x00,0x10,0x00,0x4A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
270 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
271 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
272 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
273 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
274 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
275 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
276 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,
277 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
278 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
279 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
280 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
281 };
282
283 /*-------------------延时子程序-----------------------------*/
284 void delay(unsigned int t)
285 {
286 1 unsigned int i,j;
287 1 for(i=0;i<t;i++)
288 1 for(j=0;j<10;j++)
289 1 ;
290 1 }
291
292 /*-------------------------写命令到LCD------------------------------*/
293 void write_command(unsigned char cmdcode)
294 {
295 1 RS = 0;
296 1 RW = 0;
297 1 P0 = cmdcode;
298 1 delay(0);
299 1 E = 1;
300 1 delay(0);
301 1 E = 0;
302 1 }
303
C51 COMPILER V7.50 LCD128X64 08/15/2007 22:03:43 PAGE 6
304 /*-------------------------写数据到LCD----------------------------*/
305
306 void write_data(unsigned char Dispdata)
307 {
308 1 RS = 1;
309 1 RW = 0;
310 1 P0 = Dispdata;
311 1 delay(0);
312 1 E = 1;
313 1 delay(0);
314 1 E = 0;
315 1 }
316
317 /*-------------------------读LCD数据----------------------------*/
318 /*
319 unsigned char read_data()
320 {
321 unsigned char tmpin;
322 RS = 1;
323 RW = 1;
324 delay(0);
325 E = 1;
326 delay(0);
327 E = 0;
328
329 tmpin = P0;
330
331 return tmpin;
332 }
333
334
335
336 /*-------------------------显示边框-------------------------------*/
337 /*
338 void frame()
339 {
340 unsigned char i;
341 CS2=1;
342 CS1=1;
343 write_command(Page_Add+0); // 设置页地址 //
344 write_command(Col_Add+0); // 设置列地址 //
345 for(i=0;i<64;i++) write_data(0x01);
346 write_command(Page_Add+7);
347 write_command(Col_Add+0);
348 for(i=0;i<64;i++) write_data(0x80);
349 for(i=0;i<8;i++)
350 {
351 CS2=0;
352 CS1=1;
353 write_command(Page_Add+i);
354 write_command(Col_Add+63);
355 write_data(0xff);
356 CS2=1;
357 CS1=0;
358 write_command(Page_Add+i);
359 write_command(Col_Add+0);
360 write_data(0xff);
361 }
362 }
363
364 /*------------------------清显示屏--------------------------------*/
365 void Clr_Scr()
C51 COMPILER V7.50 LCD128X64 08/15/2007 22:03:43 PAGE 7
366 {
367 1 unsigned char j,k;
368 1 CS2=1;CS1=0; // 清左半屏 //
369 1 {
370 2 write_command(Page_Add+0);
371 2 write_command(Col_Add+0);
372 2 for(k=0;k<4;k++) // 清左上半屏 //
373 2 {
374 3 for(j=0;j<64;j++)
375 3 write_data(0x00);
376 3 }
377 2 for(k=0;k<4;k++) // 清左下半屏 //
378 2 {
379 3 write_command(Page_Add+4);
380 3 for(j=0;j<64;j++)
381 3 write_data(0x00);
382 3 }
383 2 }
384 1 CS2=0;CS1=1; // 清右半屏 //
385 1 {
386 2 write_command(Page_Add+0);
387 2 write_command(Col_Add+0);
388 2 for(k=0;k<4;k++) // 清右上半屏 //
389 2 {
390 3 for(j=0;j<64;j++)
391 3 write_data(0x00);
392 3 }
393 2 for(k=0;k<4;k++) // 清右下半屏 //
394 2 {
395 3 write_command(Page_Add+4);
396 3 for(j=0;j<64;j++)
397 3 write_data(0x00);
398 3 }
399 2 }
400 1 }
401 /*------------------显示12864图片---------------------------*/
402 void Disp_Img(unsigned char code *img)
403 {
404 1 unsigned char j,k;
405 1 for(k=0;k<8;k++)
406 1 {
407 2 CS2=1;
408 2 CS1=0;
409 2 delay(10);
410 2 write_command(Page_Add+k);
411 2 write_command(Col_Add+0);
412 2 for(j=0;j<64;j++)
413 2 write_data(img[k*128+j]);
414 2 CS2=0;
415 2 CS1=1;
416 2 delay(10);
417 2 write_command(Page_Add+k);
418 2 write_command(Col_Add+0);
419 2 for(j=64;j<128;j++)
420 2 write_data(img[k*128+j]);
421 2 }
422 1 }
423
424 /*------------------显示横---------------------------*/
425 /*void Disp_H_Line()
426 {
427 unsigned char i,j;
C51 COMPILER V7.50 LCD128X64 08/15/2007 22:03:43 PAGE 8
428 CS2=1;
429 CS1=1;
430 write_command(Disp_On);
431 write_command(Page_Add);
432 write_command(Start_Line);
433 write_command(Col_Add);
434
435 for(j=0;j<8;j++)
436 {
437 write_command(Page_Add+j);
438 write_command(Col_Add+0);
439 // write_com(Start_Line+0);
440 for(i=0;i<64;i++)
441 write_data(0x55);
442 }
443 }
444
445
446 /*------------------显示列-----------------------------*/
447 /*void Disp_V_Line()
448 {
449 unsigned char i,j;
450 write_command(Disp_On);
451 write_command(Page_Add);
452 write_command(Start_Line);
453 write_command(Col_Add);
454
455 for(j=0;j<8;j++)
456 {
457 write_command(Page_Add+j);
458 write_command(Col_Add+0);
459 write_command(Start_Line+0);
460 for(i=0;i<32;i++)
461 {
462 write_data(0x00);
463 write_data(0xff);
464 }
465 }
466 }
467
468 /*------------------棋盘-----------------------------*/
469 /*void Disp_Cross_Line(unsigned char mode)
470 {
471 unsigned char i,j;
472 unsigned char data1,data2;
473 if(mode==0) {data1=0xaa;data2=0x55;}
474 else if(mode==1) {data1=0x55;data2=0xaa;}
475 else return;
476 CS2=1;CS1=1;
477 write_command(Disp_On);
478 write_command(Page_Add);
479 write_command(Start_Line);
480 write_command(Col_Add);
481 for(j=0;j<8;j++)
482 {
483 write_command(Page_Add+j);
484 write_command(Col_Add+0);
485 write_command(Start_Line+0);
486 for(i=0;i<32;i++)
487 {
488 write_data(data1);
489 write_data(data2);
C51 COMPILER V7.50 LCD128X64 08/15/2007 22:03:43 PAGE 9
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -