设置发射功率:CC2530设置RF的发送功率寄存器为TXPOWER,全局搜索一下可以看到以下代码1defi
eMAC_RADIO_SET_PAN_COORDINATORbT0PAN_COORDINATORPAN_COORDINATORb02defi
eMAC_RADIO_SET_CHANNELx05MHZ5x113defi
eMAC_RADIO_SET_TX_POWERx
t45defi
eMAC_RADIO_SET_PAN_IDxFFPAN_ID1x86defi
eMAC_RADIO_SET_SHORT_ADDRx0xFFSHORT_ADDR1x8stSHORT_ADDR0xstPAN_ID0x0xstTXPOWERxfostFREQCTRLFREQ_24stFRMFILT0FRMFIL
继续跟踪MAC_RADIO_SET_TX_POWER
1f
23briefe
requested45parampowerlevel6level78retur
o
e91011MAC_INTERNAL_APIvoidmacRadioUpdateTxPowervoid1213141516171819i
gHAL_ENTER_CRITICAL_SECTIONsattempttoudpatetothe
ewpowersetti
gIftherequestedpowersetti
gisdiffere
tfromtheactualradiosetthalI
tState_tsmacPhyTxPowerglobalvariablethatholdsradiossetpowerreqTxPowerfilescopevariablethatholdsthelastrequestUpdatetheradiostra
smitpowerifa
ewpowerlevelhasbemacRadioUpdateTxPower
f20212223
ifreqTxPowermacPhyTxPoweri
gowermitifmacRxOutgoi
gAckFlagMAC_TX_IS_PHYSICALLY_ACTIVEmacPhyTxPowerreqTxPowerMAC_RADIO_SET_TX_POWERmacPhyTxPowerfo
tHAL_EXIT_CRITICAL_SECTIONsSet
ewpowerlevelupdatetheshadowvaluea
dwritethe
ewvaluetotheradiohardwareRadiopowerca
otbeupdatedwhe
theradioisphysicallytra
smittIfthereisapossibilityradioistra
smitti
gdo
otcha
gethepsetti
gcompletesThisfu
ctio
willbecalledagai
afterthecurre
ttra
s
242526272829303132333436373839
35fo
tcolor