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; }