📄 t100.lst
字号:
525 void OSDDrawGauge(uCHAR cVal, uCHAR x, uCHAR y, uCHAR cColor);
526 void LoadFont(void);
527 void LoadMenu(void);
528 void ShowOSDData(void);
529 void LoadData(void);
530 void SaveData(void);
531 void InitOSD(void)
532 {
533 1 LoadFont();
534 1 LoadMenu();
535 1 LoadData();
536 1 ShowOSDData();
537 1 OSDDisable();
538 1 }
539 void LoadFont(void)
540 {
541 1 unsigned int i;
542 1 StartCondition();
543 1 Send_Byte(0x50);
544 1 Send_Byte(0xA4);
545 1 for(i=0; i<35*18; i++){
546 2 Send_Byte(font_00[2*i]);
547 2 Send_Byte(font_00[2*i+1]);
548 2 }
549 1 //0xc00==1024*3;
550 1 for(; i<0x360; i++){
C51 COMPILER V7.06 T100 07/19/2005 18:02:54 PAGE 10
551 2 Send_Byte(0x00);
552 2 Send_Byte(0x00);
553 2 }//*/
554 1 StopCondition();
555 1 }
556 void LoadMenu(void)
557 {
558 1 uCHAR i;
559 1 for(i=0;i<4;i++)
560 1 {
561 2 OSDShowLine(iBlankLine,0,i,COL_NORMAL);
562 2 }
563 1 OSDShowLine(iBright_ICON,0,0,COL_NORMAL);
564 1
565 1 OSDShowLine(iColor_ICON,0,1,COL_NORMAL);
566 1
567 1 OSDShowLine(iScreen_ICON,0,2,COL_NORMAL);
568 1
569 1 OSDShowLine(iScreen_ICON,0,3,COL_NORMAL);
570 1
571 1 OSDShowLine(iFULL_ICON,LINE_LENGTH-2,3,COL_NORMAL);
572 1
573 1 OSDShowLine(i4_3_ICON,LINE_LENGTH-3,2,COL_NORMAL);
574 1 OSDDrawGauge(cColor,3,1,COL_GAUGE);
575 1 OSDDrawGauge(cBright,3,0,COL_GAUGE);
576 1 }
577 void ShowOSDData(void)
578 {
579 1 switch(cOSDFunc)
580 1 {
581 2 case 1:
582 2 OSDDrawGauge(cBright,3,0,COL_GAUGE);
583 2 break;
584 2 case 2:
585 2 OSDDrawGauge(cColor,3,1,COL_GAUGE);
586 2 break;
587 2 case 3: break;
588 2 }
589 1 }
590
591 void OSDSetRamAddr(int address)
592 {
593 1 I2CWriteByte(TW100,0xA3,(uCHAR)(address>>8));
594 1 I2CWriteByte(TW100,0xA2,(uCHAR)(address & 0xff));
595 1 }
596 void OSDShowLine(uCHAR *string,uCHAR x,uCHAR y,uCHAR cColor)
597 {
598 1 if((x < 30) && ( y < 0x28))
599 1 {
600 2 OSDSetRamAddr(MENU_START_ADDR+((int)y << 5)+x);
601 2 StartCondition();
602 2 Send_Byte(0x50);
603 2 Send_Byte(0xA4);
604 2 while((*string) != EOL && (x < LINE_LENGTH))
605 2 {
606 3 Send_Byte(*string++);
607 3 Send_Byte(cColor );
608 3 x++;
609 3 }
610 2 StopCondition();
611 2 }
612 1 }
C51 COMPILER V7.06 T100 07/19/2005 18:02:54 PAGE 11
613
614 void OSDDrawGauge(uCHAR cVal, uCHAR x, uCHAR y, uCHAR cColor)
615 {
616 1 uCHAR cTemp1,cTemp2,i=8;
617 1 cTemp1=cVal/2;
618 1 cTemp2=cVal%2;
619 1 OSDSetRamAddr(MENU_START_ADDR+((int)y << 5)+x);
620 1 StartCondition();
621 1 Send_Byte(0x50);
622 1 Send_Byte(0xA4);
623 1 while(i)
624 1 {
625 2 if(cTemp1==0)
626 2 {
627 3 if(i==8)Send_Byte(0x0A+cTemp2);
628 3 else if(i==1)Send_Byte(0x10+cTemp2);
629 3 else Send_Byte(0x0D+cTemp2);
630 3 Send_Byte(cColor);
631 3 i--;
632 3 break;
633 3 }
634 2 else
635 2 {
636 3 if(i==8)Send_Byte(0x0C);
637 3 else if(i==1)Send_Byte(0x12);
638 3 else Send_Byte(0x0F);
639 3 }
640 2 Send_Byte(cColor);
641 2 cTemp1--;
642 2 i--;
643 2 }
644 1 while(i)
645 1 {
646 2 if(i>1)Send_Byte(0x0D);
647 2 else Send_Byte(0x10);
648 2 Send_Byte(cColor);
649 2 i--;
650 2 }
651 1 StopCondition();
652 1 //Num
653 1 cTemp1=cVal/10;
654 1 cTemp2=cVal%10;
655 1 i=cVal/10;
656 1 /* cTemp1=(cVal%100)/10;
657 1 cTemp2=cVal%10;//*/
658 1 OSDSetRamAddr(MENU_START_ADDR+((int)(y) << 5)+(LINE_LENGTH-2));
659 1 StartCondition();
660 1 Send_Byte(0x50);
661 1 Send_Byte(0xA4);
662 1 if(i)Send_Byte(i+0x13);
663 1 else Send_Byte(BLANK);
664 1 Send_Byte(cColor);
665 1 Send_Byte(cTemp2+0x13);
666 1 Send_Byte(cColor);
667 1 StopCondition();
668 1
669 1 }
670 void OSDDisable(void)
671 {
672 1 I2CWriteTbl(OSDDisableTbl);
673 1 }
674 void OSDEnable(void)
C51 COMPILER V7.06 T100 07/19/2005 18:02:54 PAGE 12
675 {
676 1 uCHAR cTemp[8];
677 1 cTemp[0]=TW100;
678 1 cTemp[1]=5;
679 1 cTemp[2]=0xa0;
680 1 cTemp[3]=3;
681 1 cTemp[4]=Y_INC;
682 1 cTemp[5]=0x05;
683 1 cTemp[6]=23+(cOSDFunc-1);
684 1 if((cOSDFunc==3)&&bFULL_43)cTemp[6]+=1;
685 1 cTemp[7]=EOT;
686 1 I2CWriteTbl(cTemp);
687 1 cTemp[5]=0x1E;
688 1 I2CWriteTbl(cTemp);
689 1 I2CWriteTbl(OSDEnableTbl);
690 1 }
691 void OSDCtrl(char cDir)
692 {
693 1 uCHAR cTemp;
694 1 switch(cOSDFunc)
695 1 {
696 2 case 0: OSDDisable();return;
697 2 case 1:
698 2 if((cBright==0x10)&&(cDir==1))return;
699 2 if((cBright==0x00)&&(cDir==-1))return;
700 2 cBright+=cDir;
701 2 if(cBright<16)cTemp=cBright*16;
702 2 else cTemp=0xff;
703 2 I2CWriteByte(TW100,0x69,cTemp);
704 2 break;
705 2 case 2:
706 2 if((cColor==0xfc)&&(cDir==1))return;
707 2 if((cColor==0x00)&&(cDir==-1))return;
708 2 cColor+=cDir*4;
709 2 if(cColor<16)cTemp=cColor*16;
710 2 else cTemp=0xff;
711 2 I2CWriteByte(TW100,0x6c,cTemp);
712 2 break;
713 2 case 3:
714 2 if(Repeat_Times==0)return;
715 2 if(cDir)
716 2 {
717 3 bFULL_43=!bFULL_43;
718 3 SetMode();
719 3 }
720 2 break;
721 2 }
722 1 SaveData();
723 1 ShowOSDData();
724 1 OSDEnable();
725 1 }
726
727
728 void LoadData(void)
729 {
730 1 #ifdef NVRAM
#else
733 1 cBright=BRIGHT;
734 1 cColor=COLOR;
735 1 #endif
736 1 }
C51 COMPILER V7.06 T100 07/19/2005 18:02:54 PAGE 13
737 void SaveData(void)
738 {
739 1 #ifdef NVRAM
#endif
742 1 }
743 #endif
744 bit m_bBKPowerOn =1;
745 bit m_bKyPowerOn =1;
746 bit m_bChipPowerOn =1;
747 void PowerManage(void)
748 {
749 1 if(m_bKyPowerOn) //Power on
750 1 {
751 2 I2CWriteByte(TW100, 0xE0, I2CReadByte(TW100, 0xE0)|0x80);
752 2 //When power on chip, force to reset chip
753 2 m_bChipPowerOn=1;
754 2 Delay_ms(50);
755 2 OpenPanel();
756 2 if(!m_bBKPowerOn)
757 2 BL_EN=0;
758 2 // BKPower();
759 2 }
760 1 else //Forced Power Off
761 1 {
762 2 if(m_bChipPowerOn)
763 2 {
764 3 Delay_ms(50);
765 3 if(m_bBKPowerOn)
766 3 BL_EN=1;
767 3 // BKPower();
768 3 ClosePanel();
769 3 Delay_ms(100);
770 3 I2CWriteByte(TW100, 0xE0, I2CReadByte(TW100, 0xE0)&0x7F);
771 3 m_bChipPowerOn=0;
772 3 }
773 2 }
774 1 }
775
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 2184 ----
CONSTANT SIZE = 2437 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 14 40
IDATA SIZE = ---- ----
BIT SIZE = 8 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -