main.lst

来自「NOVATEK公司的LCD_CONTROLLER源代码 液晶显示器驱动板源代码N」· LST 代码 · 共 1,392 行 · 第 1/5 页

LST
1,392
字号
  78      =1  #define OSD_RBy1 (PanelHeight - (12 * OSD_ZoomY * OSD_WIDTH))
  79      =1  //
  80      =1  #define OSD2_CCx (PanelWidth - (12 * OSD_ZoomX * OSD2_WIDTH)) / 2
  81      =1  #define OSD2_CCy (PanelHeight - (18 * OSD_ZoomY * OSD2_HIGHT)) / 2
  82      =1  #define OSD2_CCx1 (PanelWidth - (18 * OSD_ZoomX * OSD2_HIGHT)) / 2
  83      =1  #define OSD2_CCy1 (PanelHeight - (12 * OSD_ZoomY * OSD2_WIDTH)) / 2
  84      =1  #define OSD2_RBx (PanelWidth - (12 * OSD_ZoomX * OSD2_WIDTH))
  85      =1  #define OSD2_RBy (PanelHeight - (18 * OSD_ZoomY * OSD2_HIGHT))
  86      =1  //
  87      =1  #define OSD3_Px (PanelWidth - (12 * 2 * OSD3_WIDTH))
  88      =1  #define OSD3_Py 0
  89      =1  
  90      =1  extern code unsigned char IconPosition[];
  91      =1  extern code unsigned char ClearLine1[];
  92      =1  extern code unsigned char ClearLine2[];
  93      =1  extern code unsigned char ClearLine3[];
  94      =1  extern code unsigned char MenuItem[];
  95      =1  extern code unsigned char *SourceTab[];
  96      =1  
  97      =1  void OsdInit(void);
  98      =1  void Osd2Init(void);
  99      =1  void Osd3Init(void);
 100      =1  void Osd4Init(void);
 101      =1  void LoadFont(void);
 102      =1  void ShowMainMenu(void);
 103      =1  void MainMenu(void);
 104      =1  void ClearOSD(void);
 105      =1  void OSD_OFF(void);
 106      =1  void ShowSubMenu(void);
 107      =1  void ValueUp(void);
 108      =1  void ValueDown(void);
 109      =1  void ShowT_Bar(void);
 110      =1  void ShowBrightness(void);
 111      =1  void ShowContrast(void);
 112      =1  void ShowClock(void);
 113      =1  void ShowPhase(void);
 114      =1  void ShowHP(void);
 115      =1  void ShowVP(void);
 116      =1  void ShowNO_YES(unsigned char i);
 117      =1  void SetPosition(void);
 118      =1  void ShowVersion(void);
 119      =1  void ClearText(void);
 120      =1  void ShowOutOfRange(void);
 121      =1  void ShowNoSync(void);
 122      =1  void ShowDisconnector(void);
 123      =1  void SaveData(void);
 124      =1  void ShowAutoAdj1(void);
 125      =1  void ShowAutoAdj(void);
 126      =1  void ShowRGB(void);
 127      =1  void ShowOSD_X(void);
 128      =1  void ShowOSD_Y(void);
 129      =1  void ShowOSD_Timer(void);
 130      =1  void ShowColorTemperature(void);
 131      =1  void ShowLanguage(void);
 132      =1  void SelectItem(void);
 133      =1  void WriteSequenceScaler(unsigned char addr,unsigned char *p);
 134      =1  void WriteStringScaler(unsigned char Attr,unsigned char *p);
 135      =1  void WriteXY_StrScaler(unsigned char Attr,unsigned char x,unsigned char y,unsigned char *p);
 136      =1  void FillLineAttr(unsigned char x,unsigned char y,unsigned char l,unsigned short Attr);
