Fixed RF front-end configuration and RF switching for CC13xx

Two issues caused the sensitivity on CC13xx devices to be dramatically
worse than CC26xx devices:
* Wrong front-end mode configuration
* Faulty/outdated RF switching logic

Both issues are inherently board-specific. Therefore, a generic
configuration was aligned across all boards which allows a specific
board to configure a correct RF front-end mode. In addition, the RF
switching logic was updated to latest and greatest.
This commit is contained in:
Edvard Pettersen 2019-01-22 15:38:26 +01:00
parent c177034d39
commit 257a3794a1
43 changed files with 1198 additions and 53 deletions

View File

@ -133,6 +133,18 @@
#define RF_MODE RF_CONF_MODE
#endif /* RF_CONF_MODE */
#ifdef RF_CONF_FRONT_END_MODE
#define RF_FRONT_END_MODE RF_CONF_FRONT_END_MODE
#else
#define RF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#endif
#ifdef RF_CONF_BIAS_MODE
#define RF_BIAS_MODE RF_CONF_BIAS_MODE
#else
#define RF_BIAS_MODE RF_BIAS_MODE_INTERNAL
#endif
/* Number of RX buffers. */
#ifndef RF_CONF_RX_BUF_CNT
#define RF_CONF_RX_BUF_CNT 4

View File

@ -62,6 +62,12 @@ RF_Mode rf_ble_mode =
.rfePatchFxn = &rf_patch_rfe_ble,
};
/*---------------------------------------------------------------------------*/
/*
* CMD_RADIO_SETUP must be configured with default TX power value
* in the .txPower field.
*/
#define DEFAULT_TX_POWER 0x5F3C /* 5 dBm */
/*---------------------------------------------------------------------------*/
/* Overrides for CMD_RADIO_SETUP */
uint32_t rf_ble_overrides[] CC_ALIGN(4) =
{
@ -109,11 +115,11 @@ rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup =
.condition.nSkip = 0x0,
.mode = 0x00,
.loDivider = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x3D3F,
.txPower = DEFAULT_TX_POWER,
.pRegOverride = rf_ble_overrides,
};
/*---------------------------------------------------------------------------*/

View File

@ -110,8 +110,8 @@ rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup =
.condition.rule = COND_NEVER,
.condition.nSkip = 0x0,
.mode = 0x01,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = DEFAULT_TX_POWER, /* 5 dBm default */

View File

@ -64,6 +64,12 @@ RF_Mode rf_ble_mode =
.rfePatchFxn = &rf_patch_rfe_bt5,
};
/*---------------------------------------------------------------------------*/
/*
* CMD_RADIO_SETUP must be configured with default TX power value
* in the .txPower field.
*/
#define DEFAULT_TX_POWER 0x941E /* 5 dBm */
/*---------------------------------------------------------------------------*/
/* Overrides for CMD_BLE5_RADIO_SETUP */
uint32_t rf_ble_overrides_common[] CC_ALIGN(4) =
{
@ -137,11 +143,11 @@ rfc_CMD_BLE5_RADIO_SETUP_t rf_ble_cmd_radio_setup =
.defaultPhy.mainMode = 0x0,
.defaultPhy.coding = 0x0,
.loDivider = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x941E,
.txPower = DEFAULT_TX_POWER,
.pRegOverrideCommon = rf_ble_overrides_common,
.pRegOverride1Mbps = rf_ble_overrides_1mbps,
.pRegOverride2Mbps = rf_ble_overrides_2mbps,

View File

@ -180,8 +180,8 @@ rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup =
.condition.nSkip = 0x0,
.mode = 0x01,
.loDivider = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = DEFAULT_TX_POWER, /* 5 dBm default */

View File

@ -61,6 +61,12 @@ RF_Mode rf_ble_mode =
.rfePatchFxn = &rf_patch_rfe_ble,
};
/*---------------------------------------------------------------------------*/
/*
* CMD_RADIO_SETUP must be configured with default TX power value
* in the .txPower field.
*/
#define DEFAULT_TX_POWER 0x9330 /* 5 dBm */
/*---------------------------------------------------------------------------*/
/* Overrides for CMD_RADIO_SETUP */
uint32_t rf_ble_overrides[] CC_ALIGN(4) =
{
@ -105,11 +111,11 @@ rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup =
.condition.nSkip = 0x0,
.mode = 0x00,
.__dummy0 = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x9330,
.txPower = DEFAULT_TX_POWER,
.pRegOverride = rf_ble_overrides,
};
/*---------------------------------------------------------------------------*/

View File

@ -107,8 +107,8 @@ rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup =
.condition.nSkip = 0x0,
.mode = 0x01,
.__dummy0 = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = DEFAULT_TX_POWER, /* 5 dBm default */

View File

