samp_sdm_exp.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
- /*
- file: samp_sdm_exp.c
- decription: implements SAMP sdm APIs for use by UI task.
- */
- #include "config.h"
- #ifdef TEST_HARNASS // for test only.//////////////////////////////////////////////////////////////////////////////////
- #include "IncludeSysDefs.h"
- #include "playcoresampsamp_gen.h"
- #include "playcoresampsamp_sdm.h"
- #include "playcoresampschedulersamp_api.h"
- void SAMP_EXP(SDM_GetHandler)(SAMP(SDM_PVoidFuncDef) *ph)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)ph ;
- SAMP_APICallRequest (SDM_GETHANDLER, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetEngineType)(SAMP(SDM_EngineTypeDef) Engine)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Engine ;
- SAMP_APICallRequest (SDM_SETENGINETYPE, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetDacPinning)
- ( SAMP(SDM_DataLineDef) PcmLine0
- , SAMP(SDM_DataLineDef) PcmLine1
- , SAMP(SDM_DataLineDef) PcmLine2
- , SAMP(SDM_DataLineDef) PcmLine3
- , SAMP(SDM_DataLineDef) PcmLine4
- , SAMP(SDM_DataLineDef) PcmLine5
- , SAMP(SDM_DataLineDef) PcmLine6
- , SAMP(SDM_DataLineDef) PcmLine7
- , SAMP(SDM_DataLineDef) PcmLine8
- , SAMP(SDM_DataLineDef) PcmLine9
- , SAMP(SDM_DataLineDef) PcmLine10
- , SAMP(SDM_DataLineDef) PcmLine11
- , SAMP(SDM_DataLineDef) DsdLine6
- , SAMP(SDM_DataLineDef) DsdLine7
- , SAMP(SDM_DataLineDef) DsdLine9)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)((UINT32)PcmLine0 | ((UINT32)PcmLine1 << 8) | ((UINT32)PcmLine2 << 16) | ((UINT32)PcmLine3 << 24)) ;
- SAMP_API_PARAM[1] = (UINT32)((UINT32)PcmLine4 | ((UINT32)PcmLine5 << 8) | ((UINT32)PcmLine6 << 16) | ((UINT32)PcmLine7 << 24)) ;
- SAMP_API_PARAM[2] = (UINT32)((UINT32)PcmLine8 | ((UINT32)PcmLine9 << 8) | ((UINT32)PcmLine10 << 16) | ((UINT32)PcmLine11 << 24)) ;
- SAMP_API_PARAM[3] = (UINT32)((UINT32)DsdLine6 | ((UINT32)DsdLine7 << 8) | ((UINT32)DsdLine9 << 16)) ;
- SAMP_APICallRequest (SDM_SETDACPINNING, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetDsdClockPolarity)(SAMP(Bool) Positive)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Positive ;
- SAMP_APICallRequest (SDM_SETDSDCLKPOLARITY, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetAudioClock)(SAMP(SACD_InputModeDef) InputMode,
- SAMP(SDM_AudioClockDef) AudioClock)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)InputMode ;
- SAMP_API_PARAM[1] = (UINT32)AudioClock ;
- SAMP_APICallRequest (SDM_SETAUDIOCLK, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetSystemClock)(SAMP(UInt32) SystemClock)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)SystemClock ;
- SAMP_APICallRequest (SDM_SETSYSCLK, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_SetBurstLength)(SAMP(UInt16) BurstLength)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)BurstLength ;
- SAMP_APICallRequest (SDM_SETBURSTLEN, &err);
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(SDM_EnableDTCP)(SAMP(Bool) enableDTCP)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)enableDTCP ;
- SAMP_APICallRequest (SDM_ENA_DTCP, &err);
- return err;
- }
- #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////////