在Z-STACK中怎样设置功率 20
1个回答
展开全部
/**************************************************************************************************
* @fn macRadioSetTxPower
*
* @brief Set transmitter power of the radio.
*
* @param txPower - the minus dBm for power but as a postive integer (or if configured
* for it, txPower is the raw register value).
*
* @return none
**************************************************************************************************
*/
#ifndef HAL_MAC_USE_REGISTER_POWER_VALUES
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* if the selected dBm is out of range, use the closest available */
if (txPower > MAC_RADIO_TX_POWER_MAX_MINUS_DBM)
{
txPower = MAC_RADIO_TX_POWER_MAX_MINUS_DBM;
}
/*
* Set the global variable reqTxPower. This variable is referenced
* by the function macRadioUpdateTxPower() to write the radio register.
*
* A lookup table is used to translate the power level to the register
* value.
*/
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = macRadioDefsTxPowerTable[txPower];
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#else
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* same as above but with no lookup table, use raw register value */
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = txPower;
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#endif
* @fn macRadioSetTxPower
*
* @brief Set transmitter power of the radio.
*
* @param txPower - the minus dBm for power but as a postive integer (or if configured
* for it, txPower is the raw register value).
*
* @return none
**************************************************************************************************
*/
#ifndef HAL_MAC_USE_REGISTER_POWER_VALUES
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* if the selected dBm is out of range, use the closest available */
if (txPower > MAC_RADIO_TX_POWER_MAX_MINUS_DBM)
{
txPower = MAC_RADIO_TX_POWER_MAX_MINUS_DBM;
}
/*
* Set the global variable reqTxPower. This variable is referenced
* by the function macRadioUpdateTxPower() to write the radio register.
*
* A lookup table is used to translate the power level to the register
* value.
*/
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = macRadioDefsTxPowerTable[txPower];
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#else
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* same as above but with no lookup table, use raw register value */
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = txPower;
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#endif
艾普斯
2024-07-18 广告
2024-07-18 广告
稳频稳压电源哪家好?艾普斯电源(苏州)有限公司开始专业研发、制造及营销交流稳压电源,满足全球电子及信息业对电源设备日益蓬勃的市场需求。迄今为止,业已发展成为交流不间断电源、稳压电源、变频电源、中频航空- 军事专用电源、直流电源、逆变电源等产...
点击进入详情页
本回答由艾普斯提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询