kb_dc_pub.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- #include"kb_dc_pub.h"
- #include "dmd.h"
- void NOPrintf(char *format, /* In:Print format string */
- ...)
- {
- return;
- }
-
- KB_DC_Ret KB_DC_MsgSend( unsigned long nQueID, KB_DC_MsgNode *pMsgNode )
- {
- if(KB_OSPMsgSend(nQueID, (KB_OSPMsgNode *)pMsgNode) == Ret_OK)
- return DC_RET_OK;
- else
- return DC_RET_ERR;
- }
- unsigned long KB_DC_TimerCreate(KB_DC_TimerMode mode, KB_DC_TIMER_FUNC_POINTER entry, void *param)
- {
- return KB_TimerCreate( (KB_TimerMode)mode, (KB_TIMER_FUNC_POINTER)entry, param);
- }
- KB_DC_Ret KB_DC_TaskDelay(unsigned long dMilliSeconds)
- {
- KB_OSPTaskDelay(dMilliSeconds);
-
- return DC_RET_OK;
- }
- /*
- *函数名称:KB_DC_SetQam
- *
- *函数简介:通过频道参数锁定频道
- *
- *输入参数: lfrequency 频率 frequency in KHz
- * i_lsymbol_rate 符号率 symbol rate in ksymbols/s
- * i_nModulateMode 调制方式 Modulation:QPSK,QAM_16,QAM_32,QAM_64,QAM_128,QAM_256,QAM_AUTO
- *
- *输出参数:None
- *
- *返 回 值: MB_SUCCESS 锁定成功
- * MB_FAILURE 锁定失败
- */
- mb_error_t KB_DC_SetQam(unsigned long frequency, unsigned long symbol_rate, unsigned char modulateMode)
- {
- KB_DMDTunerParameters tTs;
- tTs.type = DMD_TYPE_QAM;
- tTs.inversion = INVERSION_AUTO;
- tTs.frequency = frequency;
- tTs.details.qam.symbolRatekSs = symbol_rate;
- tTs.details.qam.modulation = modulateMode;
-
- KB_DMDDropSignal();
- KB_DMDConnectSignal(&tTs);
- KB_OSPTaskDelay(1000);
- if(!KB_DMDQuerySignalStatus())
- {
- KB_DMDDropSignal();
- KB_DMDConnectSignal(&tTs);
- KB_OSPTaskDelay(1000);
- if(KB_DMDQuerySignalStatus())
- return MB_SUCCESS;
- else
- return MB_FAILURE;
- }
- return MB_SUCCESS;
-
- }
- /*
- *函数名称:KB_DC_GetMainFreqInfo
- *
- *函数简介:取得主频点参数
- *
- *输入参数: KBTunerPara 频点描述信息结构
- *
- *输出参数:None
- *
- *返 回 值: None
- */
- void KB_DC_GetMainFreqInfo(KBTunerPara *para)
- {
- return;
- }
- /*
- *函数名称:kb_DC_GetCurTsInfo
- *
- *函数简介:取得当前频点参数信息
- *
- *输入参数: KBTunerPara 频点描述信息结构
- *
- *输出参数:None
- *
- *返 回 值: None
- */
- void kb_DC_GetCurTsInfo(KBTunerPara *para)
- {
- KB_DMDTunerParameters tspara;
-
- KB_DMDGetSignalParameters(&tspara);
- para->frequency=tspara.frequency;
- para->symbol = tspara.details.qam.symbolRatekSs;
- para->modulate = tspara.details.qam.modulation;
- return;
- }