📄 fun_16.lst
字号:
293 void dispColorB(uint16 row,col,uint8 colorMode,uint8 rgbA1,rgbA2,rgbB1,rgbB2,rgbC1,rgbC2,rgbD1,rgbD2)
294 {
295 1 uint16 i,j,k;
296 1
297 1 setColorMode(colorMode);
298 1
299 1 k = row/4;
300 1 comm_out(0x5c); // Write Display Data
301 1
302 1 for(i=0;i<k;i++)
C51 COMPILER V7.09 FUN_16 02/16/2006 16:40:29 PAGE 6
303 1 {
304 2 for(j=0;j<col/4;j++)
305 2 {
306 3 data_out(rgbA1,rgbA2);
307 3 }
308 2 for(j=0;j<col/4;j++)
309 2 {
310 3 data_out(rgbB1,rgbB2);
311 3 }
312 2 for(j=0;j<col/4;j++)
313 2 {
314 3 data_out(rgbC1,rgbC2);
315 3 }
316 2 for(j=0;j<col/4;j++)
317 2 {
318 3 data_out(rgbD1,rgbD2);
319 3 }
320 2 }
321 1
322 1 for(i=0;i<k;i++)
323 1 {
324 2 for(j=0;j<col/4;j++)
325 2 {
326 3 data_out(rgbB1,rgbB2);
327 3 }
328 2 for(j=0;j<col/4;j++)
329 2 {
330 3 data_out(rgbC1,rgbC2);
331 3 }
332 2 for(j=0;j<col/4;j++)
333 2 {
334 3 data_out(rgbD1,rgbD2);
335 3 }
336 2 for(j=0;j<col/4;j++)
337 2 {
338 3 data_out(rgbA1,rgbA2);
339 3 }
340 2 }
341 1
342 1 for(i=0;i<k;i++)
343 1 {
344 2 for(j=0;j<col/4;j++)
345 2 {
346 3 data_out(rgbC1,rgbC2);
347 3 }
348 2 for(j=0;j<col/4;j++)
349 2 {
350 3 data_out(rgbD1,rgbD2);
351 3 }
352 2 for(j=0;j<col/4;j++)
353 2 {
354 3 data_out(rgbA1,rgbA2);
355 3 }
356 2 for(j=0;j<col/4;j++)
357 2 {
358 3 data_out(rgbB1,rgbB2);
359 3 }
360 2 }
361 1
362 1
363 1 for(i=0;i<k;i++)
364 1 {
C51 COMPILER V7.09 FUN_16 02/16/2006 16:40:29 PAGE 7
365 2 for(j=0;j<col/4;j++)
366 2 {
367 3 data_out(rgbD1,rgbD2);
368 3 }
369 2 for(j=0;j<col/4;j++)
370 2 {
371 3 data_out(rgbA1,rgbA2);
372 3 }
373 2 for(j=0;j<col/4;j++)
374 2 {
375 3 data_out(rgbB1,rgbB2);
376 3 }
377 2 for(j=0;j<col/4;j++)
378 2 {
379 3 data_out(rgbC1,rgbC2);
380 3 }
381 2 }
382 1
383 1 }
384
385
386
387 void dispColorW(uint16 row,col,uint8 colorMode,uint8 Frgb1,Frgb2,Brgb1,Brgb2)
388 {
389 1
390 1 uint16 i,j,k;
391 1
392 1 setColorMode(colorMode);
393 1
394 1 k = row /4;
395 1
396 1 comm_out(0x5c); // Write Display Data
397 1
398 1 for(i=0;i<k;i++)
399 1 {
400 2 for(j=0;j<col;j++)
401 2 {
402 3 data_out(Brgb1,Brgb2);
403 3 }
404 2 }
405 1 for(i=0;i<k*2;i++)
406 1 {
407 2 for(j=0;j<col/4;j++)
408 2 {
409 3 data_out(Brgb1,Brgb2);
410 3 }
411 2
412 2 for(j=0;j<col/2;j++)
413 2 {
414 3 data_out(Frgb1,Frgb2);
415 3 }
416 2 for(j=0;j<col/4;j++)
417 2 {
418 3 data_out(Brgb1,Brgb2);
419 3 }
420 2 }
421 1
422 1 for(i=0;i<k;i++)
423 1 {
424 2 for(j=0;j<col;j++)
425 2 {
426 3 data_out(Brgb1,Brgb2);
C51 COMPILER V7.09 FUN_16 02/16/2006 16:40:29 PAGE 8
427 3 }
428 2 }
429 1
430 1 }
431
432
433 void dispColorG(uint16 row,col,uint8 colorMode)
434 {
435 1 //white 0xff,0xff
436 1 //red 0xf8,0x00
437 1 //green 0x07,0xe0
438 1 //blue 0x00,0x1f
439 1
440 1 uint16 i,j;
441 1
442 1 setColorMode(colorMode);
443 1
444 1 comm_out(0x5c); // Write Display Data
445 1 for(i=0;i<row;i++)
446 1 {
447 2 for(j=0;j<col;j++)
448 2 {
449 3 data_out( (0x07+(j/4)*8),(0xe0+j/4) );
450 3
451 3 }
452 2 }
453 1
454 1
455 1 }
456
457 void dispGraphic_8(uint16 row,col,uint8 colorMode,uint8 code *Graphic,uint8 F_RGB1,F_RGB2,B_RGB1,B_RGB2)
458 {
459 1 uint8 n, i,j,k;
460 1 uint8 tempGraphic;
461 1
462 1 setColorMode(colorMode);
463 1 //p64kd
464 1 comm_out(0x5c); // Write Display Data
465 1 for(n=0;n<row/8;n++)
466 1 {
467 2 for(i=0;i<8;i++)
468 2 {
469 3
470 3 for(j=0;j<col/8;j++)
471 3 {
472 4 tempGraphic = Graphic[i];
473 4 for(k=0;k<8;k++)
474 4 {
475 5 if(((tempGraphic)&(0x80))!= 0)
476 5 {
477 6 data_out(F_RGB1,F_RGB2);
478 6
479 6 }else
480 5 {
481 6 data_out(B_RGB1,B_RGB2);
482 6 }
483 5 tempGraphic = tempGraphic << 1;
484 5 }
485 4 }
486 3 }
487 2 }
488 1
C51 COMPILER V7.09 FUN_16 02/16/2006 16:40:29 PAGE 9
489 1
490 1
491 1 }
492
493
494
495 void dispGraphic_16(uint16 row,col,uint8 colorMode,uint8 code *Graphic,uint8 F_RGB1, F_RGB2,B_RGB1,B_RGB2)
496 {
497 1 uint8 n, i,j,k;
498 1 uint8 tempGraphic;
499 1
500 1 setColorMode(colorMode);
501 1
502 1 comm_out(0x5c); // Write Display Data
503 1 //p64kd
504 1 for(n=0;n<row/16;n++)
505 1 {
506 2 for(i=0;i<16;i++)
507 2 {
508 3
509 3 for(j=0;j<col/16;j++)
510 3 {
511 4 tempGraphic = Graphic[i*2];
512 4 for(k=0;k<8;k++)
513 4 {
514 5 if(((tempGraphic)&(0x80))!= 0)
515 5 {
516 6 data_out(F_RGB1,F_RGB2);
517 6
518 6 }else
519 5 {
520 6 data_out(B_RGB1,B_RGB2);
521 6 }
522 5 tempGraphic = tempGraphic << 1;
523 5 }
524 4
525 4 tempGraphic = Graphic[i*2+1];
526 4 for(k=0;k<8;k++)
527 4 {
528 5 if(((tempGraphic)&(0x80))!= 0)
529 5 {
530 6 data_out(F_RGB1,F_RGB2);
531 6
532 6 }else
533 5 {
534 6 data_out(B_RGB1,B_RGB2);
535 6 }
536 5 tempGraphic = tempGraphic << 1;
537 5 }
538 4 }
539 3 }
540 2 }
541 1
542 1
543 1 }
544
545 void setDuty(uint8 i)
546 {
547 1
548 1 comm_out(0xca); // select duty
549 1 data_out(0,0);
550 1 data_out(0,i/4-1);
C51 COMPILER V7.09 FUN_16 02/16/2006 16:40:29 PAGE 10
551 1 data_out(0,0);
552 1
553 1
554 1 }
555
556
557 void setBias(uint8 bias)
558 {
559 1 //0-1/7,1-1/8,2-1/9,3-1/10
560 1
561 1 comm_out(0xFB); // set bias
562 1 data_out(0,bias);
563 1
564 1 }
565
566 void setContrast(uint8 x,y)
567 {
568 1 comm_out(0x81); // set contrast and internal Regulator resistor ratio
569 1 data_out(0,x);
570 1 data_out(0,y); // 14.5v
571 1 }
572
573
574
575 /****************************************************************************
576 ** End Of File
577 *****************************************************************************/
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 2457 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 146
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -