没有在官方文档中找到相关叙述;在网上找了一圈最终确定:DA14580默认发射功率为0dBm,这是正常模式;还有一个近场模式的发射功率为-20dBm;目前只能在这2个等级之间切换。
如何设置-20dBm?
在SDK5.0.4中rf_580.c中
402行使能
/**
****************************************************************************************
* @brief Enables Near Field mode for all connections.
*
* @return void
****************************************************************************************
*/
void rf_nfm_enable(void)
{
near_field_mode = true;
SetWord16(RF_ENABLE_CONFIG13_REG, 0x0030);
}
232行打开
// Near Field Mode Enable
if(rf_nfm_is_enabled())
{
SetWord16( RF_ENABLE_CONFIG13_REG, 0x0030);
}
另:
在SDK5.0.4中,获取发射功率时直接返回的时0,从这一点可以看出功率默认只有0dBm等级
/**
*****************************************************************************************
* @brief Get TX power in dBm from the index in the control structure
*
* @param[in] txpwr_idx Index of the TX power in the control structure
* @param[in] modulation Modulation: 1 or 2 or 3 MBPS
*
* @return The TX power in dBm
*
*****************************************************************************************
*/
uint8_t rf_txpwr_dbm_get(uint8_t txpwr_idx, uint8_t modulation)
{
return 0;
}