C51 COMPILER V7.20   MAIN                                                                  09/14/2004 12:21:01 PAGE 15  

 137      =1  void UnselectIcon(void);
 138      =1  void WriteXY_CStrScaler(unsigned char Attr,unsigned char x,unsigned char y,unsigned char w,unsigned char *
             -p);
 139      =1  void CheckRGB(void);
 140      =1  void ShowMisceMenu(void);
 141      =1  void ShowInverter(void);
 142      =1  void ShowSaturation(void);
 143      =1  void ShowTint(void);
 144      =1  void ShowSharpness(void);
 145      =1  void SetMovePosition(void);
 146      =1  void ShowVolume();
 147      =1  void DirectVolume();
 148      =1  void ShowValue(unsigned char Attr,unsigned char value);
 149      =1  void ShowSliderBar(unsigned char x,unsigned char y,unsigned char value);
 150      =1  void ShowFreq(void);
 151      =1  void ShowResolution(void);
 152      =1  void ShowNum(unsigned char Attr,unsigned char xx,unsigned char yy,unsigned char value);
 153      =1  void ShowInputSource(void);
 154      =1  void VideoMenu(void);
 155      =1  void ShowVideoMenu(void);
 156      =1  void ShowVideoSubMenu(void);
 157      =1  void VideoValueUp(void);
 158      =1  void VideoValueDown(void);
 159      =1  void VideoUnSelectIcon(void);
 160      =1  void VideoSelectItem(void);
 161      =1  
 162      =1  enum{
 163      =1          NotSaveSaveFlag,
 164      =1          BrightnessSaveFlag,
 165      =1          ContrastSaveFlag,
 166      =1          ClockSaveFlag,
 167      =1          PhaseSaveFlag,
 168      =1          HP_SaveFlag,
 169      =1          VP_SaveFlag,
 170      =1          //ColorTempSaveFlag, /*调整函数中自己更新EEPAM */
 171      =1          R_GainSaveFlag,
 172      =1          G_GainSaveFlag,
 173      =1          B_GainSaveFlag,
 174      =1          VolumeSaveFlag,
 175      =1          //LanguageSaveFlag,  /*调整函数中自己更新EEPAM */
 176      =1          OSD_X_SaveFlag,
 177      =1          OSD_Y_SaveFlag,
 178      =1          OSD_TimerSaveFlag,
 179      =1          SaturationSaveFlag,
 180      =1          TintSaveFlag,
 181      =1          SharpnessSaveFlag,
 182      =1          InverterSaveFlag,
 183      =1          Osd_ControlSaveFlag  //OSD_RotationSaveFlag,OSD_FlipSaveFlag,OSD_MirrorSaveFlag 
 184      =1          
 185      =1  };
 186      =1  
 187      =1  /* VGA MENU NODE INDEX*/
 188      =1  enum{
 189      =1          BrightnessNode,
 190      =1          ContrastNode,
 191      =1          PhaseNode,
 192      =1          ClockNode,
 193      =1          HP_Node,
 194      =1          VP_Node,
 195      =1          RecallNode,
 196      =1          ColorTempNode,
 197      =1          R_GainNode,
C51 COMPILER V7.20   MAIN                                                                  09/14/2004 12:21:01 PAGE 16  

 198      =1          G_GainNode,
 199      =1          B_GainNode,
 200      =1          LanguageNode,
 201      =1          MisceNode,
 202      =1          ExitMainMenuNode,
 203      =1          ExitMisceMenuNode,
 204      =1          OSD_X_Node,
 205      =1          OSD_Y_Node,
 206      =1          OSD_TimerNode,
 207      =1          OSD_RotationNode,
 208      =1          OSD_FlipNode,
 209      =1          OSD_MirrorNode,
 210      =1          AutoColorNode,
 211      =1          SaturationNode,
 212      =1          TintNode,
 213      =1          SharpnessNode
 214      =1  };      
 215      =1  
 216      =1  
 217      =1  /* AV MENU NODE INDEX*/
 218      =1  enum{
 219      =1          AvBrightnessNode,
 220      =1          AvContrastNode,
 221      =1          AvSaturationNode,
 222      =1          AvTintNode,
 223      =1          AvSharpnessNode,
 224      =1          AvLanguageNode,
 225      =1          AvRecallNode,
 226      =1          AvOSD_X_Node,
 227      =1          AvOSD_Y_Node,
 228      =1          AvOSD_TimerNode,
 229      =1          AvExitMainMenuNode
 230      =1  };      
 231      =1  
 232      =1  #endif
  12          #include "AutoAdj.H"
   1      =1  #ifndef _AutoAdj_H_
   2      =1  #define _AutoAdj_H_
   3      =1  
   4      =1  void AutoTune(void);
   5      =1  void AutoPosition(void);
   6      =1  void AutoClock(void);
   7      =1  void AutoPhase(void);
   8      =1  void AutoPhaseFineTune(void);
   9      =1  void SetADC_Offset(unsigned char OffSet);
  10      =1  void SetADC_Gain(unsigned char OffSet);
  11      =1  void WriteADC_Offset(unsigned char r,unsigned char g,unsigned char b);
  12      =1  void AutoColor(void);
  13      =1  ///////////////////////////////////////////////////////////////////////////////
  14      =1  void CheckRCV(void);
  15      =1  void RcvError(void);
  16      =1  void CheckCmd(unsigned char i);
  17      =1  void ReadHistogram(void);
  18      =1  void AutoClockByPhase(bit h);
  19      =1  unsigned long CheckPhaseData(void);
  20      =1  
  21      =1  #endif
  13          #include "sRGB.H"
   1      =1  
   2      =1  #ifndef _sRGB_H_
   3      =1  #define _sRGB_H_
   4      =1  
