2.3.23 PHY_ConfigTxPwr Function

C

PHY_Retval_t PHY_ConfigTxPwr(bool type, int8_t pwrValue)

Summary

Configures the TX Power in Transceiver

Description

This function is used to configure the Transmit power of the transceiver

Precondition

PHY_Init() should have been called before calling this function

Parameters

ParamDescription
typePWR_REGISTER_VALUE or PWR_DBM_VALUE
pwrValueIndex of the power register value (0-15) or Power value in dBm (-14dBm to 12dBm)

Returns

PHY_SUCCESS - If pwrValue bit is configured correctly

PHY_FAILURE - Otherwise

Example

bool pwrType = PWR_REGISTER_VALUE;
uint8_t pwrIndex = 0x00;
bool configStatus = false;
//Set Tx Power with Register Index value
if (PHY_SUCCESS == PHY_ConfigTxPwr(pwrType, int8_t (pwrIndex)))
{
    configStatus = true;
}

//Set Tx Power with dBm value
int8_t pwrDbm = -12;
pwrType = PWR_DBM_VALUE;
if (PHY_SUCCESS == PHY_ConfigTxPwr(pwrType, int8_t (pwrDbm)))
{
    configStatus = true;
}

uint8_t pwrReg;
// To get the tx power index value configured in the TRX
PHY_GetTrxConfig(TX_PWR, &pwrReg);

Remarks

None .