/**************************************
Si47XX_FM_Get_RSSI()
***************************************/
T_ERROR_OP Si47XX_FM_Get_RSSI(unsigned char *pRSSI)
{
unsigned short loop_counter = 0;
unsigned char Si47XX_reg_data[32];
unsigned char error_ind = 0;
unsigned char Si47XX_rsq_status[] = {0x23,0x00};
//send CMD
error_ind = OperationSi47XX_2w(WRITE, &(Si47XX_rsq_status[0]), 2);
if(error_ind)
return I2C_ERROR;
//wait CTS = 1
do
{
error_ind = OperationSi47XX_2w(READ, &(Si47XX_reg_data[0]), 1);
if(error_ind)
return I2C_ERROR;
loop_counter++;
}
while(((Si47XX_reg_data[0]&0x80) == 0) && (loop_counter < 0xff)); //loop_counter limit should guarantee at least 300us
if(loop_counter >= 0xff)
return LOOP_EXP_ERROR;
error_ind = OperationSi47XX_2w(READ, &(Si47XX_reg_data[0]), 8);
if(error_ind)
return I2C_ERROR;
*pRSSI = Si47XX_reg_data[4];
return OK;
}
上面的函数获取 rssi 值失败, 官网提供的,但是程序能够正常调节 电台频率,获取rev 版本信息正常,
请教是何故啊 ???
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>