static int AVL6211_Diseqc_Send_Burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd) { AVL_DVBSx_ErrorCode r = AVL_DVBSx_EC_OK; struct AVL_DVBSx_Diseqc_TxStatus sTxStatus; AVL_uchar ucTone = 0; int i=100; #define TONE_COUNT 8 if(minicmd == SEC_MINI_A) ucTone = 1; else if(minicmd == SEC_MINI_B) ucTone = 0; else ; r = AVL_DVBSx_IDiseqc_SendTone(ucTone, TONE_COUNT, pAVLChip_all); if(AVL_DVBSx_EC_OK != r) { pr_dbg("\rSend tone %d --- Fail!\n",ucTone); } else { do { i--; AVL_DVBSx_IBSP_Delay(1); r =AVL_DVBSx_IDiseqc_GetTxStatus(&sTxStatus, pAVLChip_all); //Get current status of the Diseqc transmitter data FIFO. } while((1 != sTxStatus.m_TxDone)&&i); //Wait until operation finished. if(AVL_DVBSx_EC_OK != r) { pr_dbg("\rOutput tone %d --- Fail!\n",ucTone); } } return (r); }
AVL_DVBSx_ErrorCode AVL6211_SetToneOut(AVL_uchar ucTone) { AVL_DVBSx_ErrorCode r=AVL_DVBSx_EC_OK; struct AVL_DVBSx_Diseqc_TxStatus TxStatus; struct AVL_DVBSx_Chip * pAVLChip = &AVL_DVBSxChip; AVL_DVBSx_IDiseqc_SendTone( ucTone, 1, pAVLChip); if(r != AVL_DVBSx_EC_OK) { printf("AVL_DVBSx_IDiseqc_SendTone failed !\n"); } else { do { r= AVL_DVBSx_IDiseqc_GetTxStatus(&TxStatus, pAVLChip); }while(TxStatus.m_TxDone != 1); if(r ==AVL_DVBSx_EC_OK ) { } else { printf("AVL_DVBSx_IDiseqc_SendTone Err. !\n"); } } return r; }
void AVL6211_DiseqcSendCmd(AVL_puchar pCmd,AVL_uchar CmdSize) { AVL_DVBSx_ErrorCode r=AVL_DVBSx_EC_OK; struct AVL_DVBSx_Diseqc_TxStatus TxStatus; struct AVL_DVBSx_Chip * pAVLChip = &AVL_DVBSxChip; r=AVL_DVBSx_IDiseqc_SendModulationData(pCmd, CmdSize, pAVLChip); if(r != AVL_DVBSx_EC_OK) { printf("AVL_DVBSx_IDiseqc_SendModulationData failed !\n"); } else { do { r= AVL_DVBSx_IDiseqc_GetTxStatus(&TxStatus, pAVLChip); }while(TxStatus.m_TxDone != 1); if(r ==AVL_DVBSx_EC_OK ) { } else { printf("AVL_DVBSx_IDiseqc_SendModulationData Err. !\n"); } } }
static int AVL6211_Diseqc_Send_Master_Cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd) { AVL_DVBSx_ErrorCode r = AVL_DVBSx_EC_OK; AVL_uchar ucData[8]; int j=100; struct AVL_DVBSx_Diseqc_TxStatus TxStatus; int i; pr_dbg("msg_len is %d,\n data is",cmd->msg_len); for(i=0;i<cmd->msg_len;i++){ ucData[i]=cmd->msg[i]; printk("%x ",cmd->msg[i]); } r=AVL_DVBSx_IDiseqc_SendModulationData(ucData, cmd->msg_len, pAVLChip_all); if(r != AVL_DVBSx_EC_OK) { pr_dbg("AVL_DVBSx_IDiseqc_SendModulationData failed !\n"); } else { do { j--; AVL_DVBSx_IBSP_Delay(1); r= AVL_DVBSx_IDiseqc_GetTxStatus(&TxStatus, pAVLChip_all); }while((TxStatus.m_TxDone != 1)&&j); if(r ==AVL_DVBSx_EC_OK ) { } else { pr_dbg("AVL_DVBSx_IDiseqc_SendModulationData Err. !\n"); } } return r; }