C51 COMPILER V7.20   MAIN                                                                  09/14/2004 12:21:01 PAGE 17  

   5      =1  int sine(unsigned char alpha);
   6      =1  int cosine(unsigned char alpha);
   7      =1  void product(int *first, int * second, int *result);
   8      =1  void sRGB(void);
   9      =1  
  10      =1  #endif
  14          #include "SAA7114.H"
   1      =1  #ifndef _SAA7114_H_
   2      =1  #define _SAA7114_H_
   3      =1  
   4      =1  #define SAA7114 0x42
   5      =1  
   6      =1  void SAA7114Init(void);
   7      =1  void WritePageSAA7114(unsigned char addr1,unsigned char addr2);
   8      =1  void CheckColorSystem(void);
   9      =1  void CheckVideo(void);
  10      =1  void SetVideoBrightness(void);
  11      =1  void SetVideoContrast(void);
  12      =1  void SetVideoSaturation(void);
  13      =1  void SetVideoTint(void);
  14      =1  void SetVideoSharpness(void);
  15      =1  void SetAV_System(void);
  16      =1  
  17      =1  #endif 
  15          
  16          void main(void);
  17          
  18          void main(void) using 0
  19          {
  20   1      ReStart:
  21   1              EA = 0;
  22   1              USB_CON = 0;
  23   1              InitMCU();
  24   1              CLRWDT = 0x55;
  25   1              flag1 = 0;
  26   1              flag2 = 0;
  27   1              OSD_Type = 0;
  28   1              KeyBuffer = 0xff;
  29   1              Timer3 = 10;
  30   1      //check +5Vcc
  31   1              while(Timer3 != 0){
  32   2                      ResetOn();
  33   2                      Sleep(12);
  34   2                      ResetOff();
  35   2                      Sleep(12);
  36   2                      ADC_CON = 0x17;         //Channel;  // Start AD Convert
  37   2                      ADC_CON = 0x97;         //Channel;  // Start AD Convert
  38   2                      while((ADC_REG[3] & BIT_7) == 0){};
  39   2                      if((ADC_REG[2] & 0x7f) < 0x38){
  40   3                              Timer3 = 25;
  41   3                      }
  42   2              }
  43   1      //
  44   1              Sleep(50);
  45   1              if(Read24C16(0xe8) != 0x55){
  46   2                      if((flag3 & BIT_2) != 0x00)
  47   2                              printf("1. Reload EEPROM Data\r\n");
  48   2                      InitEEPROM();
  49   2              }
  50   1              if(Read24C16(0xe9) != 0xaa){
  51   2                      if((flag3 & BIT_2) != 0x00)
  52   2                              printf("2. Reload EEPROM Data\r\n");
C51 COMPILER V7.20   MAIN                                                                  09/14/2004 12:21:01 PAGE 18  

  53   2                      InitEEPROM();
  54   2              }
  55   1              if(Read24C16(0xea) != Version){
  56   2                      if((flag3 & BIT_2) != 0x00)
  57   2                              printf("3. Reload EEPROM Data\r\n");
  58   2                      ResetEEPROM();
  59   2              }
  60   1              if(Read24C16(0xeb) != Reversion){
  61   2                      if((flag3 & BIT_2) != 0x00)
  62   2                              printf("4. Reload EEPROM Data\r\n");
  63   2                      ResetEEPROM();
  64   2              }
  65   1              CheckDevice();
  66   1              LoadModeIndependentSettings();
  67   1              PanelPowerOn();
  68   1              InitScaler();
  69   1              LoadFont();
  70   1              OSD_Point1 = 0;
  71   1              OSD_Point2 = 0;
  72   1              OSD_Type = 0;
  73   1              OsdInit();
  74   1              if((flag3 & BIT_2) != 0x00)
  75   1                      printf("Start Program\r\n");
  76   1              SyncMode = 0;
  77   1              PoSvTimer = 500;
  78   1              Timer2 = (unsigned short)OSD_Timer * 100;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?