金牌会员
 
- 积分
- 1887
- 金钱
- 1887
- 注册时间
- 2012-10-28
- 在线时间
- 353 小时
|
2金钱
/**************************************
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 版本信息正常,
请教是何故啊 ???
|
|