diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/cc13xx-cc26xx-conf.h b/arch/cpu/simplelink-cc13xx-cc26xx/cc13xx-cc26xx-conf.h index 87fa922b9..58f34198f 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/cc13xx-cc26xx-conf.h +++ b/arch/cpu/simplelink-cc13xx-cc26xx/cc13xx-cc26xx-conf.h @@ -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 diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ble-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ble-settings.c index 539046a48..f9902f826 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ble-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ble-settings.c @@ -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, }; /*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c index ce7b00a0b..1537f693c 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c @@ -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 */ diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ble-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ble-settings.c index d44264f3a..b43ce21a6 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ble-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ble-settings.c @@ -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, diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c index 665bd568e..a81a83385 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c @@ -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 */ diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ble-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ble-settings.c index 255deb151..9c19021fd 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ble-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ble-settings.c @@ -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, }; /*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c index 71842215e..4d860109d 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c @@ -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 */ diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ble-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ble-settings.c index bba7c083b..21ed73201 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ble-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ble-settings.c @@ -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, diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c index c353a07c1..d95ff87ba 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c @@ -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, diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf/ble-beacond.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf/ble-beacond.c index 79600afd6..1d2328803 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf/ble-beacond.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf/ble-beacond.c @@ -52,6 +52,7 @@ #include /*---------------------------------------------------------------------------*/ +#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); diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf/ieee-mode.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf/ieee-mode.c index f5105a263..678c50db7 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf/ieee-mode.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf/ieee-mode.c @@ -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; diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf/prop-mode.c b/arch/cpu/simplelink-cc13xx-cc26xx/rf/prop-mode.c index 33cfbfbba..79c58c339 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf/prop-mode.c +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf/prop-mode.c @@ -61,6 +61,7 @@ #include /*---------------------------------------------------------------------------*/ /* 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; diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/rf/rf.h b/arch/cpu/simplelink-cc13xx-cc26xx/rf/rf.h index cfc6b2277..c1f454970 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/rf/rf.h +++ b/arch/cpu/simplelink-cc13xx-cc26xx/rf/rf.h @@ -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_ */ /*---------------------------------------------------------------------------*/ /** diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/board-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/board-conf.h index 71d59501d..5e5c75528 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/board-conf.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/board-conf.h @@ -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. diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/Board.h index 6b3c762d7..88999fe6f 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/rf-conf.h new file mode 100644 index 000000000..d8468144f --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1310/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Board.h index c3763b019..6533b6bdf 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/Board.h index c8094432a..e224327d7 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/CC1350_LAUNCHXL_433_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/CC1350_LAUNCHXL_433_fxns.c index a8a6b16c0..92e349480 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/CC1350_LAUNCHXL_433_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/CC1350_LAUNCHXL_433_fxns.c @@ -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 */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350-4/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/CC1350_LAUNCHXL_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/CC1350_LAUNCHXL_fxns.c index 90f69a0c0..56de7c562 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/CC1350_LAUNCHXL_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/CC1350_LAUNCHXL_fxns.c @@ -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 */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1350/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/Board.h index d22d73c17..203c4abc0 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/CC1352P_2_LAUNCHXL_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/CC1352P_2_LAUNCHXL_fxns.c index f8b4930c8..57f545360 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/CC1352P_2_LAUNCHXL_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/CC1352P_2_LAUNCHXL_fxns.c @@ -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 { diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-2/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/Board.h index 381651708..ccbed6d2a 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/CC1352P_4_LAUNCHXL_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/CC1352P_4_LAUNCHXL_fxns.c index ef9c0531c..eea9c3b33 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/CC1352P_4_LAUNCHXL_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/CC1352P_4_LAUNCHXL_fxns.c @@ -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 { diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p-4/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Board.h index 1fef09180..593f24066 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/CC1352P1_LAUNCHXL_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/CC1352P1_LAUNCHXL_fxns.c index 9f3000929..795f60106 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/CC1352P1_LAUNCHXL_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/CC1352P1_LAUNCHXL_fxns.c @@ -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 { diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Board.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Board.h index 8bf0ee002..9edab4214 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Board.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Board.h @@ -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 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/CC1352R1_LAUNCHXL_fxns.c b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/CC1352R1_LAUNCHXL_fxns.c index 520b91297..79d97d7b6 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/CC1352R1_LAUNCHXL_fxns.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/CC1352R1_LAUNCHXL_fxns.c @@ -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); } } diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/rf-conf.h new file mode 100644 index 000000000..70ae4d2cd --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc2650/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc2650/rf-conf.h new file mode 100644 index 000000000..8dcd9e780 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc2650/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc26x2r1/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc26x2r1/rf-conf.h new file mode 100644 index 000000000..8dcd9e780 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc26x2r1/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/sensortag/board-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/board-conf.h index bb8689c98..5ff2f78d8 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/sensortag/board-conf.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/board-conf.h @@ -50,8 +50,7 @@ #ifndef BOARD_CONF_H_ #define BOARD_CONF_H_ /*---------------------------------------------------------------------------*/ -#include "contiki-conf.h" -/*---------------------------------------------------------------------------*/ +#include "rf-conf.h" #include "leds-arch.h" /*---------------------------------------------------------------------------*/ /** diff --git a/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc1350/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc1350/rf-conf.h new file mode 100644 index 000000000..06c5b9876 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc1350/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc2650/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc2650/rf-conf.h new file mode 100644 index 000000000..8dcd9e780 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/sensortag/cc2650/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/srf06/board-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/srf06/board-conf.h index 037e7eb3f..7d6f8328f 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/srf06/board-conf.h +++ b/arch/platform/simplelink/cc13xx-cc26xx/srf06/board-conf.h @@ -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. * diff --git a/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc13x0/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc13x0/rf-conf.h new file mode 100644 index 000000000..8dcd9e780 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc13x0/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc26x0/rf-conf.h b/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc26x0/rf-conf.h new file mode 100644 index 000000000..8dcd9e780 --- /dev/null +++ b/arch/platform/simplelink/cc13xx-cc26xx/srf06/cc26x0/rf-conf.h @@ -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 + * \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_ */ +/*---------------------------------------------------------------------------*/ +/** + * @} + */