diff --git a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.c b/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.c deleted file mode 100644 index 9b6c27cc6..000000000 --- a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.c +++ /dev/null @@ -1,208 +0,0 @@ -//********************************************************************************* -// Generated by SmartRF Studio version 2.8.0 ( build #41) -// Compatible with SimpleLink SDK version: CC13x2 SDK 1.60.xx.xx -// Device: CC1352 Rev. 1.0 -// -//********************************************************************************* - - -//********************************************************************************* -// Parameter summary -// IEEE Channel: 11 -// Frequency: 2405 MHz -// SFD: 0 -// Preamble (32 bit): 01010101... -// TX Power: 5 dBm - -#include -#include DeviceFamily_constructPath(driverlib/rf_mailbox.h) -#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) -#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h) -#include -#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h) -#include DeviceFamily_constructPath(rf_patches/rf_patch_mce_ieee_802_15_4.h) - -#include "rf-common.h" - -/*---------------------------------------------------------------------------*/ -/* Default TX power settings for the 2.4 GHz band */ -RF_TxPower RF_ieeeTxPower[] = { - { 5, 0x9330 }, - { 4, 0x9324 }, - { 3, 0x5a1c }, - { 2, 0x4e18 }, - { 1, 0x4214 }, - { 0, 0x3161 }, - { -3, 0x2558 }, - { -6, 0x1d52 }, - { -9, 0x194e }, - { -12, 0x144b }, - { -15, 0x0ccb }, - { -18, 0x0cc9 }, - { -21, 0x0cc7 }, - {-128, 0xFFFF }, -}; -const size_t RF_ieeeTxPowerLen = sizeof(RF_ieeeTxPower) / sizeof(RF_ieeeTxPower[0]); - - -// TI-RTOS RF Mode Object -RF_Mode RF_ieeeMode = -{ - .rfMode = RF_MODE_AUTO, - .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4, - .mcePatchFxn = &rf_patch_mce_ieee_802_15_4, - .rfePatchFxn = 0, -}; - - -// Overrides for CMD_RADIO_SETUP -static uint32_t pOverrides[] = -{ - // override_use_patch_ieee_802_15_4.xml - // PHY: Use MCE RAM patch, RFE ROM bank 1 - MCE_RFE_OVERRIDE(1,0,0,0,1,0), - // override_synth_ieee_802_15_4.xml - // Synth: Use 48 MHz crystal - (uint32_t)0x00408403, - // override_dcdc_rx_tx_common.xml - // DC/DC regulator: In Tx, use DCDCCTL5[3:0]=0xC (DITHER_EN=1 and IPEAK=4). In Rx, use DCDCCTL5[3:0]=0xC (DITHER_EN=1 and IPEAK=4). - (uint32_t)0xFCFC08C3, - (uint32_t)0xFFFFFFFF, -}; - - -// CMD_RADIO_SETUP -// Radio Setup Command for Pre-Defined Schemes -rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = -{ - .commandNo = 0x0802, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .mode = 0x01, - .loDivider = 0x00, - .config.frontEndMode = 0x0, - .config.biasMode = 0x0, - .config.analogCfgMode = 0x0, - .config.bNoFsPowerUp = 0x0, - .txPower = 0x001F, - .pRegOverride = pOverrides, -}; - - -// CMD_FS -// Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdFs = -{ - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .frequency = 0x0965, - .fractFreq = 0x0000, - .synthConf.bTxMode = 0x0, - .synthConf.refFreq = 0x0, - .__dummy0 = 0x00, - .__dummy1 = 0x00, - .__dummy2 = 0x00, - .__dummy3 = 0x0000, -}; - - -// CMD_IEEE_RX -// IEEE 802.15.4 Receive Command -rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = -{ - .commandNo = CMD_IEEE_RX, - .status = IDLE, - .pNextOp = NULL, - .startTime = 0x00000000, - .startTrigger.triggerType = TRIG_NOW, - .condition.rule = COND_NEVER, - .channel = 0, - .rxConfig.bAutoFlushCrc = 0x1, - .rxConfig.bAutoFlushIgn = 0x0, - .rxConfig.bIncludePhyHdr = 0x0, - .rxConfig.bIncludeCrc = 0x1, - .rxConfig.bAppendRssi = 0x1, - .rxConfig.bAppendCorrCrc = 0x1, - .rxConfig.bAppendSrcInd = 0x0, - .rxConfig.bAppendTimestamp = 0x1, - .pRxQ = NULL, - .pOutput = NULL, - .frameFiltOpt.frameFiltEn = 0x0, - .frameFiltOpt.frameFiltStop = 0x1, - .frameFiltOpt.autoAckEn = 0x0, - .frameFiltOpt.slottedAckEn = 0x0, - .frameFiltOpt.autoPendEn = 0x0, - .frameFiltOpt.defaultPend = 0x0, - .frameFiltOpt.bPendDataReqOnly = 0x0, - .frameFiltOpt.bPanCoord = 0x0, - .frameFiltOpt.maxFrameVersion = 0x2, - .frameFiltOpt.fcfReservedMask = 0x0, - .frameFiltOpt.modifyFtFilter = 0x0, - .frameFiltOpt.bStrictLenFilter = 0x0, - .frameTypes.bAcceptFt0Beacon = 0x1, - .frameTypes.bAcceptFt1Data = 0x1, - .frameTypes.bAcceptFt2Ack = 0x1, - .frameTypes.bAcceptFt3MacCmd = 0x1, - .frameTypes.bAcceptFt4Reserved = 0x1, - .frameTypes.bAcceptFt5Reserved = 0x1, - .frameTypes.bAcceptFt6Reserved = 0x1, - .frameTypes.bAcceptFt7Reserved = 0x1, - .ccaOpt.ccaEnEnergy = 0x1, - .ccaOpt.ccaEnCorr = 0x1, - .ccaOpt.ccaEnSync = 0x1, - .ccaOpt.ccaCorrOp = 0x1, - .ccaOpt.ccaSyncOp = 0x0, - .ccaOpt.ccaCorrThr = 0x3, - .ccaRssiThr = 0x64, - .numExtEntries = 0x00, - .numShortEntries = 0x00, - .pExtEntryList = NULL, - .pShortEntryList = NULL, - .localExtAddr = 0x0000000012345678, - .localShortAddr = 0xABBA, - .localPanID = 0x0000, - .endTrigger.triggerType = TRIG_NEVER, - .endTrigger.bEnaCmd = 0x0, - .endTrigger.triggerNo = 0x0, - .endTrigger.pastTrig = 0x0, - .endTime = 0x00000000, -}; - - -// CMD_IEEE_TX -// IEEE 802.15.4 Transmit Command -rfc_CMD_IEEE_TX_t RF_cmdIeeeTx = -{ - .commandNo = 0x2C01, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .txOpt.bIncludePhyHdr = 0x0, - .txOpt.bIncludeCrc = 0x0, - .txOpt.payloadLenMsb = 0x0, - .payloadLen = 0x1E, - .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .timeStamp = 0x00000000, -}; - diff --git a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.h b/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.h deleted file mode 100644 index d3c973b48..000000000 --- a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-ieee-settings.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef IEEE_SETTINGS_H_ -#define IEEE_SETTINGS_H_ - - -#include -#include DeviceFamily_constructPath(driverlib/rf_mailbox.h) -#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) -#include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) -#include - -#include - -// RF TX power table -extern RF_TxPower RF_ieeeTxPower[]; -extern const size_t RF_ieeeTxPowerLen; - -// TI-RTOS RF Mode Object -extern RF_Mode RF_ieeeMode; - -// RF Core API commands -extern rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup; -extern rfc_CMD_FS_t RF_cmdFs; -extern rfc_CMD_IEEE_RX_t RF_cmdIeeeRx; -extern rfc_CMD_IEEE_TX_t RF_cmdIeeeTx; - -#endif /* IEEE_SETTINGS_H_ */ diff --git a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.c b/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.c deleted file mode 100644 index 2c654cf24..000000000 --- a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.c +++ /dev/null @@ -1,278 +0,0 @@ -//********************************************************************************* -// Generated by SmartRF Studio version 2.8.0 ( build #41) -// Compatible with SimpleLink SDK version: CC13x2 SDK 1.60.xx.xx -// Device: CC1352 Rev. 1.0 -// -//********************************************************************************* - - -//********************************************************************************* -// Parameter summary -// Address: off -// Address0: 0xAA -// Address1: 0xBB -// Frequency: 868.00000 MHz -// Data Format: Serial mode disable -// Deviation: 25.000 kHz -// pktLen: 30 -// 802.15.4g Mode: off -// Select bit order to transmit PSDU octets:: 1 -// Packet Length Config: Variable -// Max Packet Length: 255 -// Packet Length: 30 -// RX Filter BW: 98.0 kHz -// Symbol Rate: 50.00000 kBaud -// Sync Word Length: 32 Bits -// TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual) -// Whitening: No whitening - -#include -#include DeviceFamily_constructPath(driverlib/rf_mailbox.h) -#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) -#include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) -#include -#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_prop.h) -#include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_genfsk.h) -#include DeviceFamily_constructPath(rf_patches/rf_patch_mce_genfsk.h) - -#include "rf-common.h" - -/*---------------------------------------------------------------------------*/ -/** - * \addtogroup rf-core-prop - * @{ - * - * \file - * Default TX power settings. The board can override - */ -/*---------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------*/ -/* Default TX power settings for the 779-930MHz band */ -RF_TxPower RF_propTxPower779_930[] = { - { 14, 0xa73f }, - { 13, 0xa63f }, /* 12.5 */ - { 12, 0xb818 }, - { 11, 0x50da }, - { 10, 0x38d3 }, - { 9, 0x2ccd }, - { 8, 0x24cb }, - { 7, 0x20c9 }, - { 6, 0x1cc7 }, - { 5, 0x18c6 }, - { 4, 0x18c5 }, - { 3, 0x14c4 }, - { 2, 0x1042 }, - { 1, 0x10c3 }, - { 0, 0x0041 }, - { -10, 0x08c0 }, - {-128, 0xFFFF }, -}; -const size_t RF_propTxPower779_930Size = sizeof(RF_propTxPower779_930) / sizeof(RF_propTxPower779_930[0]); -/*---------------------------------------------------------------------------*/ -/* Default TX power settings for the 431-527MHz band */ -RF_TxPower RF_propTxPower431_527[] = { - { 15, 0x003f }, - { 14, 0xbe3f }, /* 13.7 */ - { 13, 0x6a0f }, - { 10, 0x3dcb }, - { 6, 0x22c4 }, - {-128, 0xFFFF }, -}; -const size_t RF_propTxPower431_527Size = sizeof(RF_propTxPower431_527) / sizeof(RF_propTxPower431_527[0]); -/*---------------------------------------------------------------------------*/ -/** - * @} - */ - -// TI-RTOS RF Mode Object -RF_Mode RF_propMode = -{ - .rfMode = RF_MODE_AUTO, - .cpePatchFxn = &rf_patch_cpe_prop, - .mcePatchFxn = &rf_patch_mce_genfsk, - .rfePatchFxn = &rf_patch_rfe_genfsk, -}; - -// Overrides for CMD_PROP_RADIO_DIV_SETUP -static uint32_t pOverrides[] = -{ - // override_use_patch_prop_genfsk.xml - // PHY: Use MCE RAM patch, RFE RAM patch - MCE_RFE_OVERRIDE(1,0,0,1,0,0), - // override_synth_prop_863_930_div5.xml - // Synth: Use 48 MHz crystal as synth clock, enable extra PLL filtering - (uint32_t)0x02400403, - // Synth: Set minimum RTRIM to 7 - (uint32_t)0x00078793, - // Synth: Configure extra PLL filtering - (uint32_t)0x00108463, - // Synth: Set Fref to 4 MHz - (uint32_t)0x000684A3, - // Synth: Set loop bandwidth after lock to 20 kHz - (uint32_t)0x0A480583, - // Synth: Set loop bandwidth after lock to 20 kHz - (uint32_t)0x7AB80603, - // override_phy_tx_pa_ramp_genfsk.xml - // Tx: Configure PA ramping, set wait time before turning off (0x2F ticks à 16/24 us = 31.3 us). - HW_REG_OVERRIDE(0x6028,0x002F), - // Tx: Configure PA ramp time, PACTL2.RC=0x3 (in ADI0, set PACTL2[3]=1) - ADI_HALFREG_OVERRIDE(0,16,0x8,0x8), - // Tx: Configure PA ramp time, PACTL2.RC=0x3 (in ADI0, set PACTL2[4]=1) - ADI_HALFREG_OVERRIDE(0,17,0x1,0x1), - // override_phy_rx_aaf_bw_0xd.xml - // Rx: Set anti-aliasing filter bandwidth to 0xD (in ADI0, set IFAMPCTL3[7:4]=0xD) - ADI_HALFREG_OVERRIDE(0,61,0xF,0xD), - // override_phy_rx_rssi_offset_neg2db.xml - // Rx: Set RSSI offset to adjust reported RSSI by -2 dB - (uint32_t)0x000288A3, - // TX power override - // DC/DC regulator: In Tx with 14 dBm PA setting, use DCDCCTL5[3:0]=0xF (DITHER_EN=1 and IPEAK=7). In Rx, use DCDCCTL5[3:0]=0xC (DITHER_EN=1 and IPEAK=4). - (uint32_t)0xFFFC08C3, - (uint32_t)0xFFFFFFFF, -}; - - -// CMD_PROP_RADIO_DIV_SETUP -// Proprietary Mode Radio Setup Command for All Frequency Bands -rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup = -{ - .commandNo = 0x3807, - .status = 0x0000, - .pNextOp = 0, - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .modulation.modType = 0x1, - .modulation.deviation = 0x64, - .symbolRate.preScale = 0xf, - .symbolRate.rateWord = 0x8000, - .rxBw = 0x24, - .preamConf.nPreamBytes = 0x3, - .preamConf.preamMode = 0x0, - .formatConf.nSwBits = 0x18, - .formatConf.bBitReversal = 0x0, - .formatConf.bMsbFirst = 0x1, - .formatConf.fecMode = 0x0, - - /* 7: .4g mode with dynamic whitening and CRC choice */ - .formatConf.whitenMode = 0x7, - .config.frontEndMode = 0x00, /* Set by the driver */ - .config.biasMode = 0x00, /* Set by the driver */ - .config.analogCfgMode = 0x0, - .config.bNoFsPowerUp = 0x0, - .txPower = 0x00, /* Driver sets correct value */ - .pRegOverride = pOverrides, - .intFreq = 0x8000, - .centerFreq = 868, - .loDivider = 0x05, -}; - -// CMD_FS -// Frequency Synthesizer Programming Command -rfc_CMD_FS_t rf_cmd_prop_fs = -{ - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .frequency = 0x0364, - .fractFreq = 0x0000, - .synthConf.bTxMode = 0x0, - .synthConf.refFreq = 0x0, - .__dummy0 = 0x00, - .__dummy1 = 0x00, - .__dummy2 = 0x00, - .__dummy3 = 0x0000, -}; - -/* CMD_PROP_TX_ADV */ -rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv = -{ - .commandNo = 0x3803, - .status = 0x0000, - .pNextOp = 0, - .startTime = 0x00000000, - .startTrigger.triggerType = TRIG_NOW, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .pktConf.bFsOff = 0x0, - .pktConf.bUseCrc = 0x1, - .pktConf.bCrcIncSw = 0x0, /* .4g mode */ - .pktConf.bCrcIncHdr = 0x0, /* .4g mode */ - .numHdrBits = 0x10 /* 16: .4g mode */, - .pktLen = 0x0000, - .startConf.bExtTxTrig = 0x0, - .startConf.inputMode = 0x0, - .startConf.source = 0x0, - .preTrigger.triggerType = TRIG_NOW, - .preTrigger.bEnaCmd = 0x0, - .preTrigger.triggerNo = 0x0, - .preTrigger.pastTrig = 0x1, - .preTime = 0x00000000, - .syncWord = 0x0055904e, - .pPkt = 0, -}; -/*---------------------------------------------------------------------------*/ -/* CMD_PROP_RX_ADV */ -rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv = -{ - .commandNo = 0x3804, - .status = 0x0000, - .pNextOp = 0, - .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, - .startTrigger.bEnaCmd = 0x0, - .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, - .condition.nSkip = 0x0, - .pktConf.bFsOff = 0x0, - .pktConf.bRepeatOk = 0x1, - .pktConf.bRepeatNok = 0x1, - .pktConf.bUseCrc = 0x1, - .pktConf.bCrcIncSw = 0x0, /* .4g mode */ - .pktConf.bCrcIncHdr = 0x0, /* .4g mode */ - .pktConf.endType = 0x0, - .pktConf.filterOp = 0x1, - .rxConf.bAutoFlushIgnored = 0x1, - .rxConf.bAutoFlushCrcErr = 0x1, - .rxConf.bIncludeHdr = 0x0, - .rxConf.bIncludeCrc = 0x0, - .rxConf.bAppendRssi = 0x1, - .rxConf.bAppendTimestamp = 0x0, - .rxConf.bAppendStatus = 0x1, - .syncWord0 = 0x0055904e, - .syncWord1 = 0x00000000, - .maxPktLen = 0x0000, /* To be populated by the driver. */ - .hdrConf.numHdrBits = 0x10, /* 16: .4g mode */ - .hdrConf.lenPos = 0x0, /* .4g mode */ - .hdrConf.numLenBits = 0x0B, /* 11 = 0x0B .4g mode */ - .addrConf.addrType = 0x0, - .addrConf.addrSize = 0x0, - .addrConf.addrPos = 0x0, - .addrConf.numAddr = 0x0, - .lenOffset = -4, /* .4g mode */ - .endTrigger.triggerType = TRIG_NEVER, - .endTrigger.bEnaCmd = 0x0, - .endTrigger.triggerNo = 0x0, - .endTrigger.pastTrig = 0x0, - .endTime = 0x00000000, - .pAddr = 0, - .pQueue = 0, - .pOutput = 0, -}; -/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.h b/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.h deleted file mode 100644 index 947c5254e..000000000 --- a/arch/cpu/cc13xx-cc26xx/cc13x2-cc26x2/rf-settings/rf-prop-settings.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef RF_PROP_SETTINGS_H_ -#define RF_PROP_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.8.0 ( build #41) -// Compatible with SimpleLink SDK version: CC13x2 SDK 1.60.xx.xx -// Device: CC1352 Rev. 1.0 -// -//********************************************************************************* -#include -#include DeviceFamily_constructPath(driverlib/rf_mailbox.h) -#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) -#include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) -#include - -#include - -// RF TX power table -extern RF_TxPower RF_propTxPower779_930[]; -extern const size_t RF_propTxPower779_930Size; - -extern RF_TxPower RF_propTxPower431_527[]; -extern const size_t RF_propTxPower431_527Size; - -// TI-RTOS RF Mode Object -extern RF_Mode RF_propMode; - -// RF Core API commands -extern rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup; -extern rfc_CMD_FS_t rf_cmd_prop_fs; -extern rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv; -extern rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv; - - -#endif /* RF_PROP_SETTINGS_H_ */ diff --git a/arch/cpu/cc13xx-cc26xx/dev/rf-ieee-mode.c b/arch/cpu/cc13xx-cc26xx/dev/rf-ieee-mode.c index 08e95a983..4940ff50b 100644 --- a/arch/cpu/cc13xx-cc26xx/dev/rf-ieee-mode.c +++ b/arch/cpu/cc13xx-cc26xx/dev/rf-ieee-mode.c @@ -128,12 +128,16 @@ #ifdef IEEE_MODE_CONF_TX_POWER_TABLE # define TX_POWER_TABLE IEEE_MODE_CONF_TX_POWER_TABLE #else -# define TX_POWER_TABLE ieeeTxPowerTable +# define TX_POWER_TABLE rf_ieee_tx_power_table +#endif + +#ifdef IEEE_MODE_CONF_TX_POWER_TABLE_SIZE +# define TX_POWER_TABLE_SIZE IEEE_MODE_CONF_TX_POWER_TABLE_SIZE +#else +# define TX_POWER_TABLE_SIZE RF_IEEE_TX_POWER_TABLE_SIZE #endif /*---------------------------------------------------------------------------*/ /* TX power table convenience macros */ -#define TX_POWER_TABLE_SIZE ((sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1) - #define TX_POWER_MIN (TX_POWER_TABLE[0]) #define TX_POWER_MAX (TX_POWER_TABLE[TX_POWER_TABLE_SIZE - 1]) @@ -160,7 +164,7 @@ /* How long to wait for an ongoing ACK TX to finish before starting frame TX */ #define TIMEOUT_TX_WAIT (RTIMER_SECOND >> 11) -/* How long to wait for the RF to enter RX in RF_cmdIeeeRx */ +/* How long to wait for the RF to enter RX in cmd_rx */ #define TIMEOUT_ENTER_RX_WAIT (RTIMER_SECOND >> 10) /* How long to wait for the RF to react on CMD_ABORT: around 1 msec */ @@ -177,10 +181,10 @@ static RF_Object g_rfObj; static RF_Handle g_rfHandle; /* RF Core command pointers */ -#define cmd_radio_setup ((volatile rfc_CMD_RADIO_SETUP_t*)&RF_cmdRadioSetup) -#define cmd_fs ((volatile rfc_CMD_FS_t*) &RF_cmdIeeeFs) -#define cmd_tx ((volatile rfc_CMD_IEEE_TX_t*) &RF_cmdIeeeTx) -#define cmd_rx ((volatile rfc_CMD_IEEE_RX_t*) &RF_cmdIeeeRx) +#define cmd_radio_setup (*(volatile rfc_CMD_RADIO_SETUP_t*)&rf_cmd_ieee_radio_setup) +#define cmd_fs (*(volatile rfc_CMD_FS_t*) &rf_cmd_ieee_fs) +#define cmd_tx (*(volatile rfc_CMD_IEEE_TX_t*) &rf_cmd_ieee_tx) +#define cmd_rx (*(volatile rfc_CMD_IEEE_RX_t*) &rf_cmd_ieee_rx) /* RF command handles */ static RF_CmdHandle g_cmdTxHandle; @@ -309,11 +313,11 @@ rf_error_cb(RF_Handle h, RF_CmdHandle ch, RF_EventMask e) { // See SWRZ062B: Synth failed to calibrate, CMD_FS must be repeated if ((ch == RF_ERROR_CMDFS_SYNTH_PROG) && - (cmd_fs->status == ERROR_SYNTH_PROG)) { + (cmd_fs.status == ERROR_SYNTH_PROG)) { // Call CMD_FS async, a synth error will trigger rf_error_cb once more const uint8_t stop_gracefully = 1; RF_flushCmd(g_rfHandle, RF_CMDHANDLE_FLUSH_ALL, stop_gracefully); - RF_postCmd(g_rfHandle, (RF_Op*)cmd_fs, RF_PriorityNormal, NULL, 0); + RF_postCmd(g_rfHandle, (RF_Op*)&cmd_fs, RF_PriorityNormal, NULL, 0); } } /*---------------------------------------------------------------------------*/ @@ -339,27 +343,29 @@ init_data_queue(void) static void init_rf_params(void) { - cmd_rx->pRxQ = &g_rxDataQueue; - cmd_rx->pOutput = &g_rxStats; + cmd_rx.channel = RF_CORE_CHANNEL; + + cmd_rx.pRxQ = &g_rxDataQueue; + cmd_rx.pOutput = &g_rxStats; #if IEEE_MODE_PROMISCOUS - cmd_rx->frameFiltOpt.frameFiltEn = 0; + cmd_rx.frameFiltOpt.frameFiltEn = 0; #else - cmd_rx->frameFiltOpt.frameFiltEn = 1; + cmd_rx.frameFiltOpt.frameFiltEn = 1; #endif #if IEEE_MODE_AUTOACK - cmd_rx->frameFiltOpt.autoAckEn = 1; + cmd_rx.frameFiltOpt.autoAckEn = 1; #else - cmd_rx->frameFiltOpt.autoAckEn = 0; + cmd_rx.frameFiltOpt.autoAckEn = 0; #endif - cmd_rx->ccaRssiThr = IEEE_MODE_RSSI_THRESHOLD; + cmd_rx.ccaRssiThr = IEEE_MODE_RSSI_THRESHOLD; // Initialize address filter command g_cmdModFilt.commandNo = CMD_IEEE_MOD_FILT; - memcpy(&g_cmdModFilt.newFrameFiltOpt, &RF_cmdIeeeRx.frameFiltOpt, sizeof(RF_cmdIeeeRx.frameFiltOpt)); - memcpy(&g_cmdModFilt.newFrameTypes, &RF_cmdIeeeRx.frameTypes, sizeof(RF_cmdIeeeRx.frameTypes)); + memcpy(&(g_cmdModFilt.newFrameFiltOpt), &(rf_cmd_ieee_rx.frameFiltOpt), sizeof(rf_cmd_ieee_rx.frameFiltOpt)); + memcpy(&(g_cmdModFilt.newFrameTypes), &(rf_cmd_ieee_rx.frameTypes), sizeof(rf_cmd_ieee_rx.frameTypes)); } /*---------------------------------------------------------------------------*/ static void @@ -394,12 +400,12 @@ set_channel(uint8_t channel) channel, IEEE_MODE_CHANNEL); channel = IEEE_MODE_CHANNEL; } - if (channel == cmd_rx->channel) { + if (channel == cmd_rx.channel) { // We are already calibrated to this channel return true; } - cmd_rx->channel = 0; + cmd_rx.channel = 0; // freq = freq_base + freq_spacing * (channel - channel_min) const uint32_t newFreq = (uint32_t)(IEEE_MODE_FREQ_BASE + IEEE_MODE_FREQ_SPACING * ((uint32_t)channel - IEEE_MODE_CHAN_MIN)); @@ -409,10 +415,10 @@ set_channel(uint8_t channel) PRINTF("set_channel: %d = 0x%04X.0x%04X (%lu)\n", channel, (uint16_t)freq, (uint16_t)frac, newFreq); - cmd_fs->frequency = (uint16_t)freq; - cmd_fs->fractFreq = (uint16_t)frac; + cmd_fs.frequency = (uint16_t)freq; + cmd_fs.fractFreq = (uint16_t)frac; - const bool rx_active = (cmd_rx->status == ACTIVE); + const bool rx_active = (cmd_rx.status == ACTIVE); if (rx_active) { const uint8_t stop_gracefully = 1; @@ -424,16 +430,16 @@ set_channel(uint8_t channel) uint8_t tries = 0; bool cmd_ok = false; do { - events = RF_runCmd(g_rfHandle, (RF_Op*)cmd_fs, RF_PriorityNormal, NULL, 0); + events = RF_runCmd(g_rfHandle, (RF_Op*)&cmd_fs, RF_PriorityNormal, NULL, 0); cmd_ok = ((events & RF_EventLastCmdDone) != 0) - && (cmd_fs->status == DONE_OK); + && (cmd_fs.status == DONE_OK); } while (!cmd_ok && (tries++ < 3)); if (!cmd_ok) { return false; } - cmd_rx->channel = channel; + cmd_rx.channel = channel; if (rx_active) { set_rx(POWER_STATE_ON); @@ -537,7 +543,7 @@ init(void) init_rf_params(); init_data_queue(); - g_rfHandle = RF_open(&g_rfObj, &RF_ieeeMode, (RF_RadioSetup*)cmd_radio_setup, ¶ms); + g_rfHandle = RF_open(&g_rfObj, &rf_ieee_mode, (RF_RadioSetup*)&cmd_radio_setup, ¶ms); assert(g_rfHandle != NULL); set_channel(IEEE_MODE_CHANNEL); @@ -584,7 +590,7 @@ set_rx(const PowerState state) } if (state & POWER_STATE_ON) { - if (cmd_rx->status == ACTIVE) { + if (cmd_rx.status == ACTIVE) { PRINTF("set_rx(on): already in RX\n"); return CMD_RESULT_OK; } @@ -592,8 +598,8 @@ set_rx(const PowerState state) RF_ScheduleCmdParams schedParams; RF_ScheduleCmdParams_init(&schedParams); - cmd_rx->status = IDLE; - g_cmdRxHandle = RF_scheduleCmd(g_rfHandle, (RF_Op*)cmd_rx, &schedParams, rx_cb, + cmd_rx.status = IDLE; + g_cmdRxHandle = RF_scheduleCmd(g_rfHandle, (RF_Op*)&cmd_rx, &schedParams, rx_cb, RF_EventRxOk | RF_EventRxBufFull | RF_EventRxEntryDone); if ((g_cmdRxHandle == RF_ALLOC_ERROR) || (g_cmdRxHandle == RF_SCHEDULE_CMD_ERROR)) { PRINTF("transmit: unable to allocate RX command\n"); @@ -608,22 +614,22 @@ static int transmit_aux(unsigned short transmit_len) { // Configure TX command - cmd_tx->payloadLen = (uint8_t)transmit_len; - cmd_tx->pPayload = &g_txBuf[TX_BUF_HDR_LEN]; - cmd_tx->startTime = 0; - cmd_tx->startTrigger.triggerType = TRIG_NOW; + cmd_tx.payloadLen = (uint8_t)transmit_len; + cmd_tx.pPayload = &g_txBuf[TX_BUF_HDR_LEN]; + cmd_tx.startTime = 0; + cmd_tx.startTrigger.triggerType = TRIG_NOW; RF_ScheduleCmdParams schedParams; RF_ScheduleCmdParams_init(&schedParams); // As IEEE_TX is a FG command, the TX operation will be executed // either way if RX is running or not - cmd_tx->status = IDLE; - g_cmdTxHandle = RF_scheduleCmd(g_rfHandle, (RF_Op*)cmd_tx, &schedParams, NULL, 0); + cmd_tx.status = IDLE; + g_cmdTxHandle = RF_scheduleCmd(g_rfHandle, (RF_Op*)&cmd_tx, &schedParams, NULL, 0); if ((g_cmdTxHandle == RF_ALLOC_ERROR) || (g_cmdTxHandle == RF_SCHEDULE_CMD_ERROR)) { // Failure sending the CMD_IEEE_TX command PRINTF("transmit: failed to allocate TX command cmdHandle=%d, status=%04x\n", - g_cmdTxHandle, cmd_tx->status); + g_cmdTxHandle, cmd_tx.status); return RADIO_TX_ERR; } @@ -633,7 +639,7 @@ transmit_aux(unsigned short transmit_len) RF_EventMask events = RF_pendCmd(g_rfHandle, g_cmdTxHandle, 0); if ((events & (RF_EventFGCmdDone | RF_EventLastFGCmdDone)) == 0) { PRINTF("transmit: TX command error events=0x%08llx, status=0x%04x\n", - events, cmd_tx->status); + events, cmd_tx.status); return RADIO_TX_ERR; } @@ -643,7 +649,7 @@ transmit_aux(unsigned short transmit_len) static int transmit(unsigned short transmit_len) { - const bool was_rx = (cmd_rx->status == ACTIVE); + const bool was_rx = (cmd_rx.status == ACTIVE); if (g_bSendOnCca && channel_clear() != 1) { PRINTF("transmit: channel wasn't clear\n"); @@ -753,7 +759,7 @@ channel_clear_aux(void) static int channel_clear(void) { - const bool was_rx = (cmd_rx->status == ACTIVE); + const bool was_rx = (cmd_rx.status == ACTIVE); if (!was_rx && set_rx(POWER_STATE_ON) != CMD_RESULT_OK) { PRINTF("channel_clear: unable to start RX\n"); return CHANNEL_CLEAR_ERROR; @@ -771,7 +777,7 @@ static int receiving_packet(void) { // If we are not in RX, we are not receiving - if (cmd_rx->status != ACTIVE) { + if (cmd_rx.status != ACTIVE) { PRINTF("receiving_packet: not in RX\n"); return 0; } @@ -873,23 +879,23 @@ get_value(radio_param_t param, radio_value_t *value) return RADIO_RESULT_OK; case RADIO_PARAM_CHANNEL: - *value = (radio_value_t)cmd_rx->channel; + *value = (radio_value_t)cmd_rx.channel; return RADIO_RESULT_OK; case RADIO_PARAM_PAN_ID: - *value = (radio_value_t)cmd_rx->localPanID; + *value = (radio_value_t)cmd_rx.localPanID; return RADIO_RESULT_OK; case RADIO_PARAM_16BIT_ADDR: - *value = (radio_value_t)cmd_rx->localShortAddr; + *value = (radio_value_t)cmd_rx.localShortAddr; return RADIO_RESULT_OK; case RADIO_PARAM_RX_MODE: *value = 0; - if (cmd_rx->frameFiltOpt.frameFiltEn) { + if (cmd_rx.frameFiltOpt.frameFiltEn) { *value |= (radio_value_t)RADIO_RX_MODE_ADDRESS_FILTER; } - if (cmd_rx->frameFiltOpt.autoAckEn) { + if (cmd_rx.frameFiltOpt.autoAckEn) { *value |= (radio_value_t)RADIO_RX_MODE_AUTOACK; } if (g_bPollMode) { @@ -908,7 +914,7 @@ get_value(radio_param_t param, radio_value_t *value) : RADIO_RESULT_OK; case RADIO_PARAM_CCA_THRESHOLD: - *value = cmd_rx->ccaRssiThr; + *value = cmd_rx.ccaRssiThr; return RADIO_RESULT_OK; case RADIO_PARAM_RSSI: @@ -972,7 +978,7 @@ set_value(radio_param_t param, radio_value_t value) return RADIO_RESULT_OK; case RADIO_PARAM_PAN_ID: - cmd_rx->localPanID = (uint16_t)value; + cmd_rx.localPanID = (uint16_t)value; if (rf_is_on() && set_rx(POWER_STATE_RESTART) != CMD_RESULT_OK) { PRINTF("failed to restart RX"); return RADIO_RESULT_ERROR; @@ -980,7 +986,7 @@ set_value(radio_param_t param, radio_value_t value) return RADIO_RESULT_OK; case RADIO_PARAM_16BIT_ADDR: - cmd_rx->localShortAddr = (uint16_t)value; + cmd_rx.localShortAddr = (uint16_t)value; if (rf_is_on() && set_rx(POWER_STATE_RESTART) != CMD_RESULT_OK) { PRINTF("failed to restart RX"); return RADIO_RESULT_ERROR; @@ -993,21 +999,21 @@ set_value(radio_param_t param, radio_value_t value) return RADIO_RESULT_INVALID_VALUE; } - cmd_rx->frameFiltOpt.frameFiltEn = (value & RADIO_RX_MODE_ADDRESS_FILTER) != 0; - cmd_rx->frameFiltOpt.frameFiltStop = 1; - cmd_rx->frameFiltOpt.autoAckEn = (value & RADIO_RX_MODE_AUTOACK) != 0; - cmd_rx->frameFiltOpt.slottedAckEn = 0; - cmd_rx->frameFiltOpt.autoPendEn = 0; - cmd_rx->frameFiltOpt.defaultPend = 0; - cmd_rx->frameFiltOpt.bPendDataReqOnly = 0; - cmd_rx->frameFiltOpt.bPanCoord = 0; - cmd_rx->frameFiltOpt.bStrictLenFilter = 0; + cmd_rx.frameFiltOpt.frameFiltEn = (value & RADIO_RX_MODE_ADDRESS_FILTER) != 0; + cmd_rx.frameFiltOpt.frameFiltStop = 1; + cmd_rx.frameFiltOpt.autoAckEn = (value & RADIO_RX_MODE_AUTOACK) != 0; + cmd_rx.frameFiltOpt.slottedAckEn = 0; + cmd_rx.frameFiltOpt.autoPendEn = 0; + cmd_rx.frameFiltOpt.defaultPend = 0; + cmd_rx.frameFiltOpt.bPendDataReqOnly = 0; + cmd_rx.frameFiltOpt.bPanCoord = 0; + cmd_rx.frameFiltOpt.bStrictLenFilter = 0; const bool bOldPollMode = g_bPollMode; g_bPollMode = (value & RADIO_RX_MODE_POLL_MODE) != 0; if (g_bPollMode == bOldPollMode) { // Do not turn the radio off and on, just send an update command - memcpy(&g_cmdModFilt.newFrameFiltOpt, &RF_cmdIeeeRx.frameFiltOpt, sizeof(RF_cmdIeeeRx.frameFiltOpt)); + memcpy(&g_cmdModFilt.newFrameFiltOpt, &(rf_cmd_ieee_rx.frameFiltOpt), sizeof(rf_cmd_ieee_rx.frameFiltOpt)); const RF_Stat stat = RF_runImmediateCmd(g_rfHandle, (uint32_t*)&g_cmdModFilt); if (stat != RF_StatCmdDoneSuccess) { PRINTF("setting address filter failed: stat=0x%02X\n", stat); @@ -1038,7 +1044,7 @@ set_value(radio_param_t param, radio_value_t value) : RADIO_RESULT_OK; case RADIO_PARAM_CCA_THRESHOLD: - cmd_rx->ccaRssiThr = (int8_t)value; + cmd_rx.ccaRssiThr = (int8_t)value; if (rf_is_on() && set_rx(POWER_STATE_RESTART) != CMD_RESULT_OK) { PRINTF("failed to restart RX"); return RADIO_RESULT_ERROR; @@ -1059,12 +1065,12 @@ get_object(radio_param_t param, void *dest, size_t size) switch (param) { case RADIO_PARAM_64BIT_ADDR: { - const size_t srcSize = sizeof(cmd_rx->localExtAddr); + const size_t srcSize = sizeof(cmd_rx.localExtAddr); if(size != srcSize) { return RADIO_RESULT_INVALID_VALUE; } - const uint8_t *pSrc = (uint8_t *)&(cmd_rx->localExtAddr); + const uint8_t *pSrc = (uint8_t *)&(cmd_rx.localExtAddr); uint8_t *pDest = dest; for(size_t i = 0; i < srcSize; ++i) { pDest[i] = pSrc[srcSize - 1 - i]; @@ -1095,18 +1101,18 @@ set_object(radio_param_t param, const void *src, size_t size) switch (param) { case RADIO_PARAM_64BIT_ADDR: { - const size_t destSize = sizeof(cmd_rx->localExtAddr); + const size_t destSize = sizeof(cmd_rx.localExtAddr); if (size != destSize) { return RADIO_RESULT_INVALID_VALUE; } const uint8_t *pSrc = (const uint8_t *)src; - uint8_t *pDest = (uint8_t *)&cmd_rx->localExtAddr; + uint8_t *pDest = (uint8_t *)&(cmd_rx.localExtAddr); for (size_t i = 0; i < destSize; ++i) { pDest[i] = pSrc[destSize - 1 - i]; } - const bool is_rx = (cmd_rx->status == ACTIVE); + const bool is_rx = (cmd_rx.status == ACTIVE); if (is_rx && set_rx(POWER_STATE_RESTART) != CMD_RESULT_OK) { return RADIO_RESULT_ERROR; } diff --git a/arch/cpu/cc13xx-cc26xx/dev/rf-prop-mode.c b/arch/cpu/cc13xx-cc26xx/dev/rf-prop-mode.c index be893e8bc..70d355623 100644 --- a/arch/cpu/cc13xx-cc26xx/dev/rf-prop-mode.c +++ b/arch/cpu/cc13xx-cc26xx/dev/rf-prop-mode.c @@ -209,10 +209,10 @@ volatile static uint8_t *rx_read_entry; static uint8_t tx_buf[TX_BUF_HDR_LEN + TX_BUF_PAYLOAD_LEN] CC_ALIGN(4); /*---------------------------------------------------------------------------*/ -#define cmd_radio_setup ((volatile rfc_CMD_PROP_RADIO_DIV_SETUP_t *)&RF_cmdPropRadioDivSetup) -#define cmd_fs ((volatile rfc_CMD_FS_t *)&RF_cmdPropFs) -#define cmd_tx ((volatile rfc_CMD_PROP_TX_ADV_t *)&RF_cmdPropTxAdv) -#define cmd_rx ((volatile rfc_CMD_PROP_RX_ADV_t *)&RF_cmdPropRxAdv) +#define cmd_radio_setup ((volatile rfc_CMD_PROP_RADIO_DIV_SETUP_t *)&rf_cmd_prop_radio_div_setup) +#define cmd_fs ((volatile rfc_CMD_FS_t *) &rf_cmd_prop_fs) +#define cmd_tx ((volatile rfc_CMD_PROP_TX_ADV_t *) &rf_cmd_prop_tx_adv) +#define cmd_rx ((volatile rfc_CMD_PROP_RX_ADV_t *) &rf_cmd_prop_rx_adv) /*---------------------------------------------------------------------------*/ /* RF driver */ static RF_Object rfObject; @@ -777,7 +777,7 @@ rf_init(void) // Disable automatic power-down just to not interfere with stack timing params.nInactivityTimeout = 0; - rfHandle = RF_open(&rfObject, &RF_propMode, (RF_RadioSetup*)cmd_radio_setup, ¶ms); + rfHandle = RF_open(&rfObject, &rf_prop_mode, (RF_RadioSetup*)cmd_radio_setup, ¶ms); assert(rfHandle != NULL); /* Initialise RX buffers */ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c index b6f05f337..0acff3cbf 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.c @@ -1,4 +1,33 @@ -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // IEEE Channel: 11 // Frequency: 2405 MHz @@ -6,9 +35,9 @@ // Packet Data: 255 // Preamble (32 bit): 01010101... // TX Power: 5 dBm - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -17,26 +46,24 @@ #include "driverlib/rf_ieee_cmd.h" #include - +/*---------------------------------------------------------------------------*/ #include "ieee-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_ieeeMode = +RF_Mode rf_ieee_mode = { .rfMode = RF_MODE_IEEE_15_4, .cpePatchFxn = 0, .mcePatchFxn = 0, .rfePatchFxn = 0, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry ieeeTxPowerTable[14] = +RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1] = { { -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) }, { -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) }, @@ -53,10 +80,9 @@ RF_TxPowerTable_Entry ieeeTxPowerTable[14] = { 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_RADIO_SETUP (CC2650) -uint32_t pIeeeOverrides[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides[] CC_ALIGN(4) = { // override_synth_ieee_15_4.xml HW_REG_OVERRIDE(0x4038,0x0035), // Synth: Set recommended RTRIM to 5 @@ -81,10 +107,9 @@ uint32_t pIeeeOverrides[] CC_ALIGN(4) = HW_REG_OVERRIDE(0x50DC,0x002B), // Rx: Adjust AGC DC filter (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // Old override list -uint32_t pIeeeOverridesOld[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides_old[] CC_ALIGN(4) = { (uint32_t)0x00354038, /* Synth: Set RTRIM (POTAILRESTRIM) to 5 */ (uint32_t)0x4001402D, /* Synth: Correct CKVD latency setting (address) */ @@ -100,47 +125,46 @@ uint32_t pIeeeOverridesOld[] CC_ALIGN(4) = (uint32_t)0x002082C3, /* Increase synth programming timeout */ (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_RADIO_SETUP // Radio Setup Command for Pre-Defined Schemes -rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = +rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup = { - .commandNo = 0x0802, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_RADIO_SETUP, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .mode = 0x01, .config.frontEndMode = 0x0, - .config.biasMode = 0x0, + .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, - .txPower = 0x9330, - .pRegOverride = pIeeeOverrides, + .txPower = 0x9330, /* 5 dBm default */ + .pRegOverride = rf_ieee_overrides, }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdIeeeFs = +rfc_CMD_FS_t rf_cmd_ieee_fs = { - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_FS, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .frequency = 0x0965, - .fractFreq = 0x0000, + .frequency = 0x0965, /* set by driver */ + .fractFreq = 0x0000, /* set by driver */ .synthConf.bTxMode = 0x1, .synthConf.refFreq = 0x0, .__dummy0 = 0x00, @@ -148,63 +172,63 @@ rfc_CMD_FS_t RF_cmdIeeeFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_TX // The command ID number 0x2C01 -rfc_CMD_IEEE_TX_t RF_cmdIeeeTx = +rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx = { - .commandNo = 0x2C01, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_TX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .txOpt.bIncludePhyHdr = 0x0, .txOpt.bIncludeCrc = 0x0, .txOpt.payloadLenMsb = 0x0, - .payloadLen = 0x1E, - .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .payloadLen = 0x0, /* set by driver */ + .pPayload = 0, /* set by driver */ .timeStamp = 0x00000000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_RX // The command ID number 0x2801 -rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = +rfc_CMD_IEEE_RX_t rf_cmd_ieee_xx = { - .commandNo = 0x2801, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_RX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .channel = 0x00, - .rxConfig.bAutoFlushCrc = 0x0, + .channel = 0x00, /* set by driver */ + .rxConfig.bAutoFlushCrc = 0x1, .rxConfig.bAutoFlushIgn = 0x0, .rxConfig.bIncludePhyHdr = 0x0, - .rxConfig.bIncludeCrc = 0x0, + .rxConfig.bIncludeCrc = 0x1, .rxConfig.bAppendRssi = 0x1, .rxConfig.bAppendCorrCrc = 0x1, .rxConfig.bAppendSrcInd = 0x0, - .rxConfig.bAppendTimestamp = 0x0, - .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .frameFiltOpt.frameFiltEn = 0x0, - .frameFiltOpt.frameFiltStop = 0x0, - .frameFiltOpt.autoAckEn = 0x0, + .rxConfig.bAppendTimestamp = 0x1, + .pRxQ = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ + .frameFiltOpt.frameFiltEn = 0x0, /* set by driver */ + .frameFiltOpt.frameFiltStop = 0x1, + .frameFiltOpt.autoAckEn = 0x0, /* set by driver */ .frameFiltOpt.slottedAckEn = 0x0, .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0, .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0, - .frameFiltOpt.maxFrameVersion = 0x3, + .frameFiltOpt.maxFrameVersion = 0x2, .frameFiltOpt.fcfReservedMask = 0x0, .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0, @@ -216,25 +240,26 @@ rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = .frameTypes.bAcceptFt5Reserved = 0x1, .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1, - .ccaOpt.ccaEnEnergy = 0x0, - .ccaOpt.ccaEnCorr = 0x0, - .ccaOpt.ccaEnSync = 0x0, + .ccaOpt.ccaEnEnergy = 0x1, + .ccaOpt.ccaEnCorr = 0x1, + .ccaOpt.ccaEnSync = 0x1, .ccaOpt.ccaCorrOp = 0x1, - .ccaOpt.ccaSyncOp = 0x1, - .ccaOpt.ccaCorrThr = 0x0, - .ccaRssiThr = 0x64, + .ccaOpt.ccaSyncOp = 0x0, + .ccaOpt.ccaCorrThr = 0x3, + .ccaRssiThr = 0x0, /* set by driver */ .__dummy0 = 0x00, .numExtEntries = 0x00, .numShortEntries = 0x00, - .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .localExtAddr = 0x0000000012345678, - .localShortAddr = 0xABBA, + .pExtEntryList = 0, + .pShortEntryList = 0, + .localExtAddr = 0x0, /* set by driver */ + .localShortAddr = 0x0, /* set by driver */ .localPanID = 0x0000, .__dummy1 = 0x000000, - .endTrigger.triggerType = 0x1, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.h index 01b773215..20f4e2656 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-settings.h @@ -1,12 +1,36 @@ -#ifndef _IEEE_SETTINGS_H_ -#define _IEEE_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: No known SDK for this device -// Device: CC2650 Rev. 2.2 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef IEEE_SETTINGS_H_ +#define IEEE_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -16,26 +40,23 @@ #include "driverlib/rf_ieee_mailbox.h" #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_ieeeMode; - - +extern RF_Mode rf_ieee_mode; +/*---------------------------------------------------------------------------*/ // TX Power Table -extern RF_TxPowerTable_Entry ieeeTxPowerTable[14]; - +#define RF_IEEE_TX_POWER_TABLE_SIZE 13 +extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup; -extern rfc_CMD_FS_t RF_cmdIeeeFs; -extern rfc_CMD_IEEE_TX_t RF_cmdIeeeTx; -extern rfc_CMD_IEEE_RX_t RF_cmdIeeeRx; - - +extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup; +extern rfc_CMD_FS_t rf_cmd_ieee_fs; +extern rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx; +extern rfc_CMD_IEEE_RX_t rf_cmd_ieee_xx; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pIeeeOverrides[]; - - -#endif // _IEEE_SETTINGS_H_ - +extern uint32_t rf_ieee_overrides[]; +/*---------------------------------------------------------------------------*/ +#endif /* IEEE_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.c index 702295391..e0608075a 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.c @@ -1,12 +1,33 @@ -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC13x0 SDK 2.10.xx.xx -// Device: CC1350 Rev. 2.1 -// -//********************************************************************************* - - -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // Address: 0 // Address0: 0xAA @@ -26,9 +47,9 @@ // Sync Word Length: 24 Bits // TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual) // Whitening: Dynamically IEEE 802.15.4g compatible whitener and 16/32-bit CRC - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -37,26 +58,24 @@ #include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_genfsk.h) #include - +/*---------------------------------------------------------------------------*/ #include "prop-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_propMode = +RF_Mode rf_prop_mode = { .rfMode = RF_MODE_PROPRIETARY_SUB_1, .cpePatchFxn = &rf_patch_cpe_genfsk, .mcePatchFxn = 0, .rfePatchFxn = &rf_patch_rfe_genfsk, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry propTxPowerTable[16] = +RF_TxPowerTable_Entry rf_prop_tx_power_table[RF_PROP_TX_POWER_TABLE_SIZE+1] = { { -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) }, { 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 9) }, @@ -76,10 +95,9 @@ RF_TxPowerTable_Entry propTxPowerTable[16] = { 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 85) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_PROP_RADIO_DIV_SETUP -uint32_t pPropOverrides[] CC_ALIGN(4) = +uint32_t p_prop_overrides[] CC_ALIGN(4) = { // override_use_patch_prop_genfsk.xml MCE_RFE_OVERRIDE(0,4,0,1,0,0), // PHY: Use MCE ROM bank 4, RFE RAM patch @@ -114,15 +132,14 @@ uint32_t pPropOverrides[] CC_ALIGN(4) = ADI_REG_OVERRIDE(0,12,0xF8), // Tx: Set PA trim to max (in ADI0, set PACTL0=0xF8) (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_PROP_RADIO_DIV_SETUP // Proprietary Mode Radio Setup Command for All Frequency Bands -rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = +rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup = { .commandNo = 0x3807, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, @@ -134,7 +151,7 @@ rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = .modulation.deviation = 0x64, .symbolRate.preScale = 0xF, .symbolRate.rateWord = 0x8000, - .rxBw = 0x24, + .rxBw = 0x52, .preamConf.nPreamBytes = 0x3, .preamConf.preamMode = 0x0, .formatConf.nSwBits = 0x18, @@ -152,14 +169,14 @@ rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = .intFreq = 0x8000, .loDivider = 0x05, }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdPropFs = +rfc_CMD_FS_t rf_cmd_prop_fs = { .commandNo = 0x0803, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, @@ -176,14 +193,14 @@ rfc_CMD_FS_t RF_cmdPropFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_PROP_TX_ADV // Proprietary Mode Advanced Transmit Command -rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv = +rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv = { - .commandNo = 0x3803, + .commandNo = CMD_PROP_TX_ADV, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x2, .startTrigger.bEnaCmd = 0x0, @@ -200,61 +217,62 @@ rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv = .startConf.bExtTxTrig = 0x0, .startConf.inputMode = 0x0, .startConf.source = 0x0, - .preTrigger.triggerType = 0x4, + .preTrigger.triggerType = TRIG_REL_START, .preTrigger.bEnaCmd = 0x0, .preTrigger.triggerNo = 0x0, .preTrigger.pastTrig = 0x1, .preTime = 0x00000000, .syncWord = 0x0055904E, - .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pPkt = 0, /* set by driver */ }; - +/*---------------------------------------------------------------------------*/ // CMD_PROP_RX_ADV // Proprietary Mode Advanced Receive Command -rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv = +rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv = { - .commandNo = 0x3804, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_PROP_RX_ADV, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .pktConf.bFsOff = 0x0, - .pktConf.bRepeatOk = 0x0, - .pktConf.bRepeatNok = 0x0, - .pktConf.bUseCrc = 0x0, + .pktConf.bRepeatOk = 0x1, + .pktConf.bRepeatNok = 0x1, + .pktConf.bUseCrc = 0x1, .pktConf.bCrcIncSw = 0x0, .pktConf.bCrcIncHdr = 0x0, .pktConf.endType = 0x0, - .pktConf.filterOp = 0x0, - .rxConf.bAutoFlushIgnored = 0x0, - .rxConf.bAutoFlushCrcErr = 0x0, + .pktConf.filterOp = 0x1, + .rxConf.bAutoFlushIgnored = 0x1, + .rxConf.bAutoFlushCrcErr = 0x1, .rxConf.bIncludeHdr = 0x0, .rxConf.bIncludeCrc = 0x0, - .rxConf.bAppendRssi = 0x0, + .rxConf.bAppendRssi = 0x1, .rxConf.bAppendTimestamp = 0x0, - .rxConf.bAppendStatus = 0x0, - .syncWord0 = 0x930B51DE, + .rxConf.bAppendStatus = 0x1, + .syncWord0 = 0x0055904E, .syncWord1 = 0x00000000, - .maxPktLen = 0x00FF, - .hdrConf.numHdrBits = 0x0, + .maxPktLen = 0x0, /* set by driver */ + .hdrConf.numHdrBits = 0x10, .hdrConf.lenPos = 0x0, - .hdrConf.numLenBits = 0x0, + .hdrConf.numLenBits = 0x0B, .addrConf.addrType = 0x0, .addrConf.addrSize = 0x0, .addrConf.addrPos = 0x0, .addrConf.numAddr = 0x0, - .lenOffset = 0x00, - .endTrigger.triggerType = 0x0, + .lenOffset = 0xFC, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, - .pAddr = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pAddr = 0, /* set by driver */ + .pQueue = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.h index 85fedc8fd..ec580734d 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-settings.h @@ -1,38 +1,58 @@ -#ifndef _PROP_SETTINGS_H_ -#define _PROP_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC13x0 SDK 2.10.xx.xx -// Device: CC1350 Rev. 2.1 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef PROP_SETTINGS_H_ +#define PROP_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_propMode; - - +extern RF_Mode rf_prop_mode; +/*---------------------------------------------------------------------------*/ // TX Power Table -extern RF_TxPowerTable_Entry propTxPowerTable[16]; - - +#define RF_PROP_TX_POWER_TABLE_SIZE 15 +extern RF_TxPowerTable_Entry rf_prop_tx_power_table[PROP_TX_POWER_TABLE_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup; -extern rfc_CMD_FS_t RF_cmdPropFs; -extern rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv; -extern rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv; - - +extern rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup; +extern rfc_CMD_FS_t rf_cmd_prop_fs; +extern rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv; +extern rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pPropOverrides[]; - - -#endif // _PROP_SETTINGS_H_ - +extern uint32_t p_prop_overrides[]; +/*---------------------------------------------------------------------------*/ +#endif /* PROP_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c index efb1882da..efa12e2f6 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.c @@ -1,12 +1,33 @@ -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC13x2 SDK 2.10.xx.xx -// Device: CC1352P Rev. 1.1 -// -//********************************************************************************* - - -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // IEEE Channel: 11 // Frequency: 2405 MHz @@ -19,9 +40,9 @@ // For High PA: // TX Power: 20 dBm (requires define CCFG_FORCE_VDDR_HH = 0 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual) // Enable high output power PA: true - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -30,26 +51,24 @@ #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_ieee_802_15_4.h) #include - +/*---------------------------------------------------------------------------*/ #include "ieee-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_ieeeMode = +RF_Mode rf_ieee_mode = { .rfMode = RF_MODE_AUTO, .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4, .mcePatchFxn = &rf_patch_mce_ieee_802_15_4, .rfePatchFxn = 0, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry ieeeDefaultPaTxPowerTable[16] = +RF_TxPowerTable_Entry rf_ieee_tx_power_table_default_pa[RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE+1] = { { -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) }, { -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) }, @@ -68,14 +87,13 @@ RF_TxPowerTable_Entry ieeeDefaultPaTxPowerTable[16] = { 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry ieeeHighPaTxPowerTable[16] = +RF_TxPowerTable_Entry rf_ieee_tx_power_table_high_pa[RF_IEEE_TX_POWER_TABLE_HIGH_PA_SIZE+1] = { { 0, RF_TxPowerTable_HIGH_PA_ENTRY(29, 0, 1, 17, 1) }, { 3, RF_TxPowerTable_HIGH_PA_ENTRY(39, 0, 1, 20, 1) }, @@ -94,10 +112,9 @@ RF_TxPowerTable_Entry ieeeHighPaTxPowerTable[16] = { 20, RF_TxPowerTable_HIGH_PA_ENTRY(56, 2, 1, 45, 63) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_RADIO_SETUP -uint32_t pIeeeDefaultPaOverrides[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides_default_pa[] CC_ALIGN(4) = { // override_ieee_802_15_4.xml MCE_RFE_OVERRIDE(1,0,0,0,1,0), // PHY: Use MCE RAM patch, RFE ROM bank 1 @@ -116,10 +133,9 @@ uint32_t pIeeeDefaultPaOverrides[] CC_ALIGN(4) = (uint32_t)0x000F8883, // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0) (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_RADIO_SETUP -uint32_t pIeeeHighPaOverrides[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides_high_pa[] CC_ALIGN(4) = { // override_ieee_802_15_4.xml MCE_RFE_OVERRIDE(1,0,0,0,1,0), // PHY: Use MCE RAM patch, RFE ROM bank 1 @@ -141,21 +157,20 @@ uint32_t pIeeeHighPaOverrides[] CC_ALIGN(4) = (uint32_t)0xFD6EE02B, // txHighPA=0x3F5BB8 (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_RADIO_SETUP // Radio Setup Command for Pre-Defined Schemes -rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = +rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup = { - .commandNo = 0x0802, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_RADIO_SETUP, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .mode = 0x01, .loDivider = 0x00, @@ -163,26 +178,26 @@ rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, - .txPower = 0x941E, - .pRegOverride = pIeeeDefaultPaOverrides, + .txPower = 0x941E, /* 5 dBm default */ + .pRegOverride = rf_ieee_overrides_default_pa, }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdIeeeFs = +rfc_CMD_FS_t rf_cmd_ieee_fs = { - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_FS, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .frequency = 0x0965, - .fractFreq = 0x0000, + .frequency = 0x0965, /* set by driver */ + .fractFreq = 0x0000, /* set by driver */ .synthConf.bTxMode = 0x1, .synthConf.refFreq = 0x0, .__dummy0 = 0x00, @@ -190,63 +205,63 @@ rfc_CMD_FS_t RF_cmdIeeeFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_TX // IEEE 802.15.4 Transmit Command -rfc_CMD_IEEE_TX_t RF_cmdIeeeTx = +rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx = { - .commandNo = 0x2C01, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_TX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .txOpt.bIncludePhyHdr = 0x0, .txOpt.bIncludeCrc = 0x0, .txOpt.payloadLenMsb = 0x0, - .payloadLen = 0x1E, - .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .payloadLen = 0x0, /* set by driver */ + .pPayload = 0, /* set by driver */ .timeStamp = 0x00000000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_RX // IEEE 802.15.4 Receive Command -rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = +rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx = { - .commandNo = 0x2801, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_RX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .channel = 0x00, - .rxConfig.bAutoFlushCrc = 0x0, + .channel = 0x00, /* set by driver */ + .rxConfig.bAutoFlushCrc = 0x1, .rxConfig.bAutoFlushIgn = 0x0, .rxConfig.bIncludePhyHdr = 0x0, - .rxConfig.bIncludeCrc = 0x0, + .rxConfig.bIncludeCrc = 0x1, .rxConfig.bAppendRssi = 0x1, .rxConfig.bAppendCorrCrc = 0x1, .rxConfig.bAppendSrcInd = 0x0, - .rxConfig.bAppendTimestamp = 0x0, - .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .frameFiltOpt.frameFiltEn = 0x0, - .frameFiltOpt.frameFiltStop = 0x0, - .frameFiltOpt.autoAckEn = 0x0, + .rxConfig.bAppendTimestamp = 0x1, + .pRxQ = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ + .frameFiltOpt.frameFiltEn = 0x0, /* set by driver */ + .frameFiltOpt.frameFiltStop = 0x1, + .frameFiltOpt.autoAckEn = 0x0, /* set by driver */ .frameFiltOpt.slottedAckEn = 0x0, .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0, .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0, - .frameFiltOpt.maxFrameVersion = 0x3, + .frameFiltOpt.maxFrameVersion = 0x2, .frameFiltOpt.fcfReservedMask = 0x0, .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0, @@ -258,25 +273,26 @@ rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = .frameTypes.bAcceptFt5Reserved = 0x1, .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1, - .ccaOpt.ccaEnEnergy = 0x0, - .ccaOpt.ccaEnCorr = 0x0, - .ccaOpt.ccaEnSync = 0x0, + .ccaOpt.ccaEnEnergy = 0x1, + .ccaOpt.ccaEnCorr = 0x1, + .ccaOpt.ccaEnSync = 0x1, .ccaOpt.ccaCorrOp = 0x1, - .ccaOpt.ccaSyncOp = 0x1, - .ccaOpt.ccaCorrThr = 0x0, - .ccaRssiThr = 0x64, + .ccaOpt.ccaSyncOp = 0x0, + .ccaOpt.ccaCorrThr = 0x3, + .ccaRssiThr = 0x0, /* set by driver */ .__dummy0 = 0x00, .numExtEntries = 0x00, .numShortEntries = 0x00, - .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .localExtAddr = 0x0000000012345678, - .localShortAddr = 0xABBA, + .pExtEntryList = 0, + .pShortEntryList = 0, + .localExtAddr = 0x0, /* set by driver */ + .localShortAddr = 0x0, /* set by driver */ .localPanID = 0x0000, .__dummy1 = 0x000000, - .endTrigger.triggerType = 0x1, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.h index 8a37b35fe..fdb722ab8 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-settings.h @@ -1,12 +1,36 @@ -#ifndef _IEEE_SETTINGS_H_ -#define _IEEE_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC13x2 SDK 2.10.xx.xx -// Device: CC1352P Rev. 1.1 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef IEEE_SETTINGS_H_ +#define IEEE_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -14,28 +38,26 @@ #include DeviceFamily_constructPath(driverlib/rf_ieee_mailbox.h) #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_ieeeMode; - - +extern RF_Mode rf_ieee_mode; +/*---------------------------------------------------------------------------*/ // TX Power Table -extern RF_TxPowerTable_Entry ieeeDefaultPaTxPowerTable[16]; -extern RF_TxPowerTable_Entry ieeeHighPaTxPowerTable[16]; - +#define RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE 15 +#define RF_IEEE_TX_POWER_TABLE_HIGH_PA_SIZE 15 +extern RF_TxPowerTable_Entry rf_ieee_tx_power_table_default_pa[RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE+1]; +extern RF_TxPowerTable_Entry rf_ieee_tx_power_table_high_pa[RF_IEEE_TX_POWER_TABLE_HIGH_PA_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup; -extern rfc_CMD_FS_t RF_cmdIeeeFs; -extern rfc_CMD_IEEE_TX_t RF_cmdIeeeTx; -extern rfc_CMD_IEEE_RX_t RF_cmdIeeeRx; - - +extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup; +extern rfc_CMD_FS_t rf_cmd_ieee_fs; +extern rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx; +extern rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pIeeeDefaultPaOverrides[]; -extern uint32_t pIeeeHighPaOverrides[]; - - -#endif // _IEEE_SETTINGS_H_ - +extern uint32_t rf_ieee_overrides_default_pa[]; +extern uint32_t rf_ieee_overrides_high_pa[]; +/*---------------------------------------------------------------------------*/ +#endif /* IEEE_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.c index f6928f04c..c3a286058 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.c @@ -1,4 +1,33 @@ -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // Address: 0 // Address0: 0xAA @@ -23,9 +52,9 @@ // TX Power: 20 dBm (requires define CCFG_FORCE_VDDR_HH = 0 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual) // Enable high output power PA: true // Whitening: Dynamically IEEE 802.15.4g compatible whitener and 16/32-bit CRC - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -35,26 +64,24 @@ #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_genfsk.h) #include - +/*---------------------------------------------------------------------------*/ #include "prop-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_propMode = +RF_Mode rf_prop_mode = { .rfMode = RF_MODE_AUTO, .cpePatchFxn = &rf_patch_cpe_prop, .mcePatchFxn = &rf_patch_mce_genfsk, .rfePatchFxn = &rf_patch_rfe_genfsk, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry propDefaultPaTxPowerTable[19] = +RF_TxPowerTable_Entry rf_prop_tx_power_table_default_pa[RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE+1] = { { -20, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) }, { -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 3) }, @@ -78,14 +105,13 @@ RF_TxPowerTable_Entry propDefaultPaTxPowerTable[19] = { 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry propHighPaTxPowerTable[8] = +RF_TxPowerTable_Entry rf_prop_tx_power_table_high_pa[RF_PROP_TX_POWER_TABLE_HIGH_PA_SIZE+1] = { { 14, RF_TxPowerTable_HIGH_PA_ENTRY( 7, 0, 0, 23, 4) }, { 15, RF_TxPowerTable_HIGH_PA_ENTRY(10, 0, 0, 26, 4) }, @@ -96,10 +122,9 @@ RF_TxPowerTable_Entry propHighPaTxPowerTable[8] = { 20, RF_TxPowerTable_HIGH_PA_ENTRY(27, 0, 0, 85, 32) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_PROP_RADIO_DIV_SETUP -uint32_t pPropDefaultPaOverrides[] CC_ALIGN(4) = +uint32_t rf_prop_overrides_default_pa[] CC_ALIGN(4) = { // override_use_patch_prop_genfsk.xml MCE_RFE_OVERRIDE(1,0,0,1,0,0), // PHY: Use MCE RAM patch, RFE RAM patch @@ -134,10 +159,9 @@ uint32_t pPropDefaultPaOverrides[] CC_ALIGN(4) = ADI_REG_OVERRIDE(0,12,0xF8), // Tx: Set PA trim to max to maximize its output power (in ADI0, set PACTL0=0xF8) (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_PROP_RADIO_DIV_SETUP -uint32_t pPropHighPaOverrides[] CC_ALIGN(4) = +uint32_t rf_prop_overrides_high_pa[] CC_ALIGN(4) = { // override_use_patch_prop_genfsk.xml MCE_RFE_OVERRIDE(1,0,0,1,0,0), // PHY: Use MCE RAM patch, RFE RAM patch @@ -172,21 +196,20 @@ uint32_t pPropHighPaOverrides[] CC_ALIGN(4) = (uint32_t)0x82A86C2B, // txHighPA=0x20AA1B (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_PROP_RADIO_DIV_SETUP // Proprietary Mode Radio Setup Command for All Frequency Bands -rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = +rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup = { - .commandNo = 0x3807, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_PROP_RADIO_DIV_SETUP, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .modulation.modType = 0x1, .modulation.deviation = 0x64, @@ -202,33 +225,33 @@ rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = .formatConf.bMsbFirst = 0x1, .formatConf.fecMode = 0x0, .formatConf.whitenMode = 0x7, - .config.frontEndMode = 0x0, - .config.biasMode = 0x1, + .config.frontEndMode = 0x0, /* set by driver */ + .config.biasMode = 0x0, /* set by driver */ .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, - .txPower = 0x013F, - .pRegOverride = pPropDefaultPaOverrides, - .centerFreq = 0x0393, - .intFreq = 0x8000, - .loDivider = 0x05, + .txPower = 0x013F, /* default 13.5 dBm */ + .pRegOverride = rf_prop_overrides_default_pa, + .centerFreq = 0x0393, /* set by driver */ + .intFreq = 0x8000, /* set by driver */ + .loDivider = 0x05, /* set by driver */ }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdPropFs = +rfc_CMD_FS_t rf_cmd_prop_fs = { - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_FS, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .frequency = 0x0393, - .fractFreq = 0x0000, + .frequency = 0x0393, /* set by driver */ + .fractFreq = 0x0000, /* set by driver */ .synthConf.bTxMode = 0x0, .synthConf.refFreq = 0x0, .__dummy0 = 0x00, @@ -236,85 +259,86 @@ rfc_CMD_FS_t RF_cmdPropFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_PROP_TX_ADV // Proprietary Mode Advanced Transmit Command -rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv = +rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv = { - .commandNo = 0x3803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_PROP_TX_ADV, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x2, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, - .startTrigger.pastTrig = 0x1, - .condition.rule = 0x1, + .startTrigger.pastTrig = 0x0, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .pktConf.bFsOff = 0x0, .pktConf.bUseCrc = 0x1, .pktConf.bCrcIncSw = 0x0, .pktConf.bCrcIncHdr = 0x0, .numHdrBits = 0x10, - .pktLen = 0x0014, + .pktLen = 0x0, /* set by driver */ .startConf.bExtTxTrig = 0x0, .startConf.inputMode = 0x0, .startConf.source = 0x0, - .preTrigger.triggerType = 0x4, + .preTrigger.triggerType = TRIG_REL_START, .preTrigger.bEnaCmd = 0x0, .preTrigger.triggerNo = 0x0, .preTrigger.pastTrig = 0x1, .preTime = 0x00000000, .syncWord = 0x0055904E, - .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pPkt = 0, }; - +/*---------------------------------------------------------------------------*/ // CMD_PROP_RX_ADV // Proprietary Mode Advanced Receive Command -rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv = +rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv = { - .commandNo = 0x3804, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_PROP_RX_ADV, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .pktConf.bFsOff = 0x0, - .pktConf.bRepeatOk = 0x0, - .pktConf.bRepeatNok = 0x0, - .pktConf.bUseCrc = 0x0, + .pktConf.bRepeatOk = 0x1, + .pktConf.bRepeatNok = 0x1, + .pktConf.bUseCrc = 0x1, .pktConf.bCrcIncSw = 0x0, .pktConf.bCrcIncHdr = 0x0, .pktConf.endType = 0x0, - .pktConf.filterOp = 0x0, - .rxConf.bAutoFlushIgnored = 0x0, - .rxConf.bAutoFlushCrcErr = 0x0, + .pktConf.filterOp = 0x1, + .rxConf.bAutoFlushIgnored = 0x1, + .rxConf.bAutoFlushCrcErr = 0x1, .rxConf.bIncludeHdr = 0x0, .rxConf.bIncludeCrc = 0x0, - .rxConf.bAppendRssi = 0x0, + .rxConf.bAppendRssi = 0x1, .rxConf.bAppendTimestamp = 0x0, - .rxConf.bAppendStatus = 0x0, - .syncWord0 = 0x930B51DE, + .rxConf.bAppendStatus = 0x1, + .syncWord0 = 0x0055904E, .syncWord1 = 0x00000000, - .maxPktLen = 0x00FF, - .hdrConf.numHdrBits = 0x0, + .maxPktLen = 0x0, /* set by driver */ + .hdrConf.numHdrBits = 0x10, .hdrConf.lenPos = 0x0, - .hdrConf.numLenBits = 0x0, + .hdrConf.numLenBits = 0x0B, .addrConf.addrType = 0x0, .addrConf.addrSize = 0x0, .addrConf.addrPos = 0x0, .addrConf.numAddr = 0x0, - .lenOffset = 0x00, - .endTrigger.triggerType = 0x0, + .lenOffset = 0xFC, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, - .pAddr = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pAddr = 0, /* set by driver */ + .pQueue = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.h index a3f758abd..d9b6046a1 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-settings.h @@ -1,40 +1,62 @@ -#ifndef _PROP_SETTINGS_H_ -#define _PROP_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC13x2 SDK 2.10.xx.xx -// Device: CC1352P Rev. 1.1 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef PROP_SETTINGS_H_ +#define PROP_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_propMode; - - +extern RF_Mode rf_prop_mode; +/*---------------------------------------------------------------------------*/ // Tx Power Tables -extern RF_TxPowerTable_Entry propDefaultPaTxPowerTable[19]; -extern RF_TxPowerTable_Entry propHighPaTxPowerTable[8]; - +#define RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE 18 +#define RF_PROP_TX_POWER_TABLE_HIGH_PA_SIZE 7 +extern RF_TxPowerTable_Entry rf_prop_tx_power_table_default_pa[RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE+1]; +extern RF_TxPowerTable_Entry rf_prop_tx_power_table_high_pa[RF_PROP_TX_POWER_TABLE_HIGH_PA_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup; -extern rfc_CMD_FS_t RF_cmdPropFs; -extern rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv; -extern rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv; - - +extern rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup; +extern rfc_CMD_FS_t rf_cmd_prop_fs; +extern rfc_CMD_PROP_TX_ADV_t rf_cmd_prop_tx_adv; +extern rfc_CMD_PROP_RX_ADV_t rf_cmd_prop_rx_adv; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pPropDefaultPaOverrides[]; -extern uint32_t pPropHighPaOverrides[]; - - -#endif // _PROP_SETTINGS_H_ - +extern uint32_t rf_prop_overrides_default_pa[]; +extern uint32_t rf_prop_overrides_high_pa[]; +/*---------------------------------------------------------------------------*/ +#endif /* PROP_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c index 15527b039..92720c63b 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.c @@ -1,4 +1,33 @@ -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // IEEE Channel: 11 // Frequency: 2405 MHz @@ -6,9 +35,9 @@ // Packet Data: 255 // Preamble (32 bit): 01010101... // TX Power: 5 dBm - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -16,26 +45,24 @@ #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee.h) #include - +/*---------------------------------------------------------------------------*/ #include "ieee-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_ieeeMode = +RF_Mode rf_ieee_mode = { .rfMode = RF_MODE_IEEE_15_4, .cpePatchFxn = &rf_patch_cpe_ieee, .mcePatchFxn = 0, .rfePatchFxn = 0, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry ieeeTxPowerTable[14] = +RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1] = { { -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) }, { -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) }, @@ -52,10 +79,9 @@ RF_TxPowerTable_Entry ieeeTxPowerTable[14] = { 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_RADIO_SETUP -uint32_t pIeeeOverrides[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides[] CC_ALIGN(4) = { // override_synth_ieee_15_4.xml HW_REG_OVERRIDE(0x4038,0x0035), // Synth: Set recommended RTRIM to 5 @@ -80,48 +106,47 @@ uint32_t pIeeeOverrides[] CC_ALIGN(4) = HW_REG_OVERRIDE(0x50DC,0x002B), // Rx: Adjust AGC DC filter (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_RADIO_SETUP // Radio Setup Command for Pre-Defined Schemes -rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = +rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup = { - .commandNo = 0x0802, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_RADIO_SETUP, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .mode = 0x01, .__dummy0 = 0x00, .config.frontEndMode = 0x0, - .config.biasMode = 0x0, + .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, - .txPower = 0x9330, - .pRegOverride = pIeeeOverrides, + .txPower = 0x9330, /* 5 dBm default */ + .pRegOverride = rf_ieee_overrides, }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdIeeeFs = +rfc_CMD_FS_t rf_cmd_ieee_fs = { - .commandNo = 0x0803, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_FS, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .frequency = 0x0965, - .fractFreq = 0x0000, + .frequency = 0x0965, /* set by driver */ + .fractFreq = 0x0000, /* set by driver */ .synthConf.bTxMode = 0x1, .synthConf.refFreq = 0x0, .__dummy0 = 0x00, @@ -129,63 +154,63 @@ rfc_CMD_FS_t RF_cmdIeeeFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_TX // The command ID number 0x2C01 -rfc_CMD_IEEE_TX_t RF_cmdIeeeTx = +rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx = { - .commandNo = 0x2C01, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_TX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .txOpt.bIncludePhyHdr = 0x0, .txOpt.bIncludeCrc = 0x0, .txOpt.payloadLenMsb = 0x0, - .payloadLen = 0x1E, - .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .payloadLen = 0x0, /* set by driver */ + .pPayload = 0, /* set by driver */ .timeStamp = 0x00000000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_RX // The command ID number 0x2801 -rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = +rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx = { - .commandNo = 0x2801, - .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .commandNo = CMD_IEEE_RX, + .status = IDLE, + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, - .channel = 0x00, - .rxConfig.bAutoFlushCrc = 0x0, + .channel = 0x00, /* set by driver */ + .rxConfig.bAutoFlushCrc = 0x1, .rxConfig.bAutoFlushIgn = 0x0, .rxConfig.bIncludePhyHdr = 0x0, - .rxConfig.bIncludeCrc = 0x0, + .rxConfig.bIncludeCrc = 0x1, .rxConfig.bAppendRssi = 0x1, .rxConfig.bAppendCorrCrc = 0x1, .rxConfig.bAppendSrcInd = 0x0, - .rxConfig.bAppendTimestamp = 0x0, - .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .frameFiltOpt.frameFiltEn = 0x0, - .frameFiltOpt.frameFiltStop = 0x0, - .frameFiltOpt.autoAckEn = 0x0, + .rxConfig.bAppendTimestamp = 0x1, + .pRxQ = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ + .frameFiltOpt.frameFiltEn = 0x0, /* set by driver */ + .frameFiltOpt.frameFiltStop = 0x1, + .frameFiltOpt.autoAckEn = 0x0, /* set by driver */ .frameFiltOpt.slottedAckEn = 0x0, .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0, .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0, - .frameFiltOpt.maxFrameVersion = 0x3, + .frameFiltOpt.maxFrameVersion = 0x2, .frameFiltOpt.fcfReservedMask = 0x0, .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0, @@ -197,25 +222,26 @@ rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = .frameTypes.bAcceptFt5Reserved = 0x1, .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1, - .ccaOpt.ccaEnEnergy = 0x0, - .ccaOpt.ccaEnCorr = 0x0, - .ccaOpt.ccaEnSync = 0x0, + .ccaOpt.ccaEnEnergy = 0x1, + .ccaOpt.ccaEnCorr = 0x1, + .ccaOpt.ccaEnSync = 0x1, .ccaOpt.ccaCorrOp = 0x1, - .ccaOpt.ccaSyncOp = 0x1, - .ccaOpt.ccaCorrThr = 0x0, - .ccaRssiThr = 0x64, + .ccaOpt.ccaSyncOp = 0x0, + .ccaOpt.ccaCorrThr = 0x3, + .ccaRssiThr = 0x0, /* set by driver */ .__dummy0 = 0x00, .numExtEntries = 0x00, .numShortEntries = 0x00, - .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .localExtAddr = 0x0000000012345678, - .localShortAddr = 0xABBA, + .pExtEntryList = 0, + .pShortEntryList = 0, + .localExtAddr = 0x0, /* set by driver */ + .localShortAddr = 0x0, /* set by driver */ .localPanID = 0x0000, .__dummy1 = 0x000000, - .endTrigger.triggerType = 0x1, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.h index 5c6cb3d5a..ff63f2c7e 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-settings.h @@ -1,12 +1,36 @@ -#ifndef _IEEE_SETTINGS_H_ -#define _IEEE_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: No known SDK for this device -// Device: CC2650 Rev. 2.2 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef IEEE_SETTINGS_H_ +#define IEEE_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -14,25 +38,23 @@ #include DeviceFamily_constructPath(driverlib/rf_ieee_mailbox.h) #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_ieeeMode; - - +extern RF_Mode rf_ieee_mode; +/*---------------------------------------------------------------------------*/ // TX Power Table -extern RF_TxPowerTable_Entry ieeeTxPowerTable[14]; +#define RF_IEEE_TX_POWER_TABLE_SIZE 14 +extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup; -extern rfc_CMD_FS_t RF_cmdIeeeFs; -extern rfc_CMD_IEEE_TX_t RF_cmdIeeeTx; -extern rfc_CMD_IEEE_RX_t RF_cmdIeeeRx; - - +extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup; +extern rfc_CMD_FS_t rf_cmd_ieee_fs; +extern rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx; +extern rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pIeeeOverrides[]; - - -#endif // _IEEE_SETTINGS_H_ - +extern uint32_t rf_ieee_overrides[]; +/*---------------------------------------------------------------------------*/ +#endif /* IEEE_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c index 20fbc6627..91db86f41 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.c @@ -1,4 +1,33 @@ -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ // Parameter summary // IEEE Channel: 11 // Frequency: 2405 MHz @@ -6,9 +35,9 @@ // Packet Data: 255 // Preamble (32 bit): 01010101... // TX Power: 5 dBm - +/*---------------------------------------------------------------------------*/ #include "sys/cc.h" - +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -17,26 +46,24 @@ #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_ieee_802_15_4.h) #include - +/*---------------------------------------------------------------------------*/ #include "ieee-settings.h" - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -RF_Mode RF_ieeeMode = +RF_Mode rf_ieee_mode = { .rfMode = RF_MODE_AUTO, .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4, .mcePatchFxn = &rf_patch_mce_ieee_802_15_4, .rfePatchFxn = 0, }; - - +/*---------------------------------------------------------------------------*/ // TX Power table // The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) // See the Technical Reference Manual for further details about the "txPower" Command field. // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. -RF_TxPowerTable_Entry ieeeTxPowerTable[16] = +RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1] = { { -21, RF_TxPowerTable_DEFAULT_PA_ENTRY(7, 3, 0, 3) }, { -18, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 3) }, @@ -55,10 +82,9 @@ RF_TxPowerTable_Entry ieeeTxPowerTable[16] = { 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) }, RF_TxPowerTable_TERMINATION_ENTRY }; - - +/*---------------------------------------------------------------------------*/ // Overrides for CMD_RADIO_SETUP -uint32_t pIeeeOverrides[] CC_ALIGN(4) = +uint32_t rf_ieee_overrides[] CC_ALIGN(4) = { // override_ieee_802_15_4.xml MCE_RFE_OVERRIDE(1,0,0,0,1,0), // PHY: Use MCE RAM patch, RFE ROM bank 1 @@ -77,45 +103,44 @@ uint32_t pIeeeOverrides[] CC_ALIGN(4) = (uint32_t)0x000F8883, // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0) (uint32_t)0xFFFFFFFF, }; - - +/*---------------------------------------------------------------------------*/ // CMD_RADIO_SETUP // Radio Setup Command for Pre-Defined Schemes -rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup = +rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup = { - .commandNo = 0x0802, + .commandNo = CMD_RADIO_SETUP, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .mode = 0x01, .loDivider = 0x00, .config.frontEndMode = 0x0, - .config.biasMode = 0x0, + .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, - .txPower = 0x941E, - .pRegOverride = pIeeeOverrides, + .txPower = 0x941E, /* 5 dBm default */ + .pRegOverride = rf_ieee_overrides, }; - +/*---------------------------------------------------------------------------*/ // CMD_FS // Frequency Synthesizer Programming Command -rfc_CMD_FS_t RF_cmdIeeeFs = +rfc_CMD_FS_t rf_cmd_ieee_fs = { - .commandNo = 0x0803, + .commandNo = CMD_FS, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .frequency = 0x0965, .fractFreq = 0x0000, @@ -126,36 +151,36 @@ rfc_CMD_FS_t RF_cmdIeeeFs = .__dummy2 = 0x00, .__dummy3 = 0x0000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_TX // IEEE 802.15.4 Transmit Command -rfc_CMD_IEEE_TX_t RF_cmdIeeeTx = +rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx = { - .commandNo = 0x2C01, + .commandNo = CMD_IEEE_RX, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, - .startTrigger.triggerType = 0x0, + .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, - .condition.rule = 0x1, + .condition.rule = COND_NEVER, .condition.nSkip = 0x0, .txOpt.bIncludePhyHdr = 0x0, .txOpt.bIncludeCrc = 0x0, .txOpt.payloadLenMsb = 0x0, - .payloadLen = 0x1E, - .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .payloadLen = 0x0, /* set by driver */ + .pPayload = 0, /* set by driver */ .timeStamp = 0x00000000, }; - +/*---------------------------------------------------------------------------*/ // CMD_IEEE_RX // IEEE 802.15.4 Receive Command -rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = +rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx = { .commandNo = 0x2801, .status = 0x0000, - .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx + .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, @@ -172,17 +197,17 @@ rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = .rxConfig.bAppendCorrCrc = 0x1, .rxConfig.bAppendSrcInd = 0x0, .rxConfig.bAppendTimestamp = 0x0, - .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx - .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx - .frameFiltOpt.frameFiltEn = 0x0, - .frameFiltOpt.frameFiltStop = 0x0, - .frameFiltOpt.autoAckEn = 0x0, + .pRxQ = 0, /* set by driver */ + .pOutput = 0, /* set by driver */ + .frameFiltOpt.frameFiltEn = 0x0, /* set by driver */ + .frameFiltOpt.frameFiltStop = 0x1, + .frameFiltOpt.autoAckEn = 0x0, /* set by driver */ .frameFiltOpt.slottedAckEn = 0x0, .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0, .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0, - .frameFiltOpt.maxFrameVersion = 0x3, + .frameFiltOpt.maxFrameVersion = 0x2, .frameFiltOpt.fcfReservedMask = 0x0, .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0, @@ -194,25 +219,26 @@ rfc_CMD_IEEE_RX_t RF_cmdIeeeRx = .frameTypes.bAcceptFt5Reserved = 0x1, .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1, - .ccaOpt.ccaEnEnergy = 0x0, - .ccaOpt.ccaEnCorr = 0x0, - .ccaOpt.ccaEnSync = 0x0, + .ccaOpt.ccaEnEnergy = 0x1, + .ccaOpt.ccaEnCorr = 0x1, + .ccaOpt.ccaEnSync = 0x1, .ccaOpt.ccaCorrOp = 0x1, - .ccaOpt.ccaSyncOp = 0x1, - .ccaOpt.ccaCorrThr = 0x0, - .ccaRssiThr = 0x64, + .ccaOpt.ccaSyncOp = 0x0, + .ccaOpt.ccaCorrThr = 0x3, + .ccaRssiThr = 0x0, /* set by driver */ .__dummy0 = 0x00, .numExtEntries = 0x00, .numShortEntries = 0x00, - .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx - .localExtAddr = 0x0000000012345678, - .localShortAddr = 0xABBA, + .pExtEntryList = 0, + .pShortEntryList = 0, + .localExtAddr = 0x0, /* set by driver */ + .localShortAddr = 0x0, /* set by driver */ .localPanID = 0x0000, .__dummy1 = 0x000000, - .endTrigger.triggerType = 0x1, + .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x0, .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, }; +/*---------------------------------------------------------------------------*/ diff --git a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.h b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.h index 251bcb14c..a97730988 100644 --- a/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.h +++ b/arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-settings.h @@ -1,12 +1,36 @@ -#ifndef _IEEE_SETTINGS_H_ -#define _IEEE_SETTINGS_H_ - -//********************************************************************************* -// Generated by SmartRF Studio version 2.9.0 (build#85) -// Compatible with SimpleLink SDK version: CC26x2 SDK 2.10.xx.xx -// Device: CC2652R Rev. 1.1 -// -//********************************************************************************* +/* + * 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. + */ +/*---------------------------------------------------------------------------*/ +#ifndef IEEE_SETTINGS_H_ +#define IEEE_SETTINGS_H_ +/*---------------------------------------------------------------------------*/ #include #include DeviceFamily_constructPath(driverlib/rf_mailbox.h) #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) @@ -14,26 +38,24 @@ #include DeviceFamily_constructPath(driverlib/rf_ieee_mailbox.h)) #include - - +/*---------------------------------------------------------------------------*/ // TI-RTOS RF Mode Object -extern RF_Mode RF_ieeeMode; - - +extern RF_Mode rf_ieee_mode; +/*---------------------------------------------------------------------------*/ // TX Power Table -extern RF_TxPowerTable_Entry ieeeTxPowerTable[16]; - +#define RF_IEEE_TX_POWER_TABLE_SIZE 15 +extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[RF_IEEE_TX_POWER_TABLE_SIZE+1]; +/*---------------------------------------------------------------------------*/ // RF Core API commands -extern rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup; -extern rfc_CMD_FS_t RF_cmdIeeeFs; -extern rfc_CMD_IEEE_TX_t RF_cmdIeeeTx; -extern rfc_CMD_IEEE_RX_t RF_cmdIeeeRx; - - +extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup; +extern rfc_CMD_FS_t rf_cmd_ieee_fs; +extern rfc_CMD_IEEE_TX_t rf_cmd_ieee_tx; +extern rfc_CMD_IEEE_RX_t rf_cmd_ieee_rx; +/*---------------------------------------------------------------------------*/ // RF Core API Overrides -extern uint32_t pIeeeOverrides[]; - - -#endif // _IEEE_SETTINGS_H_ +extern uint32_t rf_ieee_overrides[]; +/*---------------------------------------------------------------------------*/ +#endif /* IEEE_SETTINGS_H_ */ +/*---------------------------------------------------------------------------*/ diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Makefile.cc1312r1 b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Makefile.cc1312r1 index 495dc498d..e71992113 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Makefile.cc1312r1 +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1312r1/Makefile.cc1312r1 @@ -7,7 +7,8 @@ DEVICE_LINE = CC13XX BOARD_SOURCEFILES += CC1312R1_LAUNCHXL.c CC1312R1_LAUNCHXL_fxns.c -DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=propDefaultPaTxPowerTable +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=rf_prop_tx_power_table_default_pa +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE_SIZE=RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE SUPPORTS_PROP_MODE = 1 SUPPORTS_IEEE_MODE = 0 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Makefile.cc1352p1 b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Makefile.cc1352p1 index accb29899..0dbb6622e 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Makefile.cc1352p1 +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p1/Makefile.cc1352p1 @@ -7,8 +7,11 @@ DEVICE_LINE = CC13XX BOARD_SOURCEFILES += CC1352P1_LAUNCHXL.c CC1312P1_LAUNCHXL_fxns.c -DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=propDefaultPaTxPowerTable -DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=ieeeDefaultPaTxPowerTable +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=rf_prop_tx_power_table_default_pa +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE_SIZE=RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE + +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=rf_ieee_tx_power_table_default_pa +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE_SIZE=RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE SUPPORTS_PROP_MODE = 1 SUPPORTS_IEEE_MODE = 1 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_2/Makefile.cc1352p_2 b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_2/Makefile.cc1352p_2 index 4c9558719..e8608fae7 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_2/Makefile.cc1352p_2 +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_2/Makefile.cc1352p_2 @@ -7,8 +7,11 @@ DEVICE_LINE = CC13XX BOARD_SOURCEFILES += CC1352P_2_LAUNCHXL.c CC1352P_2_LAUNCHXL_fxns.c -DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=propDefaultPaTxPowerTable -DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=ieeeDefaultPaTxPowerTable +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=rf_prop_tx_power_table_default_pa +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE_SIZE=RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE + +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=rf_ieee_tx_power_table_default_pa +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE_SIZE=RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE SUPPORTS_PROP_MODE = 1 SUPPORTS_IEEE_MODE = 1 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_4/Makefile.cc1352p_4 b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_4/Makefile.cc1352p_4 index a9365a51a..8288e292c 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_4/Makefile.cc1352p_4 +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352p_4/Makefile.cc1352p_4 @@ -7,8 +7,11 @@ DEVICE_LINE = CC13XX BOARD_SOURCEFILES += CC1352P_4_LAUNCHXL.c CC1352P_4_LAUNCHXL_fxns.c -DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=propDefaultPaTxPowerTable -DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=ieeeDefaultPaTxPowerTable +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=rf_prop_tx_power_table_default_pa +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE_SIZE=RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE + +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=rf_ieee_tx_power_table_default_pa +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE_SIZE=RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE SUPPORTS_PROP_MODE = 1 SUPPORTS_IEEE_MODE = 1 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Makefile.cc1352r1 b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Makefile.cc1352r1 index 8214b275e..31434afb6 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Makefile.cc1352r1 +++ b/arch/platform/simplelink/cc13xx-cc26xx/launchpad/cc1352r1/Makefile.cc1352r1 @@ -7,8 +7,11 @@ DEVICE_LINE = CC13XX BOARD_SOURCEFILES += CC1352R1_LAUNCHXL.c CC1352R1_LAUNCHXL_fxns.c -DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=propDefaultPaTxPowerTable -DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=ieeeDefaultPaTxPowerTable +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE=rf_prop_tx_power_table_default_pa +DEFINES += PROP_MODE_CONF_TX_POWER_TABLE_SIZE=RF_PROP_TX_POWER_TABLE_DEFAULT_PA_SIZE + +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE=rf_ieee_tx_power_table_default_pa +DEFINES += IEEE_MODE_CONF_TX_POWER_TABLE_SIZE=RF_IEEE_TX_POWER_TABLE_DEFAULT_PA_SIZE SUPPORTS_PROP_MODE = 1 SUPPORTS_IEEE_MODE = 1 diff --git a/arch/platform/simplelink/cc13xx-cc26xx/platform.c b/arch/platform/simplelink/cc13xx-cc26xx/platform.c index e196efc9a..0ced25f26 100644 --- a/arch/platform/simplelink/cc13xx-cc26xx/platform.c +++ b/arch/platform/simplelink/cc13xx-cc26xx/platform.c @@ -169,10 +169,7 @@ platform_init_stage_one(void) void platform_init_stage_two(void) { -#if SIMPLELINK_UART_CONF_ENABLE uart0_init(); -#endif - serial_line_init(); #if BUILD_WITH_SHELL