Other Parts Discussed in Thread: SYSCONFIG, ,
Tool/software: Code Composer Studio
We have a custom board and therefore a custom .syscfg file .
Using SimpleLink SDK 3.40.00.02 ( Rev E silicon)
As such, we need to add rfDriverCallbackCustom() for antenna switch.
Since there is no reference for such function, Used as reference rfDriverCallback function from SDK 2.30.00.45 ( Rec C silicon)
There are some functions which are workaround for Rev C., Not sure if required or can be removed for Rev E silicon.
/*
* ======== CC1352P_rfDriverCallback ========
* Sets up the antenna switch depending on the current PHY configuration.
* Truth table:
*
* Path DIO28 DIO29 DIO30
* =========== ===== ===== =====
* Sub-1 GHz 0->X 0->1 1->1
* 2.4 GHz 1->X 0->0 0->1
* Sub-1 GHz 20dBm 0->0 1->1 0->0
* 2.4 GHz 20dBm 0->1 0->0 0->0
*/
void rfDriverCallbackCustom(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
uint32_t val=0;
/* Initialize front-end (will only be done once) */
initRfFrontendCustom();
/* Switch off all paths first. Needs to be done anyway in every sub-case below. */
PINCC26XX_setOutputValue(CONFIG_RF_DIO28, 0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO29, 0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO30, 0);
if (events & RF_GlobalEventRadioSetup) {
/* Decode the current PA configuration. */
RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType)RF_getTxPower(client).paType;
/* Decode the generic argument as a setup command. */
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = RF_LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = RF_LODIVIDER_MASK & setupCommand->prop_div.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
default:break;
}
if (sub1GHz) {
/* Sub-1 GHz */
if (paType == RF_TxPowerTable_HighPA) {
/* PA enable --> HIGH PA
* LNA enable --> Sub-1 GHz
*/
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO28, PINCC26XX_MUX_GPIO);
/* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
de-asserted on CC1352 Rev A. */
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO29, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO30, PINCC26XX_MUX_RFC_GPO0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO28, 0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO29, 1);
PINCC26XX_setOutputValue(CONFIG_RF_DIO30, 0);
val = PINCC26XX_getOutputValue(CONFIG_RF_DIO28);
val = PINCC26XX_getOutputValue(CONFIG_RF_DIO29);
val = PINCC26XX_getOutputValue(CONFIG_RF_DIO30);
} else {
/* RF core active --> Sub-1 GHz */
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO28, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO29, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO30, PINCC26XX_MUX_GPIO);
PINCC26XX_setOutputValue(CONFIG_RF_DIO29, 1);
PINCC26XX_setOutputValue(CONFIG_RF_DIO30, 1);
}
} else {
/* 2.4 GHz */
if (paType == RF_TxPowerTable_HighPA)
{
/* PA enable --> HIGH PA
* LNA enable --> 2.4 GHz
*/
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO28, PINCC26XX_MUX_RFC_GPO0);
/* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
de-asserted on CC1352 Rev A. */
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO29, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO30, PINCC26XX_MUX_GPIO);
PINCC26XX_setOutputValue(CONFIG_RF_DIO28, 1);
PINCC26XX_setOutputValue(CONFIG_RF_DIO29, 0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO30, 0);
} else {
/* RF core active --> 2.4 GHz */
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO28, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO29, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO30, PINCC26XX_MUX_GPIO);
PINCC26XX_setOutputValue(CONFIG_RF_DIO29, 0);
PINCC26XX_setOutputValue(CONFIG_RF_DIO30, 1);
}
}
} else {
/* Reset the IO multiplexer to GPIO functionality */
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO28, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO29, PINCC26XX_MUX_GPIO);
PINCC26XX_setMux(frontendPins, CONFIG_RF_DIO30, PINCC26XX_MUX_GPIO);
}
}