samp_sdm_exp.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
源码类别:

DVD

开发平台:

Others

  1. /*
  2. file: samp_sdm_exp.c
  3. decription: implements SAMP sdm APIs for use by UI task.
  4. */
  5. #include "config.h"
  6. #ifdef TEST_HARNASS // for test only.//////////////////////////////////////////////////////////////////////////////////
  7. #include "IncludeSysDefs.h"
  8. #include "playcoresampsamp_gen.h"
  9. #include "playcoresampsamp_sdm.h"
  10. #include "playcoresampschedulersamp_api.h"
  11. void SAMP_EXP(SDM_GetHandler)(SAMP(SDM_PVoidFuncDef) *ph)
  12. {
  13.      SAMP(ErrCode) err;
  14.      SAMP_API_PARAM[0] = (UINT32)ph ;
  15.      SAMP_APICallRequest (SDM_GETHANDLER, &err);
  16.      return err;
  17. }
  18. SAMP(ErrCode) SAMP_EXP(SDM_SetEngineType)(SAMP(SDM_EngineTypeDef) Engine)
  19. {
  20.      SAMP(ErrCode) err;
  21.      SAMP_API_PARAM[0] = (UINT32)Engine ;
  22.      SAMP_APICallRequest (SDM_SETENGINETYPE, &err);
  23.      return err;
  24. }
  25. SAMP(ErrCode) SAMP_EXP(SDM_SetDacPinning)
  26.   ( SAMP(SDM_DataLineDef) PcmLine0
  27.   , SAMP(SDM_DataLineDef) PcmLine1
  28.   , SAMP(SDM_DataLineDef) PcmLine2
  29.   , SAMP(SDM_DataLineDef) PcmLine3
  30.   , SAMP(SDM_DataLineDef) PcmLine4
  31.   , SAMP(SDM_DataLineDef) PcmLine5
  32.   , SAMP(SDM_DataLineDef) PcmLine6
  33.   , SAMP(SDM_DataLineDef) PcmLine7
  34.   , SAMP(SDM_DataLineDef) PcmLine8
  35.   , SAMP(SDM_DataLineDef) PcmLine9
  36.   , SAMP(SDM_DataLineDef) PcmLine10
  37.   , SAMP(SDM_DataLineDef) PcmLine11
  38.   , SAMP(SDM_DataLineDef) DsdLine6
  39.   , SAMP(SDM_DataLineDef) DsdLine7
  40.   , SAMP(SDM_DataLineDef) DsdLine9)
  41. {
  42.      SAMP(ErrCode) err;
  43.      SAMP_API_PARAM[0] = (UINT32)((UINT32)PcmLine0 | ((UINT32)PcmLine1 << 8) | ((UINT32)PcmLine2 << 16) | ((UINT32)PcmLine3 << 24)) ;
  44.      SAMP_API_PARAM[1] = (UINT32)((UINT32)PcmLine4 | ((UINT32)PcmLine5 << 8) | ((UINT32)PcmLine6 << 16) | ((UINT32)PcmLine7 << 24)) ;
  45.      SAMP_API_PARAM[2] = (UINT32)((UINT32)PcmLine8 | ((UINT32)PcmLine9 << 8) | ((UINT32)PcmLine10 << 16) | ((UINT32)PcmLine11 << 24)) ;
  46.      SAMP_API_PARAM[3] = (UINT32)((UINT32)DsdLine6 | ((UINT32)DsdLine7 << 8) | ((UINT32)DsdLine9 << 16)) ;
  47.      SAMP_APICallRequest (SDM_SETDACPINNING, &err);
  48.      return err;
  49. }
  50. SAMP(ErrCode) SAMP_EXP(SDM_SetDsdClockPolarity)(SAMP(Bool) Positive)
  51. {
  52.      SAMP(ErrCode) err;
  53.      SAMP_API_PARAM[0] = (UINT32)Positive ;
  54.      SAMP_APICallRequest (SDM_SETDSDCLKPOLARITY, &err);
  55.      return err;
  56. }
  57. SAMP(ErrCode) SAMP_EXP(SDM_SetAudioClock)(SAMP(SACD_InputModeDef) InputMode,
  58.                                       SAMP(SDM_AudioClockDef) AudioClock)
  59. {
  60.      SAMP(ErrCode) err;
  61.      SAMP_API_PARAM[0] = (UINT32)InputMode ;
  62.      SAMP_API_PARAM[1] = (UINT32)AudioClock ;
  63.      SAMP_APICallRequest (SDM_SETAUDIOCLK, &err);
  64.      return err;
  65. }
  66. SAMP(ErrCode) SAMP_EXP(SDM_SetSystemClock)(SAMP(UInt32) SystemClock)
  67. {
  68.      SAMP(ErrCode) err;
  69.      SAMP_API_PARAM[0] = (UINT32)SystemClock ;
  70.      SAMP_APICallRequest (SDM_SETSYSCLK, &err);
  71.      return err;
  72. }
  73. SAMP(ErrCode) SAMP_EXP(SDM_SetBurstLength)(SAMP(UInt16) BurstLength)
  74. {
  75.      SAMP(ErrCode) err;
  76.      SAMP_API_PARAM[0] = (UINT32)BurstLength ;
  77.      SAMP_APICallRequest (SDM_SETBURSTLEN, &err);
  78.      return err;
  79. }
  80. SAMP(ErrCode) SAMP_EXP(SDM_EnableDTCP)(SAMP(Bool) enableDTCP)
  81. {
  82.      SAMP(ErrCode) err;
  83.      SAMP_API_PARAM[0] = (UINT32)enableDTCP ;
  84.      SAMP_APICallRequest (SDM_ENA_DTCP, &err);
  85.      return err;
  86. }
  87. #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////////