// Clearing the RF interrupt flags and enable mask and enabling RF interrupts
RFIF = 0;
RFIM = 0;
INT_SETFLAG(INUM_RF,INT_CLR); //清除中断标志
INT_ENABLE(INUM_RF,INT_ON); //允许RF中断
// Setting the frequency and initialising the radio
if(halRfConfig(lFrequency) == FALSE){ //RF硬件配置
return FALSE;
}
// Setting the number of bytes to assert the FIFOP flag
IOCFG0 = 7;
INT_SETFLAG(INUM_RFERR, INT_CLR);
INT_ENABLE(INUM_RFERR, INT_ON);
// Flushing both Tx and Rx FiFo. The flush-Rx is issued twice to reset the SFD.
// Calibrating the radio and turning on Rx to evaluate the CCA.
// SFD 开始帧定界符
SRXON;
SFLUSHTX;
SFLUSHRX;
SFLUSHRX;
STXCALN;
ISSTART;
if(iType == RF_RX)
{
ISFLUSHRX; // Making sure that the rX FIFO is empty.
ISFLUSHRX; // Issuing the command twice to reset the SFD.