uint8 RDA5802_reg_data[4]={0};
uint8 RDA5802_channel_seek[] = {0xc0,0x01};
uint16 CurrentChannel;
//frequency这里的值为870~1079,即87MHZ~107.9MHZ,然后套用公式Frequency =Channel Spacing (kHz) x CHAN +87.0 MHz
//把频率转化成寄存器的通道值
CurrentChannel= FMDrv_FreqToChan(frequency);
//开始TUNE到指定的频率
RDA5802_reg_data[0]=RDA5802_channel_seek[0];
RDA5802_reg_data[1]=RDA5802_channel_seek[1];
RDA5802_reg_data[2]=CurrentChannel>>2; //CHAN[15:6]
RDA5802_reg_data[3]=(((CurrentChannel & 0x0003)<<6)|0x10) | (RDA5802_Setting_Reg[3]&0x0f);//D[4]=TUNE ENALBE
FMDrv_WriteData(FMDrv_RDA5802_2WIRE_ID, 4, (uint8 *)&(RDA5802_reg_data[0]));
//TUNE需要一定的时间
clk_busy_wait(36000);
//读0X0A,0X0B寄存器,获得TUNE这个频点的工作状态
FMDrv_ReadData(FMDrv_RDA5802_2READ_ID, 4, (uint8 *)&(RDA5802_reg_data[0]));
//检测STC=1 && check FM_TURE
//去掉谐波96MHZ,104MHZ
if(((RDA5802_reg_data[0]&0x40) != 0) && ((RDA5802_reg_data[2]&0x01) != 0)
&&(RDA5802_reg_data[1]!=0xaa) &&(RDA5802_reg_data[1]!=0x5a))
{
result = FMDRV_OK;
}