@ -63,6 +63,12 @@ RF_Mode rf_ble_mode =
.rfePatchFxn = &rf_patch_rfe_bt5,
};
/*---------------------------------------------------------------------------*/
/*
* CMD_RADIO_SETUP must be configured with default TX power value
* in the .txPower field.
*/
#define DEFAULT_TX_POWER 0x941E /* 5 dBm */
/*---------------------------------------------------------------------------*/
/* Overrides for CMD_BLE5_RADIO_SETUP */
uint32_t rf_ble_overrides_common[] CC_ALIGN(4) =
{
@ -137,11 +143,11 @@ rfc_CMD_BLE5_RADIO_SETUP_t rf_ble_cmd_radio_setup =
.defaultPhy.mainMode = 0x0,
.defaultPhy.coding = 0x0,
.loDivider = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x941E,
.txPower = DEFAULT_TX_POWER,
.pRegOverrideCommon = rf_ble_overrides_common,
.pRegOverride1Mbps = rf_ble_overrides_1mbps,
.pRegOverride2Mbps = rf_ble_overrides_2mbps,

View File

@ -104,8 +104,8 @@ rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup =
.condition.nSkip = 0x0,
.mode = 0x01,
.loDivider = 0x00,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.frontEndMode = 0x0, /* set by driver */
.config.biasMode = 0x0, /* set by driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = DEFAULT_TX_POWER,

View File

@ -52,6 +52,7 @@
#include <ti/drivers/rf/RF.h>
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
#include "rf/sched.h"
#include "rf/ble-addr.h"
#include "rf/ble-beacond.h"
@ -157,6 +158,9 @@ PROCESS(ble_beacond_process, "RF BLE Beacon Daemon Process");
rf_ble_beacond_result_t
rf_ble_beacond_init(void)
{
ble_cmd_radio_setup.config.frontEndMode = RF_FRONT_END_MODE;
ble_cmd_radio_setup.config.biasMode = RF_BIAS_MODE;
RF_Params rf_params;
RF_Params_init(&rf_params);

View File

@ -217,6 +217,9 @@ rat_overflow_cb(void *arg)
static void
init_rf_params(void)
{
cmd_radio_setup.config.frontEndMode = RF_FRONT_END_MODE;
cmd_radio_setup.config.biasMode = RF_BIAS_MODE;
data_queue_t *rx_q = data_queue_init(sizeof(lensz_t));
cmd_rx.pRxQ = rx_q;

View File

@ -61,6 +61,7 @@
#include <ti/drivers/rf/RF.h>
/*---------------------------------------------------------------------------*/
/* Platform RF dev */
#include "rf/rf.h"
#include "rf/dot-15-4g.h"
#include "rf/sched.h"
#include "rf/data-queue.h"
@ -193,6 +194,8 @@ static int off(void);
static void
init_rf_params(void)
{
cmd_radio_setup.config.frontEndMode = RF_FRONT_END_MODE;
cmd_radio_setup.config.biasMode = RF_BIAS_MODE;
cmd_radio_setup.centerFreq = PROP_MODE_CENTER_FREQ;
cmd_radio_setup.loDivider = PROP_MODE_LO_DIVIDER;

View File

@ -60,6 +60,37 @@
RF_MODE_2_4_GHZ)
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name The different front-end modes the CC13xx/CC26xx devices support. The
* front-end mode can be configured independently of the bias mode. The
* two types of modes are as follows:
* - Differential: Both RF_P and RF_N are used as a differential RF
* interface.
* - Single ended: Either the RF_P pin or the RF_N pin is used as the
* RF path.
*
* @{
*/
/* Available front-end mode configurations */
#define RF_FRONT_END_MODE_DIFFERENTIAL 0
#define RF_FRONT_END_MODE_SINGLE_ENDED_RFP 1
#define RF_FRONT_END_MODE_SINGLE_ENDED_RFN 2
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name The different bias modes the CC13xx/CC26xx devices support. The
* bias mode can be configured independently of the front-end mode. The
* two different modes are as follows:
* - Internal bias: the LNA is biased by an internal bias.
* - External bias: the LNA is biased by an external bias.
*
* @{
*/
/* Available bias mode configurations */
#define RF_BIAS_MODE_INTERNAL 0
#define RF_BIAS_MODE_EXTERNAL 1
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CORE_H_ */
/*---------------------------------------------------------------------------*/
/**

View File

@ -50,7 +50,7 @@
#ifndef BOARD_CONF_H_
#define BOARD_CONF_H_
/*---------------------------------------------------------------------------*/
#include "contiki-conf.h"
#include "rf-conf.h"
/*---------------------------------------------------------------------------*/
/**
* \name LED configurations for the dev/leds.h API.

View File

@ -36,6 +36,9 @@
#define Board_CC1310_LAUNCHXL
#define BOARD_STRING "TI CC1310 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1312R1_LAUNCHXL
#define BOARD_STRING "TI CC1312R1 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1350_LAUNCHXL_433
#define BOARD_STRING "TI CC1350-433 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -165,23 +165,60 @@ void Board_initHook()
#if defined(Board_RF_SUB1GHZ)
/*
* ======== CC1350_LAUNCHXL_433_rfDriverCallback ========
* This is an implementation for the CC1350 launchpad which uses a
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== rfDriverCallback ========
* This is an implementation for the CC1350 LaunchPad which uses a
* single signal for antenna switching.
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Decode input arguments. */
(void)client;
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
if (events & RF_GlobalEventRadioSetup) {
/* Power up the antenna switch */
PINCC26XX_setOutputValue(Board_RF_POWER, 1);
if (setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP) {
/* Sub-1 GHz, requires antenna switch high */
/* Decision about the frequency band shall be made based on the
loDivider field. */
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1 GHz, requires antenna switch high. */
if ((loDivider != 0) && (loDivider != 2)) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->prop_div.loDivider;
/* Sub-1 GHz, requires antenna switch high. */
if ((loDivider != 0) && (loDivider != 2)) {
sub1GHz = true;
}
break;
default:break;
}
/* Select the correct antenna. */
if (sub1GHz) {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 1);
}
else {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 0);
}
}
else if (events & RF_GlobalEventRadioPowerDown) {
/* Disable antenna switch to save current */

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -166,6 +166,12 @@ void Board_initHook()
*/
#if defined(Board_RF_SUB1GHZ)
/*
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== rfDriverCallback ========
* This is an implementation for the CC1350 launchpad which uses a
@ -173,17 +179,48 @@ void Board_initHook()
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Decode input arguments. */
(void)client;
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
if (events & RF_GlobalEventRadioSetup) {
/* Power up the antenna switch */
PINCC26XX_setOutputValue(Board_RF_POWER, 1);
if (setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP) {
/* Sub-1 GHz, requires antenna switch high */
/* Decision about the frequency band shall be made based on the
loDivider field. */
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1 GHz, requires antenna switch high. */
if ((loDivider != 0) && (loDivider != 2)) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->prop_div.loDivider;
/* Sub-1 GHz, requires antenna switch high. */
if ((loDivider != 0) && (loDivider != 2)) {
sub1GHz = true;
}
break;
default:break;
}
/* Select the correct antenna. */
if (sub1GHz) {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 1);
}
else {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 0);
}
}
else if (events & RF_GlobalEventRadioPowerDown) {
/* Disable antenna switch to save current */

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1352P_2_LAUNCHXL
#define BOARD_STRING "TI CC1352P-2 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -152,6 +152,12 @@ void CC1352P_2_LAUNCHXL_shutDownExtFlash(void)
*/
#if defined(Board_RF_SUB1GHZ)
/*
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== Antenna switching ========
*/
@ -170,7 +176,7 @@ void initAntennaSwitch()
}
/*
* ======== rfDriverCallback ========
* ======== CC1352P1_LAUNCHXL_rfDriverCallback ========
* Sets up the antenna switch depending on the current PHY configuration.
* Truth table:
*
@ -183,6 +189,10 @@ void initAntennaSwitch()
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
/* Switch off all paths first. Needs to be done anyway in every sub-case below. */
PINCC26XX_setOutputValue(Board_RF_24GHZ, 0);
PINCC26XX_setOutputValue(Board_RF_HIGH_PA, 0);
@ -195,15 +205,36 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
/* Decode the generic argument as a setup command. */
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
if (setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP) {
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = 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(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
} else {
@ -221,8 +252,8 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
* LNA enable --> 2.4 GHz
*/
PINCC26XX_setMux(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
} else {

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1352P_4_LAUNCHXL
#define BOARD_STRING "TI CC1352P-4 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -152,6 +152,12 @@ void CC1352P_4_LAUNCHXL_shutDownExtFlash(void)
*/
#if defined(Board_RF_SUB1GHZ)
/*
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== Antenna switching ========
*/
@ -170,7 +176,7 @@ void initAntennaSwitch()
}
/*
* ======== rfDriverCallback ========
* ======== CC1352P1_LAUNCHXL_rfDriverCallback ========
* Sets up the antenna switch depending on the current PHY configuration.
* Truth table:
*
@ -183,6 +189,10 @@ void initAntennaSwitch()
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
/* Switch off all paths first. Needs to be done anyway in every sub-case below. */
PINCC26XX_setOutputValue(Board_RF_24GHZ, 0);
PINCC26XX_setOutputValue(Board_RF_HIGH_PA, 0);
@ -195,15 +205,36 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
/* Decode the generic argument as a setup command. */
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
if (setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP) {
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = 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(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
} else {
@ -221,8 +252,8 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
* LNA enable --> 2.4 GHz
*/
PINCC26XX_setMux(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
} else {

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1352P1_LAUNCHXL
#define BOARD_STRING "TI CC1352P1 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -152,6 +152,12 @@ void CC1352P1_LAUNCHXL_shutDownExtFlash(void)
*/
#if defined(Board_RF_SUB1GHZ)
/*
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== Antenna switching ========
*/
@ -170,7 +176,7 @@ void initAntennaSwitch()
}
/*
* ======== rfDriverCallback ========
* ======== CC1352P1_LAUNCHXL_rfDriverCallback ========
* Sets up the antenna switch depending on the current PHY configuration.
* Truth table:
*
@ -183,6 +189,10 @@ void initAntennaSwitch()
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
/* Switch off all paths first. Needs to be done anyway in every sub-case below. */
PINCC26XX_setOutputValue(Board_RF_24GHZ, 0);
PINCC26XX_setOutputValue(Board_RF_HIGH_PA, 0);
@ -195,15 +205,36 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
/* Decode the generic argument as a setup command. */
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
if (setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP) {
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = 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(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
} else {
@ -221,8 +252,8 @@ void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
* LNA enable --> 2.4 GHz
*/
PINCC26XX_setMux(antennaPins, Board_RF_24GHZ, 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.
/* 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(antennaPins, Board_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
PINCC26XX_setMux(antennaPins, Board_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
} else {

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -36,6 +36,9 @@
#define Board_CC1352R1_LAUNCHXL
#define BOARD_STRING "TI CC1352R1 LaunchPad"
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -164,23 +164,61 @@ void Board_initHook()
*/
#if defined(Board_RF_SUB1GHZ)
/*
* Mask to be used to determine the effective value of the setup command's
* loDivider field.
*/
#define LODIVIDER_MASK 0x7F
/*
* ======== rfDriverCallback ========
* This is an implementation for the CC1352R1 launchpad which uses a
* This is an implementation for the CC1352R launchpad which uses a
* single signal for antenna switching.
*/
void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
{
/* Decode input arguments. */
(void)client;
RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
if ((events & RF_GlobalEventRadioSetup) &&
(setupCommand->common.commandNo == CMD_PROP_RADIO_DIV_SETUP)) {
/* Sub-1 GHz, requires antenna switch high */
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 1);
/* Local variable. */
bool sub1GHz = false;
uint8_t loDivider = 0;
if (events & RF_GlobalEventRadioSetup) {
/* Decision about the frequency band shall be made based on the
loDivider field. */
switch (setupCommand->common.commandNo) {
case (CMD_RADIO_SETUP):
case (CMD_BLE5_RADIO_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->common.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
case (CMD_PROP_RADIO_DIV_SETUP):
loDivider = LODIVIDER_MASK & setupCommand->prop_div.loDivider;
/* Sub-1GHz front-end. */
if (loDivider != 0) {
sub1GHz = true;
}
break;
default:break;
}
/* Select the correct antenna. */
if (sub1GHz) {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 1);
}
else {
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 0);
}
}
else if (events & RF_GlobalEventRadioPowerDown) {
/* Disable antenna switch to save current */
/* Set the antenna to 2.4 GHz as default. */
PINCC26XX_setOutputValue(Board_RF_SUB1GHZ, 0);
}
}

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_INTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_INTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -50,8 +50,7 @@
#ifndef BOARD_CONF_H_
#define BOARD_CONF_H_
/*---------------------------------------------------------------------------*/
#include "contiki-conf.h"
/*---------------------------------------------------------------------------*/
#include "rf-conf.h"
#include "leds-arch.h"
/*---------------------------------------------------------------------------*/
/**

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_SINGLE_ENDED_RFP
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_EXTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_INTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -42,6 +42,8 @@
#ifndef BOARD_CONF_H_
#define BOARD_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf-conf.h"
/*---------------------------------------------------------------------------*/
/**
* \name LED configurations for the dev/leds.h API.
*

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_INTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup launchpad-peripherals
* @{
*
* \file
* Header file with board-specific RF configurations.
* \author
* Texas Instruments <e2e.ti.com>
* \note
* This file should not be included directly
*/
/*---------------------------------------------------------------------------*/
#ifndef RF_CONF_H_
#define RF_CONF_H_
/*---------------------------------------------------------------------------*/
#include "rf/rf.h"
/*---------------------------------------------------------------------------*/
/**
* \name Board-specific front-end configurations for the radio.
*
* @{
*/
#define RF_CONF_FRONT_END_MODE RF_FRONT_END_MODE_DIFFERENTIAL
#define RF_CONF_BIAS_MODE RF_BIAS_MODE_INTERNAL
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* RF_CONF_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/