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

📄 audio.lst

📁 显示屏驱动源代码
💻 LST
📖 第 1 页 / 共 2 页
字号:
                      }
                      #endif
                      AudioOn();                      //SetMSPVol();
              #else
 270   1              switch(GetInputSelection())
 271   1              {
 272   2      #ifdef SUPPORT_TV
                      case TV:
                              P2_1 = 0; // A0 of 4052B
                              P2_2 = 0; // A1 of 4052B
                              break;
              #endif          
 278   2      #ifdef SUPPORT_PC
 279   2              case PC:
 280   2                      P2_1 = 0; // A0 of 4052B
 281   2                      P2_2 = 1; // A1 of 4052B
 282   2                      break;  
 283   2      #endif          
 284   2              default:        
 285   2                      P2_1 = 1; // A0 of 4052B
 286   2                      P2_2 = 0; // A1 of 4052B
 287   2                      break;  
 288   2              }
 289   1      #endif
 290   1      }
 291          
 292          #ifdef SUPPORT_PC
 293          /*
 294          void PCAudio(void)
 295          {
 296                  BYTE mspdata[5], loop=0;
 297                  WORD ret;
 298          
 299                  AudioOff();
 300          
 301                  mspdata[0] = 0x10;
 302                  mspdata[1] = 0x00;
C51 COMPILER V7.06   AUDIO                                                                 02/21/2008 14:00:31 PAGE 6   

 303                  mspdata[2] = 0x30;                              // MODUS register: Automatic-on
 304                  mspdata[3] = 0x20;
 305                  mspdata[4] = 0x03;
 306                  WriteI2Cn_(MSPI2CAddress, mspdata, 5);
 307          
 308                  mspdata[0] = 0x12;
 309                  mspdata[1] = 0x00;
 310                  mspdata[2] = 0x13;                              // SCART switch
 311                  mspdata[3] = 0x02;                              // SCART2->DSP
 312                  mspdata[4] = 0x00;                              
 313                  WriteI2Cn_(MSPI2CAddress, mspdata, 5);
 314          
 315                  mspdata[0] = 0x12;
 316                  mspdata[1] = 0x00;
 317                  mspdata[2] = 0x08;                              // source select
 318                  mspdata[3] = 0x02;                              // SCART input
 319                  mspdata[4] = 0x20;                              // stereo(transparent)
 320                  WriteI2Cn_(MSPI2CAddress, mspdata, 5);
 321          
 322                  mspdata[0] = 0x12;
 323                  mspdata[1] = 0x00;
 324                  mspdata[2] = 0x0d;                              // SCART input prescale
 325                  mspdata[3] = 0x50;
 326                  mspdata[4] = 0x00;
 327                  WriteI2Cn_(MSPI2CAddress, mspdata, 5);
 328          
 329                  ret = AudioAutoStdDetection();
 330          
 331                  #ifdef DEBUG_AUDIO
 332                  if( !ret ) {
 333                          Puts("\r\n--Fail to Audio AutoDetect");
 334                  }
 335                  #endif
 336                  AudioOn();                      //SetMSPVol();
 337          }
 338          */
 339          #endif
 340          
 341          BYTE GetAudioVol(void)
 342          {
 343   1              return AudioVol;
 344   1      }
 345          
 346          BYTE ChangeVol(char amount)
 347          {
 348   1              BYTE chg=0;
 349   1      
 350   1              CheckAndClearMuteOn();
 351   1      
 352   1              if( amount>0 ) {
 353   2                      if( ((AudioVol+amount) <= UserRange.Max) ) 
 354   2                              chg=1;
 355   2              }
 356   1              else {
 357   2                      if( AudioVol>UserRange.Min  ) 
 358   2                              chg=1;
 359   2              }
 360   1      
 361   1              if( chg ) {
 362   2                      AudioVol += amount;
 363   2                      SetAudioVolEE( AudioVol );
 364   2                      SetMSPVol();
C51 COMPILER V7.06   AUDIO                                                                 02/21/2008 14:00:31 PAGE 7   

 365   2              }
 366   1      
 367   1              return AudioVol;
 368   1      }
 369          
 370          #ifdef SUPPORT_MSP_AUDIO
              BYTE GetAudioBalance(void)
              {
                      return AudioBalance;
              }
              
              BYTE ChangeBalance(char amount)
              {
                      BYTE chg=0;
              
                      if( amount>0 ) {
                              if( ((AudioBalance+amount) <= UserRange.Max) ) {
                                      chg=1;
                              }
                      }
                      else {
                              if( AudioBalance>UserRange.Min  ) {
                                      chg=1;
                              }
                      }
              
                      if( chg ) {
                              AudioBalance += amount;
                              SetAudioBalanceEE( AudioBalance );
                              SetMSPBalance();
                      }
              
                      return AudioBalance;
              }
              
              BYTE GetAudioBass(void)
              {
                      return AudioBass;
              }
              
              BYTE ChangeBass(char amount)
              {
                      BYTE chg=0;
              
                      if( amount>0 ) {
                              if( ((AudioBass+amount) <= UserRange.Max) ) {
                                      chg = 1;
                              }
                      }
                      else {
                              if( AudioBass>UserRange.Min  ) {
                                      chg = 1;
                              }
                      }
              
                      if( chg ) {
                              AudioBass += amount;
                              SetAudioBassEE( AudioBass );
                              SetMSPBass();
                      }
              
                      return AudioBass;
C51 COMPILER V7.06   AUDIO                                                                 02/21/2008 14:00:31 PAGE 8   

              }
              
              BYTE GetAudioTreble(void)
              {
                      return AudioTreble;
              }
              
              BYTE ChangeTreble(char amount)
              {
                      BYTE chg=0;
              
                      if( amount>0 ) {
                              if( ((AudioTreble+amount) <= UserRange.Max) ) {
                                      chg = 1;
                              }
                      }
                      else {
                              if( AudioTreble>UserRange.Min  ) {
                                      chg = 1;
                              }
                      }
              
                      if( chg ) {
                              AudioTreble += amount;
                              SetAudioTrebleEE( AudioTreble );
                              SetMSPTreble();
                      }
              
                      return AudioTreble;
              }
              
              /*
              
              BYTE GetAudioEffect(void)
              {
                      return AudioEffect;
              }
              
              BYTE ChangeAudioEffect(char amount)
              {
                      BYTE valdata[5];
              
                      amount = 0;                     //ignore
                      AudioEffect = 0xff - AudioEffect;
              
                      valdata[0] = 0x12;
                      valdata[1] = 0;
                      valdata[2] = 5;
                      valdata[3] = AudioEffect;
                      valdata[4] = 0;
                      WriteI2Cn_(MSPI2CAddress, valdata, 5);
              
                      SetAudioEffectEE( AudioEffect );
                      return AudioEffect;
              }
              */
              #endif
 484          
 485          void ToggleAudioMute(void)
 486          {
 487   1              if( AudioMuteOn ) {
 488   2                      AudioOn();                      //SetMSPVol();
C51 COMPILER V7.06   AUDIO                                                                 02/21/2008 14:00:31 PAGE 9   

 489   2                      AudioMuteOn = 0;
 490   2              }
 491   1              else {
 492   2                      AudioOff();
 493   2                      AudioMuteOn = 1;
 494   2              }
 495   1      }
 496          
 497          void CheckAndClearMuteOn(void)
 498          {
 499   1              if( AudioMuteOn ) {
 500   2                      AudioOn();                      //SetMSPVol();
 501   2                      AudioMuteOn = 0;
 502   2                      ClearMuteInfo();
 503   2              }
 504   1      }
 505          
 506          /*void SetAudioMute(BYTE on )
 507          {
 508                          AudioMuteOn = on;
 509          }
 510          */
 511          BYTE IsAudioMuteOn(void)
 512          {
 513   1              return (BYTE)AudioMuteOn;
 514   1      }
 515          
 516          void ResetAudioValue()
 517          {
 518   1              SetAudioVolEE( 50 );
 519   1      #ifdef SUPPORT_MSP_AUDIO        
                      SetAudioBalanceEE( 50 );
                      SetAudioBassEE( 50 );
                      SetAudioTrebleEE( 50 );
              //      SetAudioEffectEE( 0 );
              #endif
 525   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    210    ----
   CONSTANT SIZE    =      6    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----       4
   DATA SIZE        =      1    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      2    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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