dsp3_if.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:6k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __DSP3_IF_H
  2. #define __DSP3_IF_H
  3. #include "types.h"
  4. #include "func.h"
  5. #include "regmap.h"
  6. #include "dsp3_def.h"
  7. void dsp3_hw_reset(void);
  8. void dsp3_stop(void);
  9. void dsp3_download(const BYTE *DspRom, int DspRomLen);
  10. int     dsp3_mp3init(const void *DspRom, unsigned DspRomLen);
  11. void    set_aud_buf(unsigned a, unsigned b, unsigned c);
  12. void reset_audio_buf();
  13. void set_dsp3_pcm_value(unsigned x_off, unsigned value);
  14. UINT32 get_dsp3_pcm_value(unsigned x_off);
  15. int     dsp3_get_rest_buf_size();
  16. #if 0 //2004AUDDRV move to auddrv.h
  17. #define dsp3_ramp_down(x)
  18. do {
  19. regs0->aud_pcm_ramp_delta = 1;
  20. regs0->aud_pcm_ramp_cfg = 1;
  21. } while (0)
  22. #define dsp3_ramp_up(x)
  23. do {
  24. regs0->aud_pcm_ramp_delta = 1;
  25. regs0->aud_pcm_ramp_cfg = 2;
  26. } while (0)
  27. //change dsp3_ramp_wait() method equals to to delay_srv_10ms(3) to prevent dead loop
  28. #define dsp3_ramp_wait() delay_srv_10ms(3)
  29. /*
  30. #define dsp3_ramp_wait()
  31. do {
  32. polling();
  33. } while (regs0->aud_pcm_ramp_value>0)
  34. */
  35. #endif //2004AUDDRV
  36. //============================
  37. //Audio Driver Service Provider Interface Function
  38. //============================
  39. //return: 0:fail, 1:success
  40. #ifdef SUPPORT_SOUND_EFFECT
  41. extern int AudioIOControl(UINT16 wCode, UINT32 cType, UINT32 wParam);
  42. #else
  43. extern int AudioIOControl(UINT16 wCode, BYTE cType, UINT16 wParam);
  44. #endif
  45. //return: -1: error, others
  46. extern int AudioIOStatus(UINT16 wCode);
  47. //============================
  48. //Audio Application Programming Interface Function
  49. //============================
  50. #if 0 //2004AUDDRV
  51. //Audio DSP flow control command
  52. extern int AudioSetPlay();      //AudioIOControl(FLOW, AUDIOPLAY, 0) for VCD
  53.                                 //AudioIOControl(FLOW, AUDIOPLAY, 1) for MP3(pure audio)
  54. extern int AudioSetContinue();  //AudioIOControl(FLOW, AUDIOCONTINUE, 0)
  55. extern int AudioSetStop();      //AudioIOControl(FLOW, AUDIOSTOP, 0)
  56. extern int AudioSetPause();     //AudioIOControl(FLOW, AUDIOPAUSE, 0)
  57. #define AudioFlushBuffer()        AudioIOControl(FLOW, AUDIOFLUSH, 0)
  58. #define AudioSetVCD_FF2PLAY()     AudioIOControl(FLOW, AUDIOFF2PLAY, 0)
  59. extern int AudioFastForward(BYTE speed);  //AudioIOControl(FLOW, AUDIOFFxx, 0)
  60. //Audio DSP set volume command
  61. #define AudioSetVolume(x)         AudioIOControl(VOLUME, x, 0)
  62. //freyman 2002-7-26 21:34
  63. #ifdef SUPPORT_AMP
  64. #undef AudioSetVolume(x)
  65. int AudioSetVolume(UINT16 x);
  66. #endif
  67. #if 0 //kennymark it 2002/2/29
  68. #if defined(TAS3001_AMP)  // jason ych add ti3001 2-8-10 11:36
  69. #undef AudioSetVolume(x)
  70. extern void set_volume(BYTE);
  71. #define AudioSetVolume(x)       set_volume(x)
  72. #endif 
  73. #endif
  74. //terry,0508 ,test audio whilt noise            
  75. #ifdef      NO_AUD_MIC_OFF
  76. #undef AudioSetVolume(x)
  77. int AudioSetVolume(UINT16 x);
  78.                         
  79. #endif
  80. #ifdef      NO_AUD_ECHO_OFF
  81. #undef AudioSetVolume(x)
  82. int AudioSetVolume(UINT16 x);
  83. #endif
  84. extern inline int AudioDemute();
  85. //Audio DSP key-shift control command
  86. //1~15
  87. #define AudioSetKey(x)            AudioIOControl(KEY, x, 0)
  88. //Audio DSP 3D-Surround control command
  89. //0:off, 1~..:type
  90. #define AudioSetSurround(x)       AudioIOControl(SURROUND, x, 0)
  91. //Audio DSP Sub-woof control command
  92. //0:OFF, 1:ON
  93. #define AudioSetSubWoof(x)        AudioIOControl(SUBWOOF, x, 0)
  94. //Audio DSP SPDIF control command
  95. //0:OFF, 1:PCM, 2:BITSTREAM
  96. #define AudioSetSPDIF(x)          AudioIOControl(SPDIF, x, 0)
  97. //Audio DSP set EQ type command
  98. //0:standard, 0x0010:user-defined
  99. #define AudioSetEQType(x)         AudioIOControl(EQ, x, 0)
  100. //Audio DSP Output Mode control command
  101. //0x01:Stereo(L/R), 0x02:L/L, 0x03:R/R, 0x04:Auto-L, 0x05:Auto-R, 0x06:5.1 channel, 0x07:2 channel, 0x08:DownMix Lx,Rx(for ProLogic)
  102. //0x10:RF_MODE-K3, 0x20:LINE_MODE-K2, 0x30:no vocal, 0x40:left vocal, 0x50:right vocal, 0x60:both vocal
  103. #define AudioSetOutputMode(x, y)     AudioIOControl(OUTMODE, x, y)
  104. //Audio DSP ECHO control command
  105. //level:0(off)  (light)1~8(heavy)
  106. #define AudioSetEcho(delay, decay)       AudioIOControl(ECHO, delay, decay)
  107. #ifdef USE_MIC_ECHO_PARAM
  108. int AudioSetEchoPara(UINT16 x);
  109. #endif
  110. //Audio DSP MIC control command
  111. //threshold://(0~0xff:0x55:for Yuxing, 0x35 for small board, 0x25 for large board)
  112. //sensitivity:(1~7:default=1)
  113. //always on:threshold=0, sensitivity=0
  114. //always off:threshold=0xff, sensitivity=0xff
  115. #define AudioSetMIC(threshold, sensitivity)    AudioIOControl(MIC, threshold, sensitivity)
  116. //Audio DSP MIC Vol(gain) control command
  117. //0~8(0:off)
  118. #define AudioSetMICVol(x)          AudioIOControl(AD, x, 0)
  119. #define AudioSetMICVol_2(x)    AudioIOControl(AD_2, x, 0) //wangfeng 2003-09-12 17:11
  120. //Jeff 20020129
  121. //Audio DSP Speaker Delay control command
  122. //spk : 1(center spk), 2(surround spk)
  123. //delay: time(ms)
  124. #define AudioSetSpkDelay(spk, delay)    AudioIOControl(SPKDELAY, spk, delay)
  125. //Audio DSP Front Speaker Gain control command
  126. //0~8(0:off)
  127. #define AudioSetFSPKGain(x)             AudioIOControl(FSPKGAIN, x, 0)
  128. //Audio DSP Center Speaker Gain control command
  129. //0~8(0:off)
  130. #define AudioSetCSPKGain(x)             AudioIOControl(CSPKGAIN, (x*2), 0)
  131. //Audio DSP Surround Speaker Gain control command
  132. //0~8(0:off)
  133. #define AudioSetSSPKGain(x)             AudioIOControl(SSPKGAIN, x, 0)
  134. #define AudioSet5SPKGain(s, x)          AudioIOControl(s, x, 0)
  135. #endif //#if 0 //2004AUDDRV
  136. #endif
  137. #if 0 //2004AUDDRV
  138. #ifdef  TEST_BASS_MANAGEMENT //Andew 20040803
  139.     #ifdef  TEST_BASS_COMMAND   
  140.         #define AudioSetBassMag(x)    AudioIOControl(BASSMANAGEMENT,0,x) 
  141.     #endif
  142. #endif
  143. #endif