⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 power_ctrl.lst

📁 TFT 17 2523+mtv512显示器源程序
💻 LST
📖 第 1 页 / 共 3 页
字号:
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE POWER_CTRL
OBJECT MODULE PLACED IN .\Output\Power_Ctrl.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Code\Power_Ctrl.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND CODE SYMBOLS 
                    -PRINT(.\Output\Power_Ctrl.lst) PREPRINT(.\Output\Power_Ctrl.i) OBJECT(.\Output\Power_Ctrl.obj)

stmt level    source

   1          #define __POWERCTRL__
   2          
   3          #include "Header\Lcd_main.h"
   4          #include "Header\access.h"
   5          #include "Header\config.h"
   6          #include "Header\Osd.h"
   7          #include "Header\Initial.h"
   8          #include "Header\Lcd_msg.h"
   9          #include "Header\Frame_Sync.h"
  10          #include "Header\Lcd_func.h"
  11          #include "Header\Font.h"
  12          
  13          
  14          void PowerDown_ADC(void)
  15          {
  16   1          RTDSetByte(PLL1_CTRL_D6, 0xf2);     // Power down PLL1
  17   1          RTDSetByte(PLL2_CTRL_DA, 0x40);     // Power down PLL2
  18   1          RTDSetByte(ADC_CTRL_E6, 0x40);      // Power down ADC
  19   1      }
  20          
  21          void PowerUp_ADC(void)
  22          {
  23   1          RTDSetByte(PLL1_CTRL_D6, 0xf3);     // Power up PLL1
  24   1          RTDSetByte(PLL2_CTRL_DA, 0x41);     // Power up PLL2
  25   1          RTDSetByte(ADC_CTRL_E6, 0x47);      // Power up ADC
  26   1      
  27   1      
  28   1          RTDSetByte(PLL2_FILTER_DD, 0x5f);
  29   1      
  30   1      }
  31          
  32          void PowerDown_TMDS(void)
  33          {
  34   1          RTDSetByte(TMDS_OUTPUT_ENA_A0, 0x0F);    
  35   1      }
  36          
  37          void PowerUp_TMDS(void)
  38          {
  39   1         RTDSetByte(TMDS_OUTPUT_ENA_A0, 0x8F);
  40   1      }
  41          
  42          
  43          void PowerDown_VDC(void)
  44          {
  45   1      #if (VIDEO_CHIP != VDC_NONE)
              
              #if(MCU_TYPE == MCU_WINBOND)
                  bVDC_PWR    = VDC_OFF;
              #else
                  MCU_WriteVideoPower(VDC_OFF);
              #endif
              
              #endif
  54   1      }
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 2   

  55          
  56          void PowerUp_VDC(void)
  57          {
  58   1      #if (VIDEO_CHIP != VDC_NONE)
              
              #if(MCU_TYPE == MCU_WINBOND)
                   bVDC_PWR    = VDC_ON;
              #else
                   MCU_WriteVideoPower(VDC_ON);
              #endif
              
              #endif
  67   1      }
  68          
  69          void PowerDown_LVDS(void)
  70          {
  71   1      #if (OUTPUT_BUS == LVDS_TYPE)
  72   1      RTDCodeW(LVDS_POWERDOWN);
  73   1      #endif
  74   1      }
  75          
  76          void PowerUp_LVDS(void)
  77          {
  78   1      #if (OUTPUT_BUS == LVDS_TYPE)
  79   1      RTDCodeW(LVDS_POWERUP);
  80   1      #endif
  81   1      }
  82          
  83          void Set_Panel(unsigned char status)
  84          {
  85   1          if (status)
  86   1          {
  87   2              PowerUp_LVDS();
  88   2                      //Device_Power(LVDS_POWER,ON);
  89   2      
  90   2              Delay_Xms(10);
  91   2      
  92   2      
  93   2              RTDSetByte(VDIS_SIGINV_21, 0x00 | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP);       // DHS, DVS, 
             -DEN, DCLK MUST NOT be inverted.
  94   2      
  95   2              RTDSetBit(VDIS_CTRL_20, 0xfd, 0x01);    // DHS, DVS, DEN, DCLK and data are clamped to 0
  96   2              Delay_Xms(20);
  97   2              RTDSetBit(VDIS_CTRL_20, 0xfe, 0x00);    // Stop display timing
  98   2              Delay_Xms(20);
  99   2      
 100   2      #if(MCU_TYPE == MCU_WINBOND)
 101   2              bPANEL_PWR  = PANEL_ON;
 102   2      #else
                      MCU_WritePanelPower(PANEL_ON);
              #endif
 105   2              bPanel_Status = _ON;
 106   2      
 107   2              
 108   2              Delay_Xms(40);
 109   2                      
 110   2      
 111   2      
 112   2              RTDSetByte(VDIS_SIGINV_21, DISP_INV | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP);       // DHS, D
             -VS, DEN, DCLK MUST NOT be inverted.
 113   2      
 114   2              RTDSetBit(VDIS_CTRL_20, 0xff, 0x03);    // DHS, DVS, DEN, DCLK in normal operation
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 3   

 115   2              
 116   2              RTDSetBit(DIS_TIMING0_3A, 0xff, 0x20);  // Force display timing enable
 117   2              RTDSetBit(DIS_TIMING0_3A, 0xdf, 0x00);  // Stop forcing
 118   2      
 119   2              //Delay_Xms(200);
 120   2              //Delay_Xms(200);
 121   2              Load_VLC_Font(Font_Global, 0x00, 0xa1);
 122   2              if( (stGUD1.FUNCTION & 0x07) == JAPANESS )
 123   2              {
 124   3                      Load_VLC_Font(Font_East_J, 0x573, 0x4B);
 125   3              }
 126   2              else
 127   2              {
 128   3                      Load_VLC_Font(Font_East_C, 0x5a9, 0x45);
 129   3              }
 130   2              Load_VLC_Font(Font_Icons, 0x828, 0x70);
 131   2              Load_VLC_Font(Font_add, 0x20a, 0x06);                           //anson   3A(addr)  x  9  = 20A
 132   2                                                                                                                      //   12 x18 / 8 /3 = 9
 133   2              RTDSetByte(STATUS0_01, 0x00);  // Write once to clear status
 134   2              RTDSetByte(STATUS1_1F, 0x00);  // Write once to clear status
 135   2      
 136   2              
 137   2      #if(MCU_TYPE == MCU_WINBOND)
 138   2              bLIGHT_PWR  = LIGHT_ON;
 139   2      #else
                      MCU_WriteBacklightPower(LIGHT_ON);
              #endif
 142   2      
 143   2          }
 144   1          else
 145   1          {
 146   2      #if(MCU_TYPE == MCU_WINBOND)
 147   2              bLIGHT_PWR  = LIGHT_OFF;
 148   2      #else
                      MCU_WriteBacklightPower(LIGHT_OFF);
              #endif
 151   2      
 152   2              Delay_Xms(120);
 153   2      
 154   2              RTDOSDW(OSD_Reset);
 155   2      
 156   2      
 157   2              RTDSetByte(VDIS_SIGINV_21, 0x00 | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP);       // DHS, DVS, 
             -DEN, DCLK MUST NOT be inverted.
 158   2      
 159   2              RTDSetBit(VDIS_CTRL_20, 0xfd, 0x01);    // DHS, DVS, DEN, DCLK and data are clamped to 0
 160   2              Delay_Xms(20);
 161   2              RTDSetBit(VDIS_CTRL_20, 0xfe, 0x00);    // Stop display timing
 162   2              Delay_Xms(20);
 163   2      #if(MCU_TYPE == MCU_WINBOND)     
 164   2              bPANEL_PWR  = PANEL_OFF;
 165   2      #else
                      MCU_WritePanelPower(PANEL_OFF);
              #endif
 168   2              bPanel_Status = _OFF;
 169   2              Delay_Xms(40);
 170   2      
 171   2              PowerDown_LVDS();
 172   2                      //Device_Power(LVDS_POWER,OFF);
 173   2          }
 174   1      }
 175          
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 4   

 176                      //////////////////////
 177                      // Power Controller //
 178                      //////////////////////
 179          bit Power_Control(unsigned char Notify)
 180          {
 181   1                  if (0 == bPower_Status)
 182   1                  {
 183   2      
 184   2                      if (NOTIFY_POWERUP == Notify)
 185   2                      {
 186   3                          bPower_Status   = 1;
 187   3      
 188   3                          Power_Up_Init();
 189   3                          ISP_Check_Sum();
 190   3      
 191   3                          bStable     = 0;                    // Assume input signal is not stable when power up
 192   3                          bReload     = 1;                    // Always reload font when power up
 193   3                          bFrameSync  = 0;                    // Not sync yet
 194   3                          ucModeCnt   = MODE_DETECT_FREQ;     // Reset Input Mode Detector
 195   3                          
 196   3                          Measure_Mode();                     // Measure mode-timing
 197   3                          Set_Task(STATE_POWERUP);            // Notify Task State Machine
 198   3      #if (RTDDEBUG)
                                  ucMode_PrevAct  = MODE_NOSIGNAL;
                                  ucMode_QuitCnt  = 0;
                                  ucDebug         = 0;
              #endif
 203   3      
 204   3      #if (POWER_KEY_TYPE == TYPE_ONE_TOUCH)
 205   3                          // Save power status when power-key is one-touch type
 206   3                          stGUD1.FUNCTION &= 0xf7;
 207   3                          Save_GUD1();
 208   3                          Delay_Xms(10);
 209   3      #endif
 210   3                      }
 211   2      
 212   2                      bNotify_Timer0_Int  = 0;
 213   2      
 214   2      //               continue;   // leave current iteration.
 215   2                       return _TRUE;
 216   2                  }
 217   1                  else if (NOTIFY_POWERDOWN == Notify)
 218   1                  {
 219   2      #if (POWER_KEY_TYPE == TYPE_ONE_TOUCH)
 220   2                      // Save power status when power-key is one-touch type
 221   2                      stGUD1.FUNCTION |= 0x08;
 222   2                      Save_GUD1();
 223   2                      Delay_Xms(10);
 224   2      #endif
 225   2                      bPower_Status   = 0;
 226   2      
 227   2                      Set_Panel(0);                   // Turn off panel
 228   2                      SetMute(0);
 229   2      
 230   2                      RTDSetByte(HOSTCTRL_02, 0x42);  // Set RTD to power-saving
 231   2      
 232   2                      I2CWrite(V_DISABLE);
 233   2      
 234   2                      PowerDown_ADC();
 235   2                      PowerDown_VDC();
 236   2                      PowerDown_TMDS();
 237   2                                      
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 5   

 238   2      
 239   2                      Delay_Xms(250);
 240   2                      Delay_Xms(250);
 241   2                      Delay_Xms(250);
 242   2                      Delay_Xms(250);
 243   2                      Delay_Xms(250);
 244   2      
 245   2                      Set_Task(STATE_POWERDOWN);      // Notify Task State Machine
 246   2      
 247   2                      bNotify_Timer0_Int  = 0;
 248   2      
 249   2                      //continue;   // leave current iteration.
 250   2                                      return _TRUE;
 251   2                  }
 252   1                              return _FALSE;
 253   1      }
C51 COMPILER V7.06   POWER_CTRL                                                            11/21/2005 13:47:42 PAGE 6   

ASSEMBLY LISTING OF GENERATED OBJECT CODE


             ; FUNCTION PowerDown_ADC (BEGIN)
                                           ; SOURCE LINE # 14
                                           ; SOURCE LINE # 15
                                           ; SOURCE LINE # 16
0000 7DF2              MOV     R5,#0F2H

⌨️ 快捷键说明

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