cc13x2_cc26x2: update to TI SimpleLink SDK 4.10.00.78

Update the HAL to new TI SimpleLink SDK, including driverlib, rf
patches and TI drivers.

Add the temperature driver in order to support new changes in the
Power Manager.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2020-04-30 17:16:32 -07:00 committed by Kumar Gala
parent ebf0a6f11c
commit 73a56862dd
108 changed files with 10948 additions and 8642 deletions

View File

@ -83,7 +83,7 @@ elseif(CONFIG_HAS_CC13X2_CC26X2_SDK)
PROPERTIES COMPILE_DEFINITIONS "DeviceFamily_CC13X2;${COMPILER}" )
set_source_files_properties(source/ti/drivers/rf/RFCC26X2_multiMode.c
PROPERTIES COMPILE_DEFINITIONS "DeviceFamily_CC13X2;${COMPILER}" )
else()
elseif(CONFIG_SOC_CC2652R)
set_source_files_properties(source/ti/drivers/power/PowerCC26X2.c
PROPERTIES COMPILE_DEFINITIONS "DeviceFamily_CC26X2;${COMPILER}" )
set_source_files_properties(source/ti/drivers/power/PowerCC26X2_calibrateRCOSC.c

View File

@ -8,27 +8,32 @@ http://dev.ti.com/tirex/content/simplelink_cc32xx_sdk_2_40_01_01/docs/simplelink
1. CC13x2/26x2 SDK
The current version supported in Zephyr is the SimpleLink CC13x2 and CC26x2 SDK
3.10.00.53, downloaded from:
4.10.00.78, downloaded from:
http://www.ti.com/tool/simplelink-cc13x2-26x2-sdk
The driver library source is copied from the SDK, as follows:
EXT_DIR=$HOME/hal_ti/simplelink/source/ti
pushd simplelink_cc13x2_26x2_sdk_3_10_00_53/source/ti
pushd simplelink_cc13x2_26x2_sdk_4_10_00_78/source/ti
find devices/cc13x2_cc26x2/{driverlib,inc,rf_patches} -depth -name '*.[c|h]' -print0 | cpio --null -pvdm $EXT_DIR
find devices/cc13x2_cc26x2/startup_files -depth -name ccfg.c -print0 | cpio --null -pvd $EXT_DIR
cp -r drivers/power/* $EXT_DIR/drivers/power/.
mkdir $EXT_DIR/drivers/temperature
cp -r drivers/temperature/* $EXT_DIR/drivers/temperature/.
cp drivers/Temperature.* $EXT_DIR/drivers/.
mkdir $EXT_DIR/drivers/rf
cp drivers/rf/RF.h $EXT_DIR/drivers/rf/.
cp drivers/rf/RFCC26X2.h $EXT_DIR/drivers/rf/.
cp drivers/rf/RFCC26X2_multiMode.c $EXT_DIR/drivers/rf/.
find $EXT_DIR/devices/cc13x2_cc26x2 -name '*.[c|h]' -exec dos2unix {} \;
find $EXT_DIR/drivers/power -name '*.[c|h]' -exec dos2unix {} \;
find $EXT_DIR/drivers/rf -name '*.[c|h]' -exec dos2unix {} \;
find $EXT_DIR/drivers/temperature -name '*.[c|h]' -exec dos2unix {} \;
popd
The source file startup_files/ccfg.c has been modified to use the appropriate
sections when linking.
The source file devices/cc13x2_cc26x2/startup_files/ccfg.c has been
modified to use the appropriate sections when linking.
TI provides the driver library functions burned into ROM at the factory,
or updated via a service pack patch, thus saving application code space.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, Texas Instruments Incorporated
* Copyright (c) 2017-2019, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -13,10 +13,18 @@ zephyr_library_sources(
driverlib/aux_sysif.c
# Required for CPUdelay which is not in ROM
driverlib/cpu.c
# Required for RFCDoorbellSendTo which is not in ROM
driverlib/rfc.c
# Required functions to support the TI Power module
driverlib/sys_ctrl.c
driverlib/osc.c
driverlib/driverlib_release.c
)
if(CONFIG_SOC_CC1352R)
# Required for RFCDoorbellSendTo which is not in ROM
set_source_files_properties(driverlib/rfc.c
PROPERTIES COMPILE_DEFINITIONS "DeviceFamily_CC13X2;${COMPILER}" )
elseif(CONFIG_SOC_CC2652R)
# Required for RFCDoorbellSendTo which is not in ROM
set_source_files_properties(driverlib/rfc.c
PROPERTIES COMPILE_DEFINITIONS "DeviceFamily_CC26X2;${COMPILER}" )
endif()

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aes_doc.h
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_event.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the AON Event fabric.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_event.h
* Revised: 2017-08-09 16:56:05 +0200 (Wed, 09 Aug 2017)
* Revision: 49506
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AON Event fabric.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_event_doc.h
* Revised: 2017-08-09 16:56:05 +0200 (Wed, 09 Aug 2017)
* Revision: 49506
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_pmctl.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the AON Power-Management Controller.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_pmctl.h
* Revised: 2017-11-02 14:16:14 +0100 (Thu, 02 Nov 2017)
* Revision: 50156
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AON Power-Management Controller
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_pmctl_doc.h
* Revised: 2017-11-02 15:41:14 +0100 (Thu, 02 Nov 2017)
* Revision: 50165
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_rtc.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the AON RTC.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aon_rtc.h
* Revised: 2017-08-16 15:13:43 +0200 (Wed, 16 Aug 2017)
* Revision: 49593
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AON RTC
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aux_adc.c
* Revised: 2017-11-20 14:31:35 +0100 (Mon, 20 Nov 2017)
* Revision: 50315
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the AUX Time to Digital Converter interface.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aux_adc.h
* Revised: 2018-02-07 09:45:39 +0100 (Wed, 07 Feb 2018)
* Revision: 51437
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AUX Analog-to-Digital
* Converter

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aux_sysif.c
* Revised: 2018-04-17 14:54:06 +0200 (Tue, 17 Apr 2018)
* Revision: 51890
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the AUX System Interface
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aux_sysif.h
* Revised: 2017-06-27 08:41:49 +0200 (Tue, 27 Jun 2017)
* Revision: 49245
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AUX System Interface
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: aux_tdc.h
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the AUX Time-to-Digital Converter
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: ccfgread.h
* Revised: 2016-09-13 14:21:40 +0200 (Tue, 13 Sep 2016)
* Revision: 47152
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: API for reading CCFG.
*
@ -146,6 +146,7 @@ CCFGRead_SCLK_LF_OPTION( void )
#define CCFGREAD_XOSC_FREQ_24M ( CCFG_MODE_CONF_XOSC_FREQ_24M >> CCFG_MODE_CONF_XOSC_FREQ_S )
#define CCFGREAD_XOSC_FREQ_48M ( CCFG_MODE_CONF_XOSC_FREQ_48M >> CCFG_MODE_CONF_XOSC_FREQ_S )
#define CCFGREAD_XOSC_FREQ_HPOSC ( CCFG_MODE_CONF_XOSC_FREQ_HPOSC >> CCFG_MODE_CONF_XOSC_FREQ_S )
#define CCFGREAD_XOSC_FREQ_TCXO ( CCFG_MODE_CONF_XOSC_FREQ_TCXO >> CCFG_MODE_CONF_XOSC_FREQ_S )
//*****************************************************************************
//
@ -156,6 +157,7 @@ CCFGRead_SCLK_LF_OPTION( void )
//! - \ref CCFGREAD_XOSC_FREQ_24M
//! - \ref CCFGREAD_XOSC_FREQ_48M
//! - \ref CCFGREAD_XOSC_FREQ_HPOSC
//! - \ref CCFGREAD_XOSC_FREQ_TCXO
//!
//
//*****************************************************************************
@ -167,6 +169,38 @@ CCFGRead_XOSC_FREQ( void )
CCFG_MODE_CONF_XOSC_FREQ_S ) ;
}
//*****************************************************************************
//
//! \brief Read TCXO_MAX_START setting from CCFG.
//!
//! \return Returns the value of the CCFG_MODE_CONF_1_TCXO_MAX_START field.
//!
//
//*****************************************************************************
__STATIC_INLINE uint32_t
CCFGRead_TCXO_MAX_START( void )
{
return (( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) &
CCFG_MODE_CONF_1_TCXO_MAX_START_M ) >>
CCFG_MODE_CONF_1_TCXO_MAX_START_S ) ;
}
//*****************************************************************************
//
//! \brief Read TCXO_TYPE setting from CCFG.
//!
//! \return Returns the value of the CCFG_MODE_CONF_1_TCXO_TYPE field.
//!
//
//*****************************************************************************
__STATIC_INLINE uint32_t
CCFGRead_TCXO_TYPE( void )
{
return (( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) &
CCFG_MODE_CONF_1_TCXO_TYPE_M ) >>
CCFG_MODE_CONF_1_TCXO_TYPE_S ) ;
}
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: chipinfo.c
* Revised: 2018-08-17 09:28:06 +0200 (Fri, 17 Aug 2018)
* Revision: 52354
* Revised: 2020-02-17 10:51:36 +0100 (Mon, 17 Feb 2020)
* Revision: 56781
*
* Description: Collection of functions returning chip information.
*
@ -142,7 +142,11 @@ ChipInfo_GetChipType( void )
chipType = CHIP_TYPE_CC1352 ;
}
} else {
chipType = CHIP_TYPE_CC2652 ;
if ( fcfg1Pa ) {
chipType = CHIP_TYPE_CC2652P ;
} else {
chipType = CHIP_TYPE_CC2652 ;
}
}
break;
case 0x9 :

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: chipinfo.h
* Revised: 2018-06-18 10:26:12 +0200 (Mon, 18 Jun 2018)
* Revision: 52189
* Revised: 2020-02-17 10:51:36 +0100 (Mon, 17 Feb 2020)
* Revision: 56781
*
* Description: Collection of functions returning chip information.
*
@ -343,7 +343,8 @@ typedef enum {
CHIP_TYPE_CC2652 = 11,//!< 11 means that this is a CC2652 chip.
CHIP_TYPE_CC1312 = 12,//!< 12 means that this is a CC1312 chip.
CHIP_TYPE_CC1352 = 13,//!< 13 means that this is a CC1352 chip.
CHIP_TYPE_CC1352P = 14 //!< 14 means that this is a CC1352P chip.
CHIP_TYPE_CC1352P = 14,//!< 14 means that this is a CC1352P chip.
CHIP_TYPE_CC2652P = 15 //!< 15 means that this is a CC2652P chip.
} ChipType_t;
//*****************************************************************************

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: cpu.c
* Revised: 2018-05-08 10:04:01 +0200 (Tue, 08 May 2018)
* Revision: 51972
* Revised: 2019-05-27 15:23:10 +0200 (Mon, 27 May 2019)
* Revision: 55701
*
* Description: Instruction wrappers for special CPU instructions needed by
* the drivers.
@ -92,7 +92,7 @@ CPUcpsid(void)
cpsid i;
bx lr
}
#elif defined(__TI_COMPILER_VERSION__)
#elif (defined(__TI_COMPILER_VERSION__) || defined(__clang__))
uint32_t
CPUcpsid(void)
{
@ -161,7 +161,7 @@ CPUprimask(void)
mrs r0, PRIMASK;
bx lr
}
#elif defined(__TI_COMPILER_VERSION__)
#elif (defined(__TI_COMPILER_VERSION__) || defined(__clang__))
uint32_t
CPUprimask(void)
{
@ -230,7 +230,7 @@ CPUcpsie(void)
cpsie i;
bx lr
}
#elif defined(__TI_COMPILER_VERSION__)
#elif (defined(__TI_COMPILER_VERSION__) || defined(__clang__))
uint32_t
CPUcpsie(void)
{
@ -299,7 +299,7 @@ CPUbasepriGet(void)
mrs r0, BASEPRI;
bx lr
}
#elif defined(__TI_COMPILER_VERSION__)
#elif (defined(__TI_COMPILER_VERSION__) || defined(__clang__))
uint32_t
CPUbasepriGet(void)
{
@ -380,6 +380,16 @@ __asm(" .sect \".text:NOROM_CPUdelay\"\n"
" subs r0, #1\n"
" bne.n NOROM_CPUdelay\n"
" bx lr\n");
#elif defined(__clang__)
void
CPUdelay(uint32_t ui32Count)
{
// Loop the specified number of times
__asm("CPUdelay:\n"
" subs r0, #1\n"
" bne.n CPUdelay\n"
" bx lr");
}
#else
// GCC
void __attribute__((naked))

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: cpu.h
* Revised: 2018-06-04 16:10:13 +0200 (Mon, 04 Jun 2018)
* Revision: 52111
* Revised: 2019-05-27 15:23:10 +0200 (Mon, 27 May 2019)
* Revision: 55701
*
* Description: Defines and prototypes for the CPU instruction wrapper
* functions.
@ -353,7 +353,7 @@ CPUbasepriSet(uint32_t ui32NewBasepri)
msr BASEPRI, r0;
bx lr
}
#elif defined(__TI_COMPILER_VERSION__)
#elif (defined(__TI_COMPILER_VERSION__) || defined(__clang__))
__STATIC_INLINE void
CPUbasepriSet(uint32_t ui32NewBasepri)
{

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: crypto.c
* Revised: 2017-12-20 16:40:03 +0100 (Wed, 20 Dec 2017)
* Revision: 50869
* Revised: 2020-01-07 14:06:28 +0100 (Tue, 07 Jan 2020)
* Revision: 56632
*
* Description: Driver for the Crypto module
*
@ -853,6 +853,7 @@ CRYPTOCcmInvAuthDecryptResultGet(uint32_t ui32AuthLength,
uint32_t ui32TagIndex;
uint32_t i;
uint32_t ui32Idx;
uint8_t tempResult = 0;
ui32TagIndex = ui32CipherTextLength - ui32AuthLength;
@ -883,17 +884,16 @@ CRYPTOCcmInvAuthDecryptResultGet(uint32_t ui32AuthLength,
HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = (CRYPTO_IRQCLR_DMA_IN_DONE |
CRYPTO_IRQCLR_RESULT_AVAIL);
// Verify the Tag.
for(i = 0; i < ui32AuthLength; i++)
{
if(*((uint8_t *)pui32CcmTag + i) !=
(*((uint8_t *)pui32CipherText + ui32TagIndex + i)))
{
return CCM_AUTHENTICATION_FAILED;
}
/* XOR each byte of the computed tag with the provided tag and OR the results.
* If the OR'd result is non-zero, the tags do not match.
* There is no branch based on the content of the buffers here to avoid
* timing attacks.
*/
for (i = 0; i < ui32AuthLength; i++) {
tempResult |= ((uint8_t *) (pui32CipherText))[ui32TagIndex + i] ^ ((uint8_t *)ui32Tag)[i];
}
return AES_SUCCESS;
return tempResult == 0 ? AES_SUCCESS : CCM_AUTHENTICATION_FAILED;
}
//*****************************************************************************

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: ddi.h
* Revised: 2018-06-04 16:10:13 +0200 (Mon, 04 Jun 2018)
* Revision: 52111
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the DDI master interface.
*

View File

@ -42,4 +42,4 @@
/// Declare the current DriverLib release
DRIVERLIB_DECLARE_RELEASE(0, 54539);
DRIVERLIB_DECLARE_RELEASE(0, 56804);

View File

@ -63,7 +63,7 @@ extern "C"
/// DriverLib release group number
#define DRIVERLIB_RELEASE_GROUP 0
/// DriverLib release build number
#define DRIVERLIB_RELEASE_BUILD 54539
#define DRIVERLIB_RELEASE_BUILD 56804
@ -83,7 +83,7 @@ extern "C"
const volatile uint8_t driverlib_release_##group##_##build
/// External declaration of the DriverLib release locking object
extern DRIVERLIB_DECLARE_RELEASE(0, 54539);
extern DRIVERLIB_DECLARE_RELEASE(0, 56804);
@ -135,7 +135,7 @@ extern DRIVERLIB_DECLARE_RELEASE(0, 54539);
//
//*****************************************************************************
#define DRIVERLIB_ASSERT_CURR_RELEASE() \
DRIVERLIB_ASSERT_RELEASE(0, 54539)
DRIVERLIB_ASSERT_RELEASE(0, 56804)

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: flash.c
* Revised: 2017-10-30 13:37:49 +0100 (Mon, 30 Oct 2017)
* Revision: 50105
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for on chip Flash.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: flash.h
* Revised: 2017-11-02 16:09:32 +0100 (Thu, 02 Nov 2017)
* Revision: 50166
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the Flash driver.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: interrupt.h
* Revised: 2017-11-14 15:26:03 +0100 (Tue, 14 Nov 2017)
* Revision: 50272
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the NVIC Interrupt Controller
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: ioc.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the IOC.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: ioc.h
* Revised: 2017-11-02 14:16:14 +0100 (Thu, 02 Nov 2017)
* Revision: 50156
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the IO Controller.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: osc.c
* Revised: 2019-02-14 09:35:31 +0100 (Thu, 14 Feb 2019)
* Revision: 54539
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for setting up the system Oscillators
*
@ -191,38 +191,49 @@ OSCHF_GetStartupTime( uint32_t timeUntilWakeupInMs )
int32_t deltaTempSinceXoscOn ;
uint32_t newStartupTimeInUs ;
deltaTimeSinceXoscOnInMs = RTC_CV_TO_MS( AONRTCCurrentCompareValueGet() - oscHfGlobals.timeXoscOn_CV );
deltaTempSinceXoscOn = AONBatMonTemperatureGetDegC() - oscHfGlobals.tempXoscOff;
// Check CCFG to determine if device is configured for TCXO.
if( ( HWREG( CCFG_BASE + CCFG_O_MODE_CONF ) & CCFG_MODE_CONF_XOSC_FREQ_M ) == CCFG_MODE_CONF_XOSC_FREQ_TCXO )
{
// Device configured for TCXO. Report fixed startup time located in CCFG with
// coversion from number of 100us to number of us.
newStartupTimeInUs = (( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) & CCFG_MODE_CONF_1_TCXO_MAX_START_M ) >>
CCFG_MODE_CONF_1_TCXO_MAX_START_S ) * 100;
}
else
{
deltaTimeSinceXoscOnInMs = RTC_CV_TO_MS( AONRTCCurrentCompareValueGet() - oscHfGlobals.timeXoscOn_CV );
deltaTempSinceXoscOn = AONBatMonTemperatureGetDegC() - oscHfGlobals.tempXoscOff;
if ( deltaTempSinceXoscOn < 0 ) {
deltaTempSinceXoscOn = -deltaTempSinceXoscOn;
}
if ( deltaTempSinceXoscOn < 0 ) {
deltaTempSinceXoscOn = -deltaTempSinceXoscOn;
}
if ( (( timeUntilWakeupInMs + deltaTimeSinceXoscOnInMs ) > 3000 ) ||
( deltaTempSinceXoscOn > 5 ) ||
( oscHfGlobals.timeXoscStable_CV < oscHfGlobals.timeXoscOn_CV ) ||
( oscHfGlobals.previousStartupTimeInUs == 0 ) )
{
newStartupTimeInUs = 2000;
if (( HWREG( CCFG_BASE + CCFG_O_SIZE_AND_DIS_FLAGS ) & CCFG_SIZE_AND_DIS_FLAGS_DIS_XOSC_OVR_M ) == 0 ) {
newStartupTimeInUs = (( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) &
CCFG_MODE_CONF_1_XOSC_MAX_START_M ) >>
CCFG_MODE_CONF_1_XOSC_MAX_START_S ) * 125;
// Note: CCFG startup time is "in units of 100us" adding 25% margin results in *125
}
} else {
newStartupTimeInUs = RTC_CV_TO_US( oscHfGlobals.timeXoscStable_CV - oscHfGlobals.timeXoscOn_CV );
newStartupTimeInUs += ( newStartupTimeInUs >> 2 ); // Add 25 percent margin
if ( newStartupTimeInUs < oscHfGlobals.previousStartupTimeInUs ) {
newStartupTimeInUs = oscHfGlobals.previousStartupTimeInUs;
}
}
if ( (( timeUntilWakeupInMs + deltaTimeSinceXoscOnInMs ) > 3000 ) ||
( deltaTempSinceXoscOn > 5 ) ||
( oscHfGlobals.timeXoscStable_CV < oscHfGlobals.timeXoscOn_CV ) ||
( oscHfGlobals.previousStartupTimeInUs == 0 ) )
{
newStartupTimeInUs = 2000;
if (( HWREG( CCFG_BASE + CCFG_O_SIZE_AND_DIS_FLAGS ) & CCFG_SIZE_AND_DIS_FLAGS_DIS_XOSC_OVR_M ) == 0 ) {
newStartupTimeInUs = (( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) &
CCFG_MODE_CONF_1_XOSC_MAX_START_M ) >>
CCFG_MODE_CONF_1_XOSC_MAX_START_S ) * 125;
// Note: CCFG startup time is "in units of 100us" adding 25% margin results in *125
}
} else {
newStartupTimeInUs = RTC_CV_TO_US( oscHfGlobals.timeXoscStable_CV - oscHfGlobals.timeXoscOn_CV );
newStartupTimeInUs += ( newStartupTimeInUs >> 2 ); // Add 25 percent margin
if ( newStartupTimeInUs < oscHfGlobals.previousStartupTimeInUs ) {
newStartupTimeInUs = oscHfGlobals.previousStartupTimeInUs;
}
}
if ( newStartupTimeInUs < 200 ) {
newStartupTimeInUs = 200;
}
if ( newStartupTimeInUs > 4000 ) {
newStartupTimeInUs = 4000;
if ( newStartupTimeInUs < 200 ) {
newStartupTimeInUs = 200;
}
if ( newStartupTimeInUs > 4000 ) {
newStartupTimeInUs = 4000;
}
}
return ( newStartupTimeInUs );
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: osc.h
* Revised: 2019-02-14 09:35:31 +0100 (Thu, 14 Feb 2019)
* Revision: 54539
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the system oscillator control.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: pka.c
* Revised: 2018-07-19 15:07:05 +0200 (Thu, 19 Jul 2018)
* Revision: 52294
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the PKA module
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: pka.h
* Revised: 2018-07-19 15:07:05 +0200 (Thu, 19 Jul 2018)
* Revision: 52294
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: PKA header file.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: pka_doc.h
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: prcm.c
* Revised: 2018-10-18 17:33:32 +0200 (Thu, 18 Oct 2018)
* Revision: 52954
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the PRCM.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: prcm.h
* Revised: 2018-10-23 10:19:14 +0200 (Tue, 23 Oct 2018)
* Revision: 52979
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the PRCM
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: pwr_ctrl.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Power Control driver.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: pwr_ctrl.h
* Revised: 2017-11-02 15:41:14 +0100 (Thu, 02 Nov 2017)
* Revision: 50165
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the System Power Control.
*

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_ble_cmd.h
* Revised: 2018-07-31 20:13:42 +0200 (Tue, 31 Jul 2018)
* Revision: 18572
*
* Description: CC13x2/CC26x2 API for Bluetooth Low Energy commands
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -122,7 +120,7 @@ typedef struct __RFC_STRUCT rfc_ble5RxStatus_s rfc_ble5RxStatus_t;
//! \addtogroup bleRadioOp
//! @{
struct __RFC_STRUCT rfc_bleRadioOp_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -161,7 +159,7 @@ struct __RFC_STRUCT rfc_bleRadioOp_s {
//! \addtogroup ble5RadioOp
//! @{
struct __RFC_STRUCT rfc_ble5RadioOp_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -215,7 +213,7 @@ struct __RFC_STRUCT rfc_ble5RadioOp_s {
//! @{
//! Command structure for Bluetooth commands which includes the optional field for 20-dBm PA TX power
struct __RFC_STRUCT rfc_ble5Tx20RadioOp_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -749,6 +747,9 @@ struct __RFC_STRUCT rfc_CMD_BLE5_RADIO_SETUP_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Default transmit power
uint32_t* pRegOverrideCommon; //!< \brief Pointer to a list of hardware and configuration registers to override during common
@ -1511,7 +1512,7 @@ struct __RFC_STRUCT rfc_CMD_BLE5_ADV_SCAN_s {
//! @{
//! Bluetooth 5 Radio Setup Command for all PHYs with PA Switching Fields
struct __RFC_STRUCT rfc_CMD_BLE5_RADIO_SETUP_PA_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -1558,6 +1559,9 @@ struct __RFC_STRUCT rfc_CMD_BLE5_RADIO_SETUP_PA_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Default transmit power
uint32_t* pRegOverrideCommon; //!< \brief Pointer to a list of hardware and configuration registers to override during common

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_ble_mailbox.h
* Revised: 2018-01-15 15:58:36 +0100 (Mon, 15 Jan 2018)
* Revision: 18171
*
* Description: Definitions for BLE interface
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -0,0 +1,167 @@
/******************************************************************************
* Filename: rf_bt5_coex.h
*
* Description: CC13x2/CC26x2 structures for bt5 coexistence support
*
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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 __BT5_COEX_H
#define __BT5_COEX_H
//! \addtogroup rfCoreHal
//! @{
//! \addtogroup bt5_coex
//! @{
#include <stdint.h>
#include "rf_mailbox.h"
// Error code for GRANT signal not given
#define BLE_ERROR_NO_GRANT 0x1808
typedef struct rfCoreHal_bleCoExConfig_s rfCoreHal_bleCoExConfig_t;
//! \addtogroup bleCoExConfig
//! @{
struct rfCoreHal_bleCoExConfig_s {
struct {
uint8_t bCoExEnable:1; //!< \brief 0: CoEx disabled
//!< 1: CoEx enabled
uint8_t bUseREQUEST:1; //!< \brief 0: REQUEST signal inactive
//!< 1: REQUEST signal active
uint8_t bUseGRANT:1; //!< \brief 0: GRANT signal inactive
//!< 1: GRANT signal active
uint8_t bUsePRIORITY:1; //!< \brief 0: PRIORITY signal inactive
//!< 1: PRIORITY signal active
uint8_t bRequestForChain:1; //!< \brief 0: Deassert REQUEST after each RF command
//!< 1: Keep REQUEST asserted for entire command chain
} coExEnable;
uint8_t coExTxRxIndication; //!< \brief 0 = RX indication is 0, TX indication is 0
//!< 1 = RX indication is 0, TX indication is 1
//!< 2 = RX indication is 1, TX indication is 0
//!< 3 = RX indication is 1, RX indication is 1
uint16_t priorityIndicationTime; //!< Time (in us) that the PRIORITY signal will indicate the priority.
struct {
uint8_t bRequestAsserted:1; //!< \brief READ ONLY. 0 = REQUEST not asserted, 1 = REQUEST is asserted.
//!< Will indicate if REQUEST would have been asserted, except if signal is not used.
uint8_t bIgnoreGrantInRxAsserted:1;//!< \brief READ ONLY. 0 = GRANT is checked in RX, 1 = GRANT is not checked in RX
//!< Will indicate if the current running command is ignoring GRANT in RX
} rfCoreCoExStatus;
struct {
uint8_t bUseOverridePriority:1; //!< \brief Bit to override default priority
//!< 0: Use default priority
//!< 1: use overridePriority priority for entire chain
uint8_t overridePriority:1; //!< \brief Priority to use if priority is overridden
//!< 0: Low priority if bUseOverridePriority = 1
//!< 1: High priority if bUseOverridePriority = 1
uint8_t bUseOverrideRequestForRx:1;//!< \brief Bit to override default request for RX
//!< 0: Use default request for RX
//!< 1: use overrideRequestForRx for entire chain
uint8_t overrideRequestForRx:1; //!< \brief REQUEST signal override if bUseOverrideRequestForRx = 1, used for entire chain
//!< 0: Don't request for RX if bUseOverrideRequestForRx = 1
//!< 1: Request for RX if bUseOverrideRequestForRx = 1
} overrideConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleMasterSlaveConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleAdvConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleScanConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleInitConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleGenericRxConfig;
struct {
uint8_t defaultPriority:1; //!< \brief 0: Default low priority
//!< 1: Default high priority
uint8_t bAssertRequestForRx:1; //!< \brief Default "request for RX" behaviour
//!< 0: Assert REQUEST for TX operations only
//!< 1: Assert REQUEST for both RX and TX operations
uint8_t bIgnoreGrantInRx:1; //!< \brief 0: Check GRANT in RX and TX
//!< 1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
uint8_t bKeepRequestIfNoGrant:1; //!< \brief 0: Deassert REQUEST if GRANT was not given
//!< 1: Keep REQUEST asserted if no GRANT was given
} cmdBleTxTestConfig;
} ;
//! @}
//! @}
//! @}
#endif

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_common_cmd.h
* Revised: 2018-11-02 11:52:02 +0100 (Fri, 02 Nov 2018)
* Revision: 18756
*
* Description: CC13x2/CC26x2 API for common/generic commands
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -112,7 +110,7 @@ typedef struct __RFC_STRUCT rfc_CMD_SET_CMD_START_IRQ_s rfc_CMD_SET_CMD_START_IR
//! \addtogroup command
//! @{
struct __RFC_STRUCT rfc_command_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
} __RFC_STRUCT_ATTR;
//! @}
@ -122,7 +120,7 @@ struct __RFC_STRUCT rfc_command_s {
//! Common definition for radio operation commands
struct __RFC_STRUCT rfc_radioOp_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -221,6 +219,9 @@ struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no
@ -676,7 +677,7 @@ struct __RFC_STRUCT rfc_CMD_PATTERN_CHECK_s {
//! @{
//! Radio Setup Command for Pre-Defined Schemes with PA Switching Fields
struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_PA_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -721,6 +722,9 @@ struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_PA_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_data_entry.h
* Revised: 2018-01-15 06:15:14 +0100 (Mon, 15 Jan 2018)
* Revision: 18170
*
* Description: Definition of API for data exchange
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_hs_cmd.h
* Revised: 2018-01-15 06:15:14 +0100 (Mon, 15 Jan 2018)
* Revision: 18170
*
* Description: CC13x2/CC26x2 API for high-speed mode commands
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_hs_mailbox.h
* Revised: 2018-01-15 15:58:36 +0100 (Mon, 15 Jan 2018)
* Revision: 18171
*
* Description: Definitions for high-speed mode radio interface
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_ieee_cmd.h
* Revised: 2018-01-15 06:15:14 +0100 (Mon, 15 Jan 2018)
* Revision: 18170
*
* Description: CC13x2/CC26x2 API for IEEE 802.15.4 commands
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_ieee_mailbox.h
* Revised: 2018-01-23 19:51:42 +0100 (Tue, 23 Jan 2018)
* Revision: 18189
*
* Description: Definitions for IEEE 802.15.4 interface
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -56,7 +54,7 @@
#define IEEE_DONE_ACKPEND 0x2404 ///< ACK packet received with pending data bit set
#define IEEE_DONE_TIMEOUT 0x2405 ///< Operation ended due to timeout
#define IEEE_DONE_BGEND 0x2406 ///< FG operation ended because necessary background level
///< operation ended
///< operation ended
#define IEEE_DONE_ABORT 0x2407 ///< Operation aborted by command
///@}
/// \name Operation finished with error

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_mailbox.h
* Revised: 2018-11-02 11:52:02 +0100 (Fri, 02 Nov 2018)
* Revision: 18756
*
* Description: Definitions for interface between system and radio CPU
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_prop_cmd.h
* Revised: 2018-07-31 20:13:42 +0200 (Tue, 31 Jul 2018)
* Revision: 18572
*
* Description: CC13x2/CC26x2 API for Proprietary mode commands
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -545,6 +543,9 @@ struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no
@ -648,6 +649,9 @@ struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no
@ -894,7 +898,7 @@ struct __RFC_STRUCT rfc_CMD_PROP_RX_ADV_SNIFF_s {
//! @{
//! Proprietary Mode Radio Setup Command for 2.4 GHz with PA Switching Fields
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_PA_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -984,6 +988,9 @@ struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_PA_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no
@ -1000,7 +1007,7 @@ struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_PA_s {
//! @{
//! Proprietary Mode Radio Setup Command for All Frequency Bands with PA Switching Fields
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_PA_s {
uint16_t commandNo; //!< The command ID number
uint16_t commandNo; //!< The command ID number
uint16_t status; //!< \brief An integer telling the status of the command. This value is
//!< updated by the radio CPU during operation and may be read by the
//!< system CPU at any time.
@ -1090,6 +1097,9 @@ struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_PA_s {
//!< Others: <i>Reserved</i>
uint16_t bNoFsPowerUp:1; //!< \brief 0: Power up frequency synth<br>
//!< 1: Do not power up frequency synth
uint16_t :1;
uint16_t bSynthNarrowBand:1; //!< \brief 0: Normal synth mode<br>
//!< 1: Narrow-band synth mode
} config; //!< Configuration options
uint16_t txPower; //!< Transmit power
uint32_t* pRegOverride; //!< \brief Pointer to a list of hardware and configuration registers to override. If NULL, no

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_prop_mailbox.h
* Revised: 2018-01-15 15:58:36 +0100 (Mon, 15 Jan 2018)
* Revision: 18171
*
* Description: Definitions for proprietary mode radio interface
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -59,13 +59,14 @@ extern "C"
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_rfc_pwr.h"
#include "../inc/hw_rfc_dbell.h"
#include "../inc/hw_fcfg1.h"
#include "../inc/hw_adi_3_refsys.h"
#include "../inc/hw_adi.h"
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
#include DeviceFamily_constructPath(inc/hw_memmap.h)
#include DeviceFamily_constructPath(inc/hw_rfc_pwr.h)
#include DeviceFamily_constructPath(inc/hw_rfc_dbell.h)
#include DeviceFamily_constructPath(inc/hw_fcfg1.h)
#include DeviceFamily_constructPath(inc/hw_adi_3_refsys.h)
#include DeviceFamily_constructPath(inc/hw_adi.h)
#include "rf_common_cmd.h"
#include "rf_prop_cmd.h"
#include "rf_ble_cmd.h"
@ -80,9 +81,9 @@ typedef struct {
// Definition of maximum search depth used by the RFCOverrideUpdate function
#define RFC_MAX_SEARCH_DEPTH 5
#define RFC_PA_TYPE_ADDRESS 0x21000345
#define RFC_PA_TYPE_ADDRESS 0x21000385
#define RFC_PA_TYPE_MASK 0x04
#define RFC_PA_GAIN_ADDRESS 0x2100034C
#define RFC_PA_GAIN_ADDRESS 0x21000398
#define RFC_PA_GAIN_MASK 0x003FFFFF
#define RFC_FE_MODE_ESCAPE_VALUE 0xFF
#define RFC_FE_OVERRIDE_ADDRESS 0x0703
@ -411,7 +412,7 @@ extern uint32_t RFCAnaDivTxOverride(uint8_t loDivider, uint8_t frontEndMode);
//
//*****************************************************************************
#if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
#include "../driverlib/rom.h"
#include DeviceFamily_constructPath(driverlib/rom.h)
#ifdef ROM_RFCCpeIntGetAndClear
#undef RFCCpeIntGetAndClear
#define RFCCpeIntGetAndClear ROM_RFCCpeIntGetAndClear

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: rom.h
* Revised: 2018-11-02 13:54:49 +0100 (Fri, 02 Nov 2018)
* Revision: 53196
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Prototypes for the ROM utility functions.
*

View File

@ -1,7 +1,7 @@
/*******************************************************************************
* Filename: rom_crypto.c
* Revised: 2018-09-17 08:57:21 +0200 (Mon, 17 Sep 2018)
* Revision: 52619
* Revised: 2020-02-14 14:37:11 +0100 (Fri, 14 Feb 2020)
* Revision: 56770
*
* Description: This is the implementation for the API to the ECC functions
* built into ROM on the CC13x2/CC26x2.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: rom_crypto.h
* Revised: 2018-09-17 09:24:56 +0200 (Mon, 17 Sep 2018)
* Revision: 52624
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: This header file is the API to the crypto functions
* built into ROM on the CC13xx/CC26xx.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: setup.c
* Revised: 2018-11-06 15:08:57 +0100 (Tue, 06 Nov 2018)
* Revision: 53239
* Revised: 2020-02-14 13:45:15 +0100 (Fri, 14 Feb 2020)
* Revision: 56765
*
* Description: Setup file for CC13xx/CC26xx devices.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: setup_rom.c
* Revised: 2017-11-02 11:31:15 +0100 (Thu, 02 Nov 2017)
* Revision: 50143
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Setup file for CC13xx/CC26xx devices.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: setup_rom.h
* Revised: 2018-10-24 11:23:04 +0200 (Wed, 24 Oct 2018)
* Revision: 52993
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Prototypes and defines for the setup API.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: sha2.c
* Revised: 2018-04-17 15:57:27 +0200 (Tue, 17 Apr 2018)
* Revision: 51892
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the SHA-2 functions of the crypto module
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: sha2.h
* Revised: 2018-04-17 16:04:03 +0200 (Tue, 17 Apr 2018)
* Revision: 51893
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: SHA-2 header file.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: sha2_doc.h
* Revised: 2017-11-01 10:33:37 +0100 (Wed, 01 Nov 2017)
* Revision: 50125
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: sys_ctrl.c
* Revised: 2018-06-26 15:19:11 +0200 (Tue, 26 Jun 2018)
* Revision: 52220
* Revised: 2020-02-18 14:05:12 +0100 (Tue, 18 Feb 2020)
* Revision: 56796
*
* Description: Driver for the System Control.
*
@ -160,6 +160,10 @@ void SysCtrlStandby(bool retainCache, uint32_t vimsPdMode, uint32_t rechargeMode
{
uint32_t modeVIMS;
// Handle compensation for improving RCOSC_LF stability at low temperatures
// as configured in CCFG
SysCtrlSetRechargeBeforePowerDown(XOSC_IN_HIGH_POWER_MODE);
// Freeze the IOs on the boundary between MCU and AON
AONIOCFreezeEnable();

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: sys_ctrl.h
* Revised: 2018-09-17 14:58:51 +0200 (Mon, 17 Sep 2018)
* Revision: 52634
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the System Controller.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: uart.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the UART.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: uart.h
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the UART.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: udma.h
* Revised: 2017-05-23 12:08:52 +0200 (Tue, 23 May 2017)
* Revision: 49048
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines and prototypes for the uDMA controller.
*
@ -294,6 +294,8 @@ tDMAControlTable;
#define UDMA_CHAN_UART0_TX 2 // UART0 RX Data
#define UDMA_CHAN_SSI0_RX 3 // SSI0 RX Data
#define UDMA_CHAN_SSI0_TX 4 // SSI0 RX Data
#define UDMA_CHAN_UART1_RX 5 // UART1 RX Data
#define UDMA_CHAN_UART1_TX 6 // UART1 Tx Data
#define UDMA_CHAN_AUX_ADC 7 // AUX ADC event
#define UDMA_CHAN_AUX_SW 8 // AUX Software event
#define UDMA_CHAN_TIMER0_A 9 // Timer0 A event

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: vims.c
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Driver for the VIMS.
*

View File

@ -36,6 +36,6 @@
*
******************************************************************************/
#include <drivers/watchdog.h>
#include "watchdog.h"
// See watchdog.h for implementation

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: hw_ccfg_h
* Revised: 2018-10-19 08:48:09 +0200 (Fri, 19 Oct 2018)
* Revision: 52957
* Revised: 2019-04-01 09:23:38 +0200 (Mon, 01 Apr 2019)
* Revision: 55513
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.
@ -139,6 +139,28 @@
// Register: CCFG_O_MODE_CONF_1
//
//*****************************************************************************
// Field: [31] TCXO_TYPE
//
// Selects the TCXO type.
//
// 0: CMOS type. Internal common-mode bias will not be enabled.
// 1: Clipped-sine type. Internal common-mode bias will be enabled when TCXO is
// used.
//
// Bit field value is only valid if MODE_CONF.XOSC_FREQ=0.
#define CCFG_MODE_CONF_1_TCXO_TYPE 0x80000000
#define CCFG_MODE_CONF_1_TCXO_TYPE_BITN 31
#define CCFG_MODE_CONF_1_TCXO_TYPE_M 0x80000000
#define CCFG_MODE_CONF_1_TCXO_TYPE_S 31
// Field: [30:24] TCXO_MAX_START
//
// Maximum TCXO startup time in units of 100us.
// Bit field value is only valid if MODE_CONF.XOSC_FREQ=0.
#define CCFG_MODE_CONF_1_TCXO_MAX_START_W 7
#define CCFG_MODE_CONF_1_TCXO_MAX_START_M 0x7F000000
#define CCFG_MODE_CONF_1_TCXO_MAX_START_S 24
// Field: [23:20] ALT_DCDC_VMIN
//
// Minimum voltage for when DC/DC should be used if alternate DC/DC setting is
@ -173,12 +195,12 @@
// Inductor peak current if alternate DC/DC setting is enabled
// (SIZE_AND_DIS_FLAGS.DIS_ALT_DCDC_SETTING=0). Assuming 10uH external
// inductor!
// Peak current = 31 + ( 4 * ALT_DCDC_IPEAK ) :
// 0: 31mA (min)
//
// 0: 46mA (min)
// ...
// 4: 47mA
// 4: 70mA
// ...
// 7: 59mA (max)
// 7: 87mA (max)
#define CCFG_MODE_CONF_1_ALT_DCDC_IPEAK_W 3
#define CCFG_MODE_CONF_1_ALT_DCDC_IPEAK_M 0x00070000
#define CCFG_MODE_CONF_1_ALT_DCDC_IPEAK_S 16
@ -232,11 +254,7 @@
// Field: [3] DIS_TCXO
//
// Disable TCXO.
// 0: TCXO functionality enabled.
// 1: TCXO functionality disabled.
// Note:
// An external TCXO is required if DIS_TCXO = 0.
// Deprecated. Must be set to 1.
#define CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO 0x00000008
#define CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO_BITN 3
#define CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO_M 0x00000008
@ -368,16 +386,16 @@
// EXT_LF_CLK.DIO. The RTC tick speed
// AON_RTC:SUBSECINC is updated to
// EXT_LF_CLK.RTC_INCREMENT (done in the
// trimDevice() xxWare boot function). External
// clock must always be running when the chip is
// in standby for VDDR recharge timing.
// XOSC_HF_DLF 31.25kHz clock derived from 24MHz XOSC (dividing
// by 768 in HW). The RTC tick speed
// [AON_RTC.SUBSECINC.*] is updated to 0x8637BD,
// corresponding to a 31.25kHz clock (done in the
// trimDevice() xxWare boot function). Standby
// power mode is not supported when using this
// clock source.
// SetupTrimDevice() driverlib boot function).
// External clock must always be running when the
// chip is in standby for VDDR recharge timing.
// XOSC_HF_DLF 31.25kHz clock derived from 48MHz XOSC or HPOSC.
// The RTC tick speed AON_RTC:SUBSECINC is updated
// to 0x8637BD, corresponding to a 31.25kHz clock
// (done in the SetupTrimDevice() driverlib boot
// function). The device must be blocked from
// entering Standby mode when using this clock
// source.
#define CCFG_MODE_CONF_SCLK_LF_OPTION_W 2
#define CCFG_MODE_CONF_SCLK_LF_OPTION_M 0x00C00000
#define CCFG_MODE_CONF_SCLK_LF_OPTION_S 22
@ -415,17 +433,23 @@
// Field: [19:18] XOSC_FREQ
//
// Selects high precision HF oscillator (activated when using the radio).
// Selects which high frequency oscillator is used (required for radio usage).
// ENUMs:
// 24M 24 MHz XOSC_HF
// 24M 24 MHz XOSC_HF. Not supported.
// 48M 48 MHz XOSC_HF
// HPOSC HPOSC
// HPOSC Internal high precision oscillator.
// TCXO External 48Mhz TCXO.
// Refer to
// MODE_CONF_1.TCXO_MAX_START and
// MODE_CONF_1.TCXO_TYPE bit fields for additional
// configuration of TCXO.
#define CCFG_MODE_CONF_XOSC_FREQ_W 2
#define CCFG_MODE_CONF_XOSC_FREQ_M 0x000C0000
#define CCFG_MODE_CONF_XOSC_FREQ_S 18
#define CCFG_MODE_CONF_XOSC_FREQ_24M 0x000C0000
#define CCFG_MODE_CONF_XOSC_FREQ_48M 0x00080000
#define CCFG_MODE_CONF_XOSC_FREQ_HPOSC 0x00040000
#define CCFG_MODE_CONF_XOSC_FREQ_TCXO 0x00000000
// Field: [17] XOSC_CAP_MOD
//

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: hw_chip_def.h
* Revised: 2017-06-26 09:33:33 +0200 (Mon, 26 Jun 2017)
* Revision: 49227
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Description: Defines for device properties.
*

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: hw_ddi.h
* Revised: 2017-06-05 12:13:49 +0200 (Mon, 05 Jun 2017)
* Revision: 49096
* Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
* Revision: 56760
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.

View File

@ -1,7 +1,7 @@
/******************************************************************************
* Filename: hw_ddi_0_osc_h
* Revised: 2018-05-14 12:24:52 +0200 (Mon, 14 May 2018)
* Revision: 51990
* Revised: 2019-03-08 14:23:17 +0100 (Fri, 08 Mar 2019)
* Revision: 55206
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.
@ -151,7 +151,10 @@
// Field: [14] HPOSC_MODE_EN
//
// Internal. Only to be used through TI provided API.
// 0: HPOSC mode is not enabled. The 48 MHz crystal is required for radio
// operation.
// 1: Enables HPOSC mode. The internal HPOSC can be used as HF system clock and
// for radio operation.
#define DDI_0_OSC_CTL0_HPOSC_MODE_EN 0x00004000
#define DDI_0_OSC_CTL0_HPOSC_MODE_EN_M 0x00004000
#define DDI_0_OSC_CTL0_HPOSC_MODE_EN_S 14
@ -243,7 +246,8 @@
// XOSCLF Low frequency XOSC
// RCOSCLF Low frequency RCOSC
// XOSCHFDLF Low frequency clock derived from High Frequency
// XOSC
// XOSC or HPOSC clk (use HPOSC when HPOSC_MODE_EN
// = 1)
// RCOSCHFDLF Low frequency clock derived from High Frequency
// RCOSC
#define DDI_0_OSC_CTL0_SCLK_LF_SRC_SEL_W 2
@ -258,7 +262,8 @@
//
// Source select for sclk_hf.
// ENUMs:
// XOSC High frequency XOSC clock
// XOSC High frequency XOSC or HPOSC clk (use HPOSC when
// HPOSC_MODE_EN = 1
// RCOSC High frequency RCOSC clock
#define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL 0x00000001
#define DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_M 0x00000001

View File

@ -0,0 +1,457 @@
/******************************************************************************
* Filename: rf_patch_cpe_bt5.c
*
* Description: RF core patch for Bluetooth 5 support ("BLE" and "BLE5" API command sets) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <string.h>
#include "rf_patch_cpe_bt5.h"
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageBt5[] = {
0x21004325,
0x21004075,
0x21004091,
0x21004399,
0x210043d5,
0x210040c1,
0x210040cd,
0x210040d9,
0x21004461,
0x2100410d,
0xd00507db,
0xf803f000,
0x70084902,
0xb570bd70,
0x47284d01,
0x210004e0,
0x0002241d,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0x4700b570,
0xf9b0f000,
0x47004800,
0x00007f57,
0xf9b0f000,
0x47004800,
0x0000881b,
0x0a9b9b03,
0x2b834d08,
0x4c08d10a,
0x069b8923,
0xb407d506,
0xf805f000,
0xd0002800,
0xbc073542,
0xb5704728,
0x47004802,
0x00020b1f,
0x21000160,
0x000209eb,
0x4a094808,
0x429a6803,
0x4808d10a,
0x4b088902,
0xd0011ad2,
0xd1032a01,
0x49066e40,
0x99034788,
0x47184b05,
0x210002a8,
0x000203bd,
0x21000160,
0x00001821,
0x000035f1,
0x000006bd,
0x4c86b510,
0x31404621,
0x28017d08,
0x4884d134,
0x08407dc0,
0xd02f07c0,
0x30604620,
0x08527942,
0xd02907d2,
0x0b808940,
0xd1252801,
0x09417e08,
0xd00c07c9,
0x07006fa1,
0x0fc08809,
0x04090240,
0x66604308,
0x1c806fa0,
0xf968f000,
0x4874e013,
0x69803020,
0x28006840,
0x4a72d00e,
0x78012300,
0x1a5956d3,
0x00c9d408,
0x78411808,
0xd00307c9,
0x66616801,
0x66a06840,
0x4780486b,
0xb5f8bd10,
0x496a4c66,
0x36204626,
0x46257b70,
0x90003540,
0x00b8792f,
0x68801840,
0x28004780,
0x4960d128,
0x09097dc9,
0xd02307c9,
0x32644622,
0xd0202f15,
0x23007e29,
0x07ff094f,
0x7d6dd003,
0xd0002d00,
0x9f002301,
0x43bb6fa5,
0x7b73d012,
0xd00f2b00,
0x065b7d23,
0x88d2d50c,
0x2a010b92,
0x08c9d108,
0xd00507c9,
0x0b8988a9,
0xd1012901,
0x73712100,
0x7eabbdf8,
0x2b017de9,
0x2300d0e3,
0xb570e7e1,
0x46254c46,
0x35806a60,
0xd11d2800,
0x5d002054,
0x28002200,
0x2064d017,
0x08805d00,
0xd01207c0,
0x888868a9,
0x28010b80,
0x483dd10d,
0x08407dc0,
0xd00807c0,
0x3020483a,
0x68006980,
0xd0022800,
0x60a86229,
0x622ae000,
0x47804839,
0x29006a61,
0x6a29d103,
0xd0002900,
0xbd7060a9,
0x4c2fb5f8,
0x46204934,
0x7d023040,
0xd02f2a00,
0x46257e80,
0x28033580,
0x2804d002,
0xe027d003,
0x75e82001,
0x2064e024,
0x08805d00,
0xd01f07c0,
0x888068a8,
0x28010b80,
0x4822d11a,
0x7dc07dea,
0xd0132a00,
0x07c008c0,
0x4626d012,
0x7b773620,
0x46014788,
0xd1084339,
0x06097d21,
0x8869d505,
0x29010b89,
0x2100d101,
0xbdf87371,
0xe7ea0880,
0xbdf84788,
0x30804812,
0x75c12100,
0x47004817,
0x3140490f,
0x28267108,
0xdc06d014,
0xd0132815,
0xd00b281b,
0xd104281f,
0x283de00a,
0x2847d00e,
0x490bd00a,
0x18400080,
0x47706880,
0x4770480c,
0x4770480c,
0x4770480c,
0x4770480c,
0x4770480c,
0x21000160,
0x210000c8,
0x210004e0,
0x00024959,
0x00025500,
0x00023d8f,
0x00023075,
0x00022a15,
0x21004319,
0x210042a5,
0x21004247,
0x210041c7,
0x21004149,
0x490cb510,
0x4a0c4788,
0x5e512106,
0xd0072900,
0xd0052902,
0xd0032909,
0xd0012910,
0xd1072911,
0x43c92177,
0xdd014288,
0xdd012800,
0x43c0207f,
0x0000bd10,
0x000065a9,
0x21000380,
0x4810b510,
0x481088c1,
0xd0182905,
0x68214c0f,
0x0052084a,
0x6ba26022,
0x00520852,
0x602163a2,
0xfe62f7ff,
0x07006ba0,
0x2001d408,
0x60606020,
0x1c402000,
0xdbfc280c,
0x62202014,
0xf7ffbd10,
0xbd10fe53,
0x21000380,
0x00005b3f,
0x40046000,
0x490c6b80,
0x0f000700,
0x47707148,
0x490a4a09,
0x79502318,
0x7e4956cb,
0x428118c0,
0x4608dd01,
0x280fe002,
0x200fdd00,
0x090989d1,
0x43010109,
0x477081d1,
0x210002e0,
0x21000088,
0x47702000,
0x07810882,
0x0ec90092,
0x78c0ca0c,
0x424940ca,
0x408b3120,
0x0211431a,
0x06000a09,
0x47704308,
};
#define _NWORD_PATCHIMAGE_BT5 270
CPE_PATCH_TYPE patchCpeHd[] = {
0x00000000,
};
#define _NWORD_PATCHCPEHD_BT5 1
#define _NWORD_PATCHSYS_BT5 0
#ifndef _BT5_SYSRAM_START
#define _BT5_SYSRAM_START 0x20000000
#endif
#ifndef _BT5_CPERAM_START
#define _BT5_CPERAM_START 0x21000000
#endif
#define _BT5_SYS_PATCH_FIXED_ADDR 0x20000000
#define _BT5_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _BT5_PATCH_TAB_OFFSET 0x03D4
#define _BT5_IRQPATCH_OFFSET 0x0480
#define _BT5_PATCH_VEC_OFFSET 0x404C
#define _BT5_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _BT5_NO_PROG_STATE_VAR
static uint8_t bBt5PatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterBt5CpePatch(void)
{
#if (_NWORD_PATCHIMAGE_BT5 > 0)
uint32_t *pPatchVec = (uint32_t *) (_BT5_CPERAM_START + _BT5_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageBt5, sizeof(patchImageBt5));
#endif
}
PATCH_FUN_SPEC void enterBt5CpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_BT5 > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_BT5_CPERAM_START + _BT5_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterBt5SysPatch(void)
{
}
PATCH_FUN_SPEC void configureBt5Patch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_BT5_CPERAM_START + _BT5_PATCH_TAB_OFFSET);
pPatchTab[1] = 0;
pPatchTab[21] = 1;
pPatchTab[76] = 2;
pPatchTab[91] = 3;
pPatchTab[79] = 4;
pPatchTab[140] = 5;
pPatchTab[150] = 6;
pPatchTab[13] = 7;
pPatchTab[31] = 8;
pPatchTab[40] = 9;
}
PATCH_FUN_SPEC void applyBt5Patch(void)
{
#ifdef _BT5_NO_PROG_STATE_VAR
enterBt5SysPatch();
enterBt5CpePatch();
#else
if (!bBt5PatchEntered)
{
enterBt5SysPatch();
enterBt5CpePatch();
bBt5PatchEntered = 1;
}
#endif
enterBt5CpeHdPatch();
configureBt5Patch();
}
void refreshBt5Patch(void)
{
enterBt5CpeHdPatch();
configureBt5Patch();
}
void cleanBt5Patch(void)
{
#ifndef _BT5_NO_PROG_STATE_VAR
bBt5PatchEntered = 0;
#endif
}
void rf_patch_cpe_bt5(void)
{
applyBt5Patch();
}
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_patch_cpe_bt5.h
* Revised: $Date: 2019-02-27 16:13:01 +0100 (on, 27 feb 2019) $
* Revision: $Revision: 18889 $
*
* Description: RF core patch for Bluetooth 5 support ("BLE" and "BLE5" API command sets) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,158 +50,9 @@ extern "C"
#include <stdint.h>
#include <string.h>
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageBt5[] = {
0x21004059,
0x210040a5,
0x21004085,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0x21014805,
0x438a6802,
0x6b836002,
0x6383438b,
0x6002430a,
0x47004801,
0x40046000,
0x00005b3f,
0x490cb510,
0x4a0c4788,
0x5e512106,
0xd0072900,
0xd0052902,
0xd0032909,
0xd0012910,
0xd1072911,
0x43c92177,
0xdd014288,
0xdd012800,
0x43c0207f,
0x0000bd10,
0x000065a9,
0x21000380,
};
#define _NWORD_PATCHIMAGE_BT5 37
#define _NWORD_PATCHCPEHD_BT5 0
#define _NWORD_PATCHSYS_BT5 0
#ifndef _BT5_SYSRAM_START
#define _BT5_SYSRAM_START 0x20000000
#endif
#ifndef _BT5_CPERAM_START
#define _BT5_CPERAM_START 0x21000000
#endif
#define _BT5_SYS_PATCH_FIXED_ADDR 0x20000000
#define _BT5_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _BT5_PATCH_TAB_OFFSET 0x03D4
#define _BT5_IRQPATCH_OFFSET 0x0480
#define _BT5_PATCH_VEC_OFFSET 0x404C
#define _BT5_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _BT5_NO_PROG_STATE_VAR
static uint8_t bBt5PatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterBt5CpePatch(void)
{
#if (_NWORD_PATCHIMAGE_BT5 > 0)
uint32_t *pPatchVec = (uint32_t *) (_BT5_CPERAM_START + _BT5_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageBt5, sizeof(patchImageBt5));
#endif
}
PATCH_FUN_SPEC void enterBt5CpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_BT5 > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_BT5_CPERAM_START + _BT5_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterBt5SysPatch(void)
{
}
PATCH_FUN_SPEC void configureBt5Patch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_BT5_CPERAM_START + _BT5_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
pPatchTab[91] = 1;
pPatchTab[79] = 2;
}
PATCH_FUN_SPEC void applyBt5Patch(void)
{
#ifdef _BT5_NO_PROG_STATE_VAR
enterBt5SysPatch();
enterBt5CpePatch();
#else
if (!bBt5PatchEntered)
{
enterBt5SysPatch();
enterBt5CpePatch();
bBt5PatchEntered = 1;
}
#endif
enterBt5CpeHdPatch();
configureBt5Patch();
}
PATCH_FUN_SPEC void refreshBt5Patch(void)
{
enterBt5CpeHdPatch();
configureBt5Patch();
}
#ifndef _BT5_NO_PROG_STATE_VAR
PATCH_FUN_SPEC void cleanBt5Patch(void)
{
bBt5PatchEntered = 0;
}
#endif
PATCH_FUN_SPEC void rf_patch_cpe_bt5(void)
{
applyBt5Patch();
}
extern void cleanBt5Patch(void);
extern void refreshBt5Patch(void);
extern void rf_patch_cpe_bt5(void);
//*****************************************************************************
//

View File

@ -0,0 +1,265 @@
/******************************************************************************
* Filename: rf_patch_cpe_ieee_802_15_4.c
*
* Description: RF core patch for IEEE 802.15.4-2006 support ("IEEE" API command set) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <string.h>
#include "rf_patch_cpe_ieee_802_15_4.h"
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageIeee802154[] = {
0x2100405d,
0x21004089,
0x21004095,
0x21004133,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0xf80af000,
0x47004800,
0x00007f57,
0xf80af000,
0x47004800,
0x0000881b,
0x490c6b80,
0x0f000700,
0x47707148,
0x490a4a09,
0x79502318,
0x7e4956cb,
0x428118c0,
0x4608dd01,
0x280fe002,
0x200fdd00,
0x090989d1,
0x43010109,
0x477081d1,
0x210002e0,
0x21000088,
0x4b252201,
0x48232102,
0xb5104718,
0x47804823,
0x6a404823,
0xd10d2800,
0x200a4922,
0x28005608,
0x1c40da09,
0x4608d007,
0x6a403820,
0x4288491e,
0x4780d100,
0xf7ffbd10,
0xbd10ffe3,
0x4b1c2100,
0x46084a1a,
0x481b4718,
0x780122fb,
0x70014011,
0x38ec4812,
0xb5104700,
0x47884917,
0x39204911,
0xd0072801,
0xd5040402,
0x85082000,
0x62484813,
0xbd102001,
0x4b096a4a,
0x429a3bec,
0x4a10d101,
0x4907e005,
0x4b0f6a4a,
0xd1f2429a,
0x624a4a0e,
0x0000bd10,
0x00000806,
0x0000069f,
0x000292a1,
0x21000108,
0x21000154,
0x00029263,
0x210040e7,
0x0002b4b5,
0x21000380,
0x000296f7,
0x210040dd,
0x21004123,
0x00029569,
0x21004119,
};
#define _NWORD_PATCHIMAGE_IEEE_802_15_4 87
#define _NWORD_PATCHCPEHD_IEEE_802_15_4 0
#define _NWORD_PATCHSYS_IEEE_802_15_4 0
#ifndef _IEEE_802_15_4_SYSRAM_START
#define _IEEE_802_15_4_SYSRAM_START 0x20000000
#endif
#ifndef _IEEE_802_15_4_CPERAM_START
#define _IEEE_802_15_4_CPERAM_START 0x21000000
#endif
#define _IEEE_802_15_4_SYS_PATCH_FIXED_ADDR 0x20000000
#define _IEEE_802_15_4_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _IEEE_802_15_4_PATCH_TAB_OFFSET 0x03D4
#define _IEEE_802_15_4_IRQPATCH_OFFSET 0x0480
#define _IEEE_802_15_4_PATCH_VEC_OFFSET 0x404C
#define _IEEE_802_15_4_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _IEEE_802_15_4_NO_PROG_STATE_VAR
static uint8_t bIeee802154PatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterIeee802154CpePatch(void)
{
#if (_NWORD_PATCHIMAGE_IEEE_802_15_4 > 0)
uint32_t *pPatchVec = (uint32_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageIeee802154, sizeof(patchImageIeee802154));
#endif
}
PATCH_FUN_SPEC void enterIeee802154CpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_IEEE_802_15_4 > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterIeee802154SysPatch(void)
{
}
PATCH_FUN_SPEC void configureIeee802154Patch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
pPatchTab[140] = 1;
pPatchTab[150] = 2;
pPatchTab[164] = 3;
}
PATCH_FUN_SPEC void applyIeee802154Patch(void)
{
#ifdef _IEEE_802_15_4_NO_PROG_STATE_VAR
enterIeee802154SysPatch();
enterIeee802154CpePatch();
#else
if (!bIeee802154PatchEntered)
{
enterIeee802154SysPatch();
enterIeee802154CpePatch();
bIeee802154PatchEntered = 1;
}
#endif
enterIeee802154CpeHdPatch();
configureIeee802154Patch();
}
void refreshIeee802154Patch(void)
{
enterIeee802154CpeHdPatch();
configureIeee802154Patch();
}
void cleanIeee802154Patch(void)
{
#ifndef _IEEE_802_15_4_NO_PROG_STATE_VAR
bIeee802154PatchEntered = 0;
#endif
}
void rf_patch_cpe_ieee_802_15_4(void)
{
applyIeee802154Patch();
}
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_patch_cpe_ieee_802_15_4.h
* Revised: $Date: 2019-02-27 16:13:01 +0100 (on, 27 feb 2019) $
* Revision: $Revision: 18889 $
*
* Description: RF core patch for IEEE 802.15.4-2006 support ("IEEE" API command set) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,131 +50,9 @@ extern "C"
#include <stdint.h>
#include <string.h>
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageIeee802154[] = {
0x21004051,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
};
#define _NWORD_PATCHIMAGE_IEEE_802_15_4 12
#define _NWORD_PATCHCPEHD_IEEE_802_15_4 0
#define _NWORD_PATCHSYS_IEEE_802_15_4 0
#ifndef _IEEE_802_15_4_SYSRAM_START
#define _IEEE_802_15_4_SYSRAM_START 0x20000000
#endif
#ifndef _IEEE_802_15_4_CPERAM_START
#define _IEEE_802_15_4_CPERAM_START 0x21000000
#endif
#define _IEEE_802_15_4_SYS_PATCH_FIXED_ADDR 0x20000000
#define _IEEE_802_15_4_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _IEEE_802_15_4_PATCH_TAB_OFFSET 0x03D4
#define _IEEE_802_15_4_IRQPATCH_OFFSET 0x0480
#define _IEEE_802_15_4_PATCH_VEC_OFFSET 0x404C
#define _IEEE_802_15_4_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _IEEE_802_15_4_NO_PROG_STATE_VAR
static uint8_t bIeee802154PatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterIeee802154CpePatch(void)
{
#if (_NWORD_PATCHIMAGE_IEEE_802_15_4 > 0)
uint32_t *pPatchVec = (uint32_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageIeee802154, sizeof(patchImageIeee802154));
#endif
}
PATCH_FUN_SPEC void enterIeee802154CpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_IEEE_802_15_4 > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterIeee802154SysPatch(void)
{
}
PATCH_FUN_SPEC void configureIeee802154Patch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_IEEE_802_15_4_CPERAM_START + _IEEE_802_15_4_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
}
PATCH_FUN_SPEC void applyIeee802154Patch(void)
{
#ifdef _IEEE_802_15_4_NO_PROG_STATE_VAR
enterIeee802154SysPatch();
enterIeee802154CpePatch();
#else
if (!bIeee802154PatchEntered)
{
enterIeee802154SysPatch();
enterIeee802154CpePatch();
bIeee802154PatchEntered = 1;
}
#endif
enterIeee802154CpeHdPatch();
configureIeee802154Patch();
}
PATCH_FUN_SPEC void refreshIeee802154Patch(void)
{
enterIeee802154CpeHdPatch();
configureIeee802154Patch();
}
#ifndef _IEEE_802_15_4_NO_PROG_STATE_VAR
PATCH_FUN_SPEC void cleanIeee802154Patch(void)
{
bIeee802154PatchEntered = 0;
}
#endif
PATCH_FUN_SPEC void rf_patch_cpe_ieee_802_15_4(void)
{
applyIeee802154Patch();
}
extern void cleanIeee802154Patch(void);
extern void refreshIeee802154Patch(void);
extern void rf_patch_cpe_ieee_802_15_4(void);
//*****************************************************************************
//

View File

@ -0,0 +1,67 @@
/******************************************************************************
* Filename: rf_patch_cpe_multi_bt5_coex.h
*
* Description: RF core patch for coexistence support for Bluetooth 5 ("BLE" and "BLE5" API command sets) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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 _RF_PATCH_CPE_MULTI_BT5_COEX_H
#define _RF_PATCH_CPE_MULTI_BT5_COEX_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <string.h>
extern void cleanMultiBt5CoexPatch(void);
extern void refreshMultiBt5CoexPatch(void);
extern void rf_patch_cpe_multi_bt5_coex(void);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // _RF_PATCH_CPE_MULTI_BT5_COEX_H

View File

@ -0,0 +1,565 @@
/******************************************************************************
* Filename: rf_patch_cpe_multi_protocol.c
*
* Description: RF core patch for multi-protocol support (all available API command sets) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <string.h>
#include "rf_patch_cpe_multi_protocol.h"
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageMultiProtocol[] = {
0x210043f1,
0x2100408d,
0x210040a9,
0x21004113,
0x210040d5,
0x21004465,
0x210044a1,
0x21004139,
0x21004145,
0x21004151,
0x2100452d,
0x21004185,
0x2100419d,
0x210041b5,
0x210041f1,
0x21004587,
0xd00507db,
0xf803f000,
0x70084902,
0xb570bd70,
0x47284d01,
0x210004e0,
0x0002241d,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0xf819f000,
0x296cb2e1,
0x2804d00b,
0x2806d001,
0x490ed107,
0x07c97809,
0x7821d103,
0xd4000709,
0x490b2002,
0x210c780a,
0xd0024211,
0x22804909,
0xb003600a,
0xb5f0bdf0,
0x4907b083,
0x48044708,
0x22407801,
0x70014391,
0x47004804,
0x210000c8,
0x21000133,
0xe000e200,
0x00031641,
0x00031b23,
0x4700b570,
0xf9daf000,
0x47004800,
0x00007f57,
0xf9daf000,
0x47004800,
0x0000881b,
0x0a9b9b03,
0x2b834d08,
0x4c08d10a,
0x069b8923,
0xb407d506,
0xf805f000,
0xd0002800,
0xbc073542,
0xb5704728,
0x47004802,
0x00020b1f,
0x21000160,
0x000209eb,
0x781a4b09,
0x43a22408,
0xd0002800,
0x701a4322,
0x47104a00,
0x00008e83,
0x78084903,
0xd4010700,
0x47004802,
0x00004770,
0x21000380,
0x00007e5f,
0x4a094808,
0x429a6803,
0x4808d10a,
0x4b088902,
0xd0011ad2,
0xd1032a01,
0x49066e40,
0x99034788,
0x47184b05,
0x210002a8,
0x000203bd,
0x21000160,
0x00001821,
0x000035f1,
0x000006bd,
0x20284a04,
0x48044790,
0x60412101,
0x4a044803,
0x47106041,
0x0000424f,
0x40045000,
0x40046000,
0x00004285,
0x4c86b510,
0x31404621,
0x28017d08,
0x4884d134,
0x08407dc0,
0xd02f07c0,
0x30604620,
0x08527942,
0xd02907d2,
0x0b808940,
0xd1252801,
0x09417e08,
0xd00c07c9,
0x07006fa1,
0x0fc08809,
0x04090240,
0x66604308,
0x1c806fa0,
0xf9cef000,
0x4874e013,
0x69803020,
0x28006840,
0x4a72d00e,
0x78012300,
0x1a5956d3,
0x00c9d408,
0x78411808,
0xd00307c9,
0x66616801,
0x66a06840,
0x4780486b,
0xb5f8bd10,
0x496a4c66,
0x36204626,
0x46257b70,
0x90003540,
0x00b8792f,
0x68801840,
0x28004780,
0x4960d128,
0x09097dc9,
0xd02307c9,
0x32644622,
0xd0202f15,
0x23007e29,
0x07ff094f,
0x7d6dd003,
0xd0002d00,
0x9f002301,
0x43bb6fa5,
0x7b73d012,
0xd00f2b00,
0x065b7d23,
0x88d2d50c,
0x2a010b92,
0x08c9d108,
0xd00507c9,
0x0b8988a9,
0xd1012901,
0x73712100,
0x7eabbdf8,
0x2b017de9,
0x2300d0e3,
0xb570e7e1,
0x46254c46,
0x35806a60,
0xd11d2800,
0x5d002054,
0x28002200,
0x2064d017,
0x08805d00,
0xd01207c0,
0x888868a9,
0x28010b80,
0x483dd10d,
0x08407dc0,
0xd00807c0,
0x3020483a,
0x68006980,
0xd0022800,
0x60a86229,
0x622ae000,
0x47804839,
0x29006a61,
0x6a29d103,
0xd0002900,
0xbd7060a9,
0x4c2fb5f8,
0x46204934,
0x7d023040,
0xd02f2a00,
0x46257e80,
0x28033580,
0x2804d002,
0xe027d003,
0x75e82001,
0x2064e024,
0x08805d00,
0xd01f07c0,
0x888068a8,
0x28010b80,
0x4822d11a,
0x7dc07dea,
0xd0132a00,
0x07c008c0,
0x4626d012,
0x7b773620,
0x46014788,
0xd1084339,
0x06097d21,
0x8869d505,
0x29010b89,
0x2100d101,
0xbdf87371,
0xe7ea0880,
0xbdf84788,
0x30804812,
0x75c12100,
0x47004817,
0x3140490f,
0x28267108,
0xdc06d014,
0xd0132815,
0xd00b281b,
0xd104281f,
0x283de00a,
0x2847d00e,
0x490bd00a,
0x18400080,
0x47706880,
0x4770480c,
0x4770480c,
0x4770480c,
0x4770480c,
0x4770480c,
0x21000160,
0x210000c8,
0x210004e0,
0x00024959,
0x00025500,
0x00023d8f,
0x00023075,
0x00022a15,
0x210043e5,
0x21004371,
0x21004313,
0x21004293,
0x21004215,
0x490cb510,
0x4a0c4788,
0x5e512106,
0xd0072900,
0xd0052902,
0xd0032909,
0xd0012910,
0xd1072911,
0x43c92177,
0xdd014288,
0xdd012800,
0x43c0207f,
0x0000bd10,
0x000065a9,
0x21000380,
0x4810b510,
0x481088c1,
0xd0182905,
0x68214c0f,
0x0052084a,
0x6ba26022,
0x00520852,
0x602163a2,
0xfe38f7ff,
0x07006ba0,
0x2001d408,
0x60606020,
0x1c402000,
0xdbfc280c,
0x62202014,
0xf7ffbd10,
0xbd10fe29,
0x21000380,
0x00005b3f,
0x40046000,
0x490c6b80,
0x0f000700,
0x47707148,
0x490a4a09,
0x79502318,
0x7e4956cb,
0x428118c0,
0x4608dd01,
0x280fe002,
0x200fdd00,
0x090989d1,
0x43010109,
0x477081d1,
0x210002e0,
0x21000088,
0x47702000,
0x4b252201,
0x48232102,
0xb5104718,
0x47804823,
0x6a404823,
0xd10d2800,
0x200a4922,
0x28005608,
0x1c40da09,
0x4608d007,
0x6a403820,
0x4288491e,
0x4780d100,
0xf7ffbd10,
0xbd10ffe3,
0x4b1c2100,
0x46084a1a,
0x481b4718,
0x780122fb,
0x70014011,
0x38ec4812,
0xb5104700,
0x47884917,
0x39204911,
0xd0072801,
0xd5040402,
0x85082000,
0x62484813,
0xbd102001,
0x4b096a4a,
0x429a3bec,
0x4a10d101,
0x4907e005,
0x4b0f6a4a,
0xd1f2429a,
0x624a4a0e,
0x0000bd10,
0x00000806,
0x0000069f,
0x000292a1,
0x21000108,
0x21000154,
0x00029263,
0x2100453b,
0x0002b4b5,
0x21000380,
0x000296f7,
0x21004531,
0x21004577,
0x00029569,
0x2100456d,
0x07810882,
0x0ec90092,
0x78c0ca0c,
0x424940ca,
0x408b3120,
0x0211431a,
0x06000a09,
0x47704308,
};
#define _NWORD_PATCHIMAGE_MULTI_PROTOCOL 372
CPE_PATCH_TYPE patchCpeHd[] = {
0x00000000,
};
#define _NWORD_PATCHCPEHD_MULTI_PROTOCOL 1
#define _NWORD_PATCHSYS_MULTI_PROTOCOL 0
#ifndef _MULTI_PROTOCOL_SYSRAM_START
#define _MULTI_PROTOCOL_SYSRAM_START 0x20000000
#endif
#ifndef _MULTI_PROTOCOL_CPERAM_START
#define _MULTI_PROTOCOL_CPERAM_START 0x21000000
#endif
#define _MULTI_PROTOCOL_SYS_PATCH_FIXED_ADDR 0x20000000
#define _MULTI_PROTOCOL_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _MULTI_PROTOCOL_PATCH_TAB_OFFSET 0x03D4
#define _MULTI_PROTOCOL_IRQPATCH_OFFSET 0x0480
#define _MULTI_PROTOCOL_PATCH_VEC_OFFSET 0x404C
#define _MULTI_PROTOCOL_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
static uint8_t bMultiProtocolPatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterMultiProtocolCpePatch(void)
{
#if (_NWORD_PATCHIMAGE_MULTI_PROTOCOL > 0)
uint32_t *pPatchVec = (uint32_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageMultiProtocol, sizeof(patchImageMultiProtocol));
#endif
}
PATCH_FUN_SPEC void enterMultiProtocolCpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_MULTI_PROTOCOL > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterMultiProtocolSysPatch(void)
{
}
PATCH_FUN_SPEC void configureMultiProtocolPatch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_TAB_OFFSET);
pPatchTab[1] = 0;
pPatchTab[21] = 1;
pPatchTab[76] = 2;
pPatchTab[62] = 3;
pPatchTab[64] = 4;
pPatchTab[91] = 5;
pPatchTab[79] = 6;
pPatchTab[140] = 7;
pPatchTab[150] = 8;
pPatchTab[13] = 9;
pPatchTab[31] = 10;
pPatchTab[152] = 11;
pPatchTab[151] = 12;
pPatchTab[40] = 13;
pPatchTab[73] = 14;
pPatchTab[164] = 15;
}
PATCH_FUN_SPEC void applyMultiProtocolPatch(void)
{
#ifdef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
enterMultiProtocolSysPatch();
enterMultiProtocolCpePatch();
#else
if (!bMultiProtocolPatchEntered)
{
enterMultiProtocolSysPatch();
enterMultiProtocolCpePatch();
bMultiProtocolPatchEntered = 1;
}
#endif
enterMultiProtocolCpeHdPatch();
configureMultiProtocolPatch();
}
void refreshMultiProtocolPatch(void)
{
enterMultiProtocolCpeHdPatch();
configureMultiProtocolPatch();
}
void cleanMultiProtocolPatch(void)
{
#ifndef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
bMultiProtocolPatchEntered = 0;
#endif
}
void rf_patch_cpe_multi_protocol(void)
{
applyMultiProtocolPatch();
}
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_patch_cpe_multi_protocol.h
* Revised: $Date: 2019-02-27 16:13:01 +0100 (on, 27 feb 2019) $
* Revision: $Revision: 18889 $
*
* Description: RF core patch for multi-protocol support (all available API command sets) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,186 +50,9 @@ extern "C"
#include <stdint.h>
#include <string.h>
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageMultiProtocol[] = {
0x21004061,
0x210040cb,
0x2100408d,
0x2100410d,
0x210040ed,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0xf819f000,
0x296cb2e1,
0x2804d00b,
0x2806d001,
0x490ed107,
0x07c97809,
0x7821d103,
0xd4000709,
0x490b2002,
0x210c780a,
0xd0024211,
0x22804909,
0xb003600a,
0xb5f0bdf0,
0x4907b083,
0x48044708,
0x22407801,
0x70014391,
0x47004804,
0x210000c8,
0x21000133,
0xe000e200,
0x00031641,
0x00031b23,
0x21014805,
0x438a6802,
0x6b836002,
0x6383438b,
0x6002430a,
0x47004801,
0x40046000,
0x00005b3f,
0x490cb510,
0x4a0c4788,
0x5e512106,
0xd0072900,
0xd0052902,
0xd0032909,
0xd0012910,
0xd1072911,
0x43c92177,
0xdd014288,
0xdd012800,
0x43c0207f,
0x0000bd10,
0x000065a9,
0x21000380,
};
#define _NWORD_PATCHIMAGE_MULTI_PROTOCOL 63
#define _NWORD_PATCHCPEHD_MULTI_PROTOCOL 0
#define _NWORD_PATCHSYS_MULTI_PROTOCOL 0
#ifndef _MULTI_PROTOCOL_SYSRAM_START
#define _MULTI_PROTOCOL_SYSRAM_START 0x20000000
#endif
#ifndef _MULTI_PROTOCOL_CPERAM_START
#define _MULTI_PROTOCOL_CPERAM_START 0x21000000
#endif
#define _MULTI_PROTOCOL_SYS_PATCH_FIXED_ADDR 0x20000000
#define _MULTI_PROTOCOL_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _MULTI_PROTOCOL_PATCH_TAB_OFFSET 0x03D4
#define _MULTI_PROTOCOL_IRQPATCH_OFFSET 0x0480
#define _MULTI_PROTOCOL_PATCH_VEC_OFFSET 0x404C
#define _MULTI_PROTOCOL_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
static uint8_t bMultiProtocolPatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterMultiProtocolCpePatch(void)
{
#if (_NWORD_PATCHIMAGE_MULTI_PROTOCOL > 0)
uint32_t *pPatchVec = (uint32_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageMultiProtocol, sizeof(patchImageMultiProtocol));
#endif
}
PATCH_FUN_SPEC void enterMultiProtocolCpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_MULTI_PROTOCOL > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterMultiProtocolSysPatch(void)
{
}
PATCH_FUN_SPEC void configureMultiProtocolPatch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_MULTI_PROTOCOL_CPERAM_START + _MULTI_PROTOCOL_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
pPatchTab[62] = 1;
pPatchTab[64] = 2;
pPatchTab[91] = 3;
pPatchTab[79] = 4;
}
PATCH_FUN_SPEC void applyMultiProtocolPatch(void)
{
#ifdef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
enterMultiProtocolSysPatch();
enterMultiProtocolCpePatch();
#else
if (!bMultiProtocolPatchEntered)
{
enterMultiProtocolSysPatch();
enterMultiProtocolCpePatch();
bMultiProtocolPatchEntered = 1;
}
#endif
enterMultiProtocolCpeHdPatch();
configureMultiProtocolPatch();
}
PATCH_FUN_SPEC void refreshMultiProtocolPatch(void)
{
enterMultiProtocolCpeHdPatch();
configureMultiProtocolPatch();
}
#ifndef _MULTI_PROTOCOL_NO_PROG_STATE_VAR
PATCH_FUN_SPEC void cleanMultiProtocolPatch(void)
{
bMultiProtocolPatchEntered = 0;
}
#endif
PATCH_FUN_SPEC void rf_patch_cpe_multi_protocol(void)
{
applyMultiProtocolPatch();
}
extern void cleanMultiProtocolPatch(void);
extern void refreshMultiProtocolPatch(void);
extern void rf_patch_cpe_multi_protocol(void);
//*****************************************************************************
//

View File

@ -0,0 +1,267 @@
/******************************************************************************
* Filename: rf_patch_cpe_prop.c
*
* Description: RF core patch for proprietary radio support ("PROP" API command set) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <string.h>
#include "rf_patch_cpe_prop.h"
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageProp[] = {
0x2100406d,
0x210040d7,
0x21004099,
0x210040f9,
0x21004105,
0x21004111,
0x21004129,
0x21004141,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0xf819f000,
0x296cb2e1,
0x2804d00b,
0x2806d001,
0x490ed107,
0x07c97809,
0x7821d103,
0xd4000709,
0x490b2002,
0x210c780a,
0xd0024211,
0x22804909,
0xb003600a,
0xb5f0bdf0,
0x4907b083,
0x48044708,
0x22407801,
0x70014391,
0x47004804,
0x210000c8,
0x21000133,
0xe000e200,
0x00031641,
0x00031b23,
0xf834f000,
0x47004800,
0x00007f57,
0xf834f000,
0x47004800,
0x0000881b,
0x781a4b09,
0x43a22408,
0xd0002800,
0x701a4322,
0x47104a00,
0x00008e83,
0x78084903,
0xd4010700,
0x47004802,
0x00004770,
0x21000380,
0x00007e5f,
0x20284a04,
0x48044790,
0x60412101,
0x4a044803,
0x47106041,
0x0000424f,
0x40045000,
0x40046000,
0x00004285,
0x490c6b80,
0x0f000700,
0x47707148,
0x490a4a09,
0x79502318,
0x7e4956cb,
0x428118c0,
0x4608dd01,
0x280fe002,
0x200fdd00,
0x090989d1,
0x43010109,
0x477081d1,
0x210002e0,
0x21000088,
};
#define _NWORD_PATCHIMAGE_PROP 85
#define _NWORD_PATCHCPEHD_PROP 0
#define _NWORD_PATCHSYS_PROP 0
#ifndef _PROP_SYSRAM_START
#define _PROP_SYSRAM_START 0x20000000
#endif
#ifndef _PROP_CPERAM_START
#define _PROP_CPERAM_START 0x21000000
#endif
#define _PROP_SYS_PATCH_FIXED_ADDR 0x20000000
#define _PROP_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _PROP_PATCH_TAB_OFFSET 0x03D4
#define _PROP_IRQPATCH_OFFSET 0x0480
#define _PROP_PATCH_VEC_OFFSET 0x404C
#define _PROP_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _PROP_NO_PROG_STATE_VAR
static uint8_t bPropPatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterPropCpePatch(void)
{
#if (_NWORD_PATCHIMAGE_PROP > 0)
uint32_t *pPatchVec = (uint32_t *) (_PROP_CPERAM_START + _PROP_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageProp, sizeof(patchImageProp));
#endif
}
PATCH_FUN_SPEC void enterPropCpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_PROP > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_PROP_CPERAM_START + _PROP_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterPropSysPatch(void)
{
}
PATCH_FUN_SPEC void configurePropPatch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_PROP_CPERAM_START + _PROP_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
pPatchTab[62] = 1;
pPatchTab[64] = 2;
pPatchTab[140] = 3;
pPatchTab[150] = 4;
pPatchTab[152] = 5;
pPatchTab[151] = 6;
pPatchTab[73] = 7;
}
PATCH_FUN_SPEC void applyPropPatch(void)
{
#ifdef _PROP_NO_PROG_STATE_VAR
enterPropSysPatch();
enterPropCpePatch();
#else
if (!bPropPatchEntered)
{
enterPropSysPatch();
enterPropCpePatch();
bPropPatchEntered = 1;
}
#endif
enterPropCpeHdPatch();
configurePropPatch();
}
void refreshPropPatch(void)
{
enterPropCpeHdPatch();
configurePropPatch();
}
void cleanPropPatch(void)
{
#ifndef _PROP_NO_PROG_STATE_VAR
bPropPatchEntered = 0;
#endif
}
void rf_patch_cpe_prop(void)
{
applyPropPatch();
}
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_patch_cpe_prop.h
* Revised: $Date: 2019-02-27 16:13:01 +0100 (on, 27 feb 2019) $
* Revision: $Revision: 18889 $
*
* Description: RF core patch for proprietary radio support ("PROP" API command set) in CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,159 +50,9 @@ extern "C"
#include <stdint.h>
#include <string.h>
#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif
#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif
CPE_PATCH_TYPE patchImageProp[] = {
0x21004059,
0x210040c3,
0x21004085,
0x79654c07,
0xf809f000,
0x40697961,
0xd5030749,
0x4a042101,
0x60110389,
0xb570bd70,
0x47084902,
0x21000380,
0x40041108,
0x0000592d,
0xf819f000,
0x296cb2e1,
0x2804d00b,
0x2806d001,
0x490ed107,
0x07c97809,
0x7821d103,
0xd4000709,
0x490b2002,
0x210c780a,
0xd0024211,
0x22804909,
0xb003600a,
0xb5f0bdf0,
0x4907b083,
0x48044708,
0x22407801,
0x70014391,
0x47004804,
0x210000c8,
0x21000133,
0xe000e200,
0x00031641,
0x00031b23,
};
#define _NWORD_PATCHIMAGE_PROP 38
#define _NWORD_PATCHCPEHD_PROP 0
#define _NWORD_PATCHSYS_PROP 0
#ifndef _PROP_SYSRAM_START
#define _PROP_SYSRAM_START 0x20000000
#endif
#ifndef _PROP_CPERAM_START
#define _PROP_CPERAM_START 0x21000000
#endif
#define _PROP_SYS_PATCH_FIXED_ADDR 0x20000000
#define _PROP_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _PROP_PATCH_TAB_OFFSET 0x03D4
#define _PROP_IRQPATCH_OFFSET 0x0480
#define _PROP_PATCH_VEC_OFFSET 0x404C
#define _PROP_PATCH_CPEHD_OFFSET 0x04E0
#ifndef _PROP_NO_PROG_STATE_VAR
static uint8_t bPropPatchEntered = 0;
#endif
PATCH_FUN_SPEC void enterPropCpePatch(void)
{
#if (_NWORD_PATCHIMAGE_PROP > 0)
uint32_t *pPatchVec = (uint32_t *) (_PROP_CPERAM_START + _PROP_PATCH_VEC_OFFSET);
memcpy(pPatchVec, patchImageProp, sizeof(patchImageProp));
#endif
}
PATCH_FUN_SPEC void enterPropCpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_PROP > 0)
uint32_t *pPatchCpeHd = (uint32_t *) (_PROP_CPERAM_START + _PROP_PATCH_CPEHD_OFFSET);
memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}
PATCH_FUN_SPEC void enterPropSysPatch(void)
{
}
PATCH_FUN_SPEC void configurePropPatch(void)
{
uint8_t *pPatchTab = (uint8_t *) (_PROP_CPERAM_START + _PROP_PATCH_TAB_OFFSET);
pPatchTab[76] = 0;
pPatchTab[62] = 1;
pPatchTab[64] = 2;
}
PATCH_FUN_SPEC void applyPropPatch(void)
{
#ifdef _PROP_NO_PROG_STATE_VAR
enterPropSysPatch();
enterPropCpePatch();
#else
if (!bPropPatchEntered)
{
enterPropSysPatch();
enterPropCpePatch();
bPropPatchEntered = 1;
}
#endif
enterPropCpeHdPatch();
configurePropPatch();
}
PATCH_FUN_SPEC void refreshPropPatch(void)
{
enterPropCpeHdPatch();
configurePropPatch();
}
#ifndef _PROP_NO_PROG_STATE_VAR
PATCH_FUN_SPEC void cleanPropPatch(void)
{
bPropPatchEntered = 0;
}
#endif
PATCH_FUN_SPEC void rf_patch_cpe_prop(void)
{
applyPropPatch();
}
extern void cleanPropPatch(void);
extern void refreshPropPatch(void);
extern void rf_patch_cpe_prop(void);
//*****************************************************************************
//

View File

@ -0,0 +1,585 @@
/******************************************************************************
* Filename: rf_patch_mce_genook.h
*
* Description: RF core patch for General OOK support in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
#include <stdint.h>
#include "rf_patch_mce_genook.h"
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
#ifndef MCE_PATCH_TYPE
#define MCE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC
#endif
#ifndef RFC_MCERAM_BASE
#define RFC_MCERAM_BASE 0x21008000
#endif
#ifndef MCE_PATCH_MODE
#define MCE_PATCH_MODE 0
#endif
MCE_PATCH_TYPE patchGenookMce[489] = {
0x0000603b,
0x01952fcf,
0x7fff0001,
0x030c003f,
0x070c680a,
0x00010000,
0xaaaa000f,
0x00fc00aa,
0x272d8080,
0x00170003,
0x0000001f,
0x04000000,
0x0000000f,
0x00020387,
0x00434074,
0x00028000,
0x06f00020,
0x091e0000,
0x00540500,
0x00000000,
0x00505014,
0x000f0000,
0x007f7f30,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x72230000,
0x73037263,
0x72037305,
0x73067304,
0x73917204,
0xc7c07291,
0x00018001,
0x90109001,
0x90010801,
0x720e720d,
0x7210720f,
0x7100b0d0,
0xa0d0b110,
0x8162721b,
0x06701020,
0x407d1e00,
0x407e1e10,
0x40681e20,
0x06f23982,
0x11011632,
0x6c011421,
0x61936193,
0x633f6329,
0x39423982,
0x11011632,
0x6c011421,
0x60ef60ef,
0x12206118,
0x12106074,
0x73117223,
0x73137312,
0x001081b1,
0xb07091b0,
0x60736050,
0xc2b2c121,
0x1820c4e0,
0x6e236f13,
0x16121611,
0x78706882,
0x78809c80,
0x78909c90,
0x78b09ca0,
0x790099c0,
0x94909480,
0xc750c4f2,
0x409a1820,
0x6e231203,
0x68971612,
0x979078a0,
0x81906073,
0x81709640,
0x2a703980,
0x16111001,
0x84b484a2,
0xc0f5c0f3,
0x1c01c200,
0xc10040c1,
0x40b71c10,
0x10134cb9,
0x18301803,
0x1a101a13,
0x68b43912,
0x13f360c1,
0x13f360c1,
0xc1001015,
0x1a151850,
0x39141a10,
0xb0e868bf,
0xb1287100,
0xb230a0e8,
0xb012b002,
0x22168246,
0x817640c8,
0x06f63d46,
0x81708195,
0x105106f0,
0x65620611,
0x68d13d15,
0x22f08170,
0x1a1644cb,
0x87914cce,
0x9a11d030,
0x13f067cb,
0x40e81c03,
0x1021c0f0,
0x65620611,
0x68e33d12,
0x1041c0f0,
0x65620611,
0x68e93d14,
0x73117000,
0xc0007312,
0xb11191f0,
0xc050b0d1,
0xc0109910,
0xc0089930,
0x8ca3649d,
0x39533983,
0x82100613,
0x410f2210,
0x083181d1,
0x65621017,
0x39808160,
0x1e103940,
0x1071450e,
0x65620a11,
0x120160ff,
0xb2346562,
0xb111a0d1,
0xc040a0d3,
0x607367cb,
0x73117223,
0xc0007312,
0xb11191f0,
0xc050b0d1,
0xc0109910,
0xb2309930,
0x22168246,
0xb0024124,
0xc008b012,
0x78cac030,
0x061110a1,
0x391a6562,
0xc0f0692c,
0x10a178da,
0x65620611,
0x6933391a,
0x78eac070,
0x061110a1,
0x391a6562,
0xc090693a,
0x10a178fa,
0x65620611,
0x6941391a,
0x39838ca3,
0x06133953,
0x22108210,
0xc0114157,
0x65620831,
0x67a781d1,
0xc0016562,
0x65620831,
0xc011614a,
0xc0016562,
0xb2346562,
0xb111a0d1,
0xc050a0d3,
0x607367cb,
0x2208c029,
0x22014568,
0x6177417e,
0x457e2201,
0x22ff879f,
0x65834177,
0x92313111,
0x10183911,
0xc019811e,
0xc0294576,
0xb111617e,
0x31117100,
0x39119231,
0xc0191018,
0x7100b111,
0x457e1a19,
0x10f97000,
0x04f9785f,
0x10001000,
0x10001000,
0x10001000,
0x10001000,
0x10001000,
0x45861a19,
0x67617000,
0x67cbc060,
0xc01084ed,
0x312d140d,
0x8c9e142d,
0x311e318e,
0x8c99397e,
0x39793149,
0x31293949,
0x99301090,
0xb9147291,
0xc662a914,
0xb0029912,
0xe070b012,
0x9a2f9a1b,
0xb63567cb,
0x66aab63c,
0x8c81a1b2,
0x45bc22f1,
0x22f18ca1,
0x61f145bc,
0x80b77100,
0x460f2207,
0x22b08090,
0x105441c8,
0x6648873c,
0x61bc669f,
0x22f18c81,
0x223741d2,
0xb13341d2,
0x223080b0,
0x61e045cd,
0x41e522e1,
0x22508090,
0xb11541e5,
0x22108240,
0x993941bc,
0xa914b914,
0x61bcb116,
0xb914993d,
0xb116a914,
0x8ca061bc,
0x42eb22f0,
0x42eb2237,
0xb133b075,
0x223080b0,
0xb08745eb,
0x710061bc,
0x220780b7,
0x2237460f,
0x8090460e,
0x420022b0,
0x873c1054,
0x669f6648,
0x8c8161f1,
0x41f122e1,
0x22508090,
0xb11541f1,
0x22108240,
0x993d41f1,
0xa914b914,
0x61f1b116,
0xb130b1b2,
0xb133a0f0,
0xb074a0f3,
0xa044b231,
0x22408360,
0xb0d24224,
0x7100b112,
0x22b08090,
0x10544224,
0x6648873c,
0x621b669f,
0xb112a0d2,
0x9a1ad080,
0xc00f67cb,
0x7100c00e,
0x22008090,
0x873c4450,
0x66481054,
0x8160669f,
0x06f03980,
0x463a1e10,
0x623b668b,
0x8180667f,
0x422b1e00,
0x1cf01a10,
0x62434e2b,
0xa0d6622b,
0xa0dbb116,
0x6317b11b,
0x8a72ba34,
0x063189c1,
0x42651e01,
0x42571e21,
0x425e1e31,
0x14261056,
0x10653916,
0x10566266,
0x18563126,
0x39261426,
0x62661065,
0x31361056,
0x14261856,
0x10653936,
0x10266266,
0x39228242,
0x4e741c26,
0xc1011862,
0x4e721c12,
0x18211201,
0x627c3121,
0x627ccc01,
0xc1011826,
0x4e7b1c16,
0x31211061,
0xc401627c,
0xb11b9731,
0x1c8a7000,
0x8240468a,
0x1c043920,
0xc0014e87,
0xc0116288,
0x161f91c1,
0x1c8a7000,
0x8730469e,
0x3d803180,
0x18701001,
0x1e1e1017,
0x3980469d,
0x8ca13970,
0x39513981,
0x91c00810,
0x0a1e161f,
0x87317000,
0x081010c0,
0x42a62270,
0x62a9120a,
0x42a41cba,
0x7000161a,
0xb116b11b,
0xb130b111,
0xb115b133,
0x720db112,
0x720f720e,
0xb0f0b0db,
0x8c82b0f3,
0x42bd22f2,
0xb913b0d6,
0x8ca062c0,
0x42e022f0,
0xa444b445,
0xa469a468,
0x3180caa0,
0x0001caa1,
0x94d194c1,
0x31838ca3,
0x84503983,
0x39803180,
0x00303183,
0x84409450,
0x39503150,
0x39838ca3,
0xc1f406f3,
0x31841834,
0x00403134,
0xb0899440,
0x42ea22e2,
0x394a8c9a,
0x312a398a,
0xb0d5993a,
0xb913b0d6,
0xb23f7000,
0xa0f3a0f0,
0x993ea0db,
0xa914b914,
0xb130b116,
0xb11bb133,
0x22008240,
0xb11542f6,
0xa0048002,
0xa001a006,
0x72047203,
0x67cbc090,
0xb9147100,
0xb0d5b116,
0x7100a23f,
0xa0d5b115,
0x90307820,
0x78309002,
0x90609040,
0xa23fb072,
0x993a66aa,
0xb116a914,
0xba3c61b5,
0x8b5481b0,
0x31843924,
0x91b40004,
0x67cbc0a0,
0x72917391,
0x72067263,
0x72047202,
0x73067305,
0x67616073,
0x67cbc0b0,
0xb0dbb118,
0xb005b11b,
0x7100b258,
0x8ca0b11b,
0x433922e0,
0x22108240,
0x66484331,
0x39708730,
0x679d0a10,
0x67616331,
0x67cbc0c0,
0xb074b0db,
0x89ce120c,
0x1e0e398e,
0x1210434f,
0x1a2030e0,
0x66487100,
0x71006b4c,
0x22e08ca0,
0x82404356,
0x43472210,
0x39716648,
0x91c10a11,
0x1e048184,
0x161c4347,
0x43171cc4,
0x12006347,
0xb11891e0,
0xb016b006,
0xb014b004,
0xb012b002,
0x78628440,
0x81730420,
0x2a733983,
0xc1f294e3,
0x31621832,
0x31511021,
0x00200012,
0x78209440,
0x90509030,
0x90407830,
0xc04b9060,
0x39308360,
0x1e000630,
0x300b4386,
0x1a1b10b8,
0xc00a3918,
0xa234108f,
0x8360a233,
0x43942240,
0xc022165f,
0x639a67ac,
0x439a2230,
0xc022163f,
0xb23367ac,
0xb072b235,
0x22007000,
0xb00547a1,
0x800063a6,
0x43a62250,
0xa005b270,
0x82d27000,
0x06123972,
0x70000821,
0x302084a0,
0x39818191,
0x1823c083,
0x14103831,
0x84b09590,
0x84a13020,
0x38313981,
0x95a01410,
0x302084c0,
0x39818191,
0x14103831,
0x84d095b0,
0x84c13020,
0x38313981,
0x95c01410,
0x9a007000,
0x220089f0,
0xb9e047cc,
0x00007000
};
PATCH_FUN_SPEC void rf_patch_mce_genook(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 489; i++) {
HWREG(RFC_MCERAM_BASE + 4 * i) = patchGenookMce[i];
}
#else
const uint32_t *pS = patchGenookMce;
volatile unsigned long *pD = &HWREG(RFC_MCERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 61;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
t1 = *pS++;
*pD++ = t1;
#endif
}

View File

@ -0,0 +1,46 @@
/******************************************************************************
* Filename: rf_patch_mce_genook.h
*
* Description: RF core patch for General OOK support in CC13x2 and CC26x2
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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 _RF_PATCH_MCE_GENOOK_H
#define _RF_PATCH_MCE_GENOOK_H
#include <stdint.h>
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
extern void rf_patch_mce_genook(void);
#endif

View File

@ -0,0 +1,453 @@
/******************************************************************************
* Filename: rf_patch_mce_iqdump.h
*
* Description: RF core patch for IQ-dump support in CC13x2 PG2.1 and CC26x2 PG2.1
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
#include <stdint.h>
#include "rf_patch_mce_iqdump.h"
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
#ifndef MCE_PATCH_TYPE
#define MCE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC
#endif
#ifndef RFC_MCERAM_BASE
#define RFC_MCERAM_BASE 0x21008000
#endif
#ifndef MCE_PATCH_MODE
#define MCE_PATCH_MODE 0
#endif
MCE_PATCH_TYPE patchIqdumpMce[360] = {
0x2fcf6030,
0x00013f9d,
0xff00003f,
0x07ff0fff,
0x0300f800,
0x00068080,
0x00170003,
0x00003d1f,
0x08000000,
0x0000000f,
0x00000387,
0x00434074,
0x00828000,
0x06f00080,
0x091e0000,
0x00540510,
0x00000007,
0x00505014,
0xc02f0000,
0x017f0c30,
0x00000000,
0x00000000,
0x00000000,
0x0000aa00,
0x66c47223,
0xa4e5a35d,
0x73057303,
0x73047203,
0x72047306,
0x72917391,
0xffc0b008,
0xa0089010,
0x720e720d,
0x7210720f,
0x7100b0d0,
0xa0d0b110,
0x8162721b,
0x39521020,
0x0412c181,
0x00200670,
0x11011630,
0x6c011401,
0x60836082,
0x613a60ff,
0x60826082,
0x60826082,
0x60836082,
0x61de60ff,
0x60826082,
0x60826082,
0x60836082,
0x614a60ff,
0x60826082,
0x60826082,
0x60836082,
0x61fa60ff,
0x60826082,
0x60826082,
0x60836082,
0x618260ff,
0x72231210,
0x73127311,
0x81b17313,
0x91b00010,
0x6044b070,
0xc0306078,
0xc0c166ca,
0xc4e0c2b2,
0x6f131820,
0x16116e23,
0x68891612,
0x99c07830,
0x948078a0,
0xc4f29490,
0x1820c750,
0x1203409b,
0x16126e23,
0x78b06898,
0x72639990,
0x6078b63c,
0x96408190,
0x39808170,
0x10012a70,
0x84a21611,
0xc0f384b4,
0xc200c0f5,
0x40c41c01,
0x1c10c100,
0x4cbc40ba,
0x18031013,
0x1a131830,
0x39121a10,
0x60c468b7,
0x60c413f3,
0x101513f3,
0x1850c100,
0x1a101a15,
0x68c23914,
0x7100b0e8,
0xa0e8b128,
0xb910b230,
0x99308990,
0xb0d1b111,
0xb0027100,
0xb111b012,
0x7291a0d1,
0xb003b630,
0x722cb013,
0x7100b0e0,
0x8170b120,
0x710092c0,
0x8170b120,
0x44dd22f0,
0x1c0313f0,
0x92c340e9,
0x71009642,
0x92c5b120,
0x71009644,
0xb0e0b120,
0x7000a630,
0xc030a0e1,
0xc0409910,
0xb1119930,
0x7100b0d1,
0xa0d1b111,
0xa0037291,
0xa230a002,
0x73117000,
0x81607312,
0x451022a0,
0x66cac040,
0x91f0c100,
0xb63364a0,
0xb0d3b113,
0xa0d37100,
0x607864f0,
0x66cac050,
0x91f0c030,
0xb0e8b634,
0xb1287100,
0xb230a0e8,
0xb012b002,
0xb013b003,
0x92f01200,
0xb0e1b121,
0xb1217100,
0x06208210,
0x45221e20,
0x66cac060,
0xb1217100,
0x92f181d1,
0x00000000,
0x82120000,
0x1e220622,
0xc070412a,
0xa63466ca,
0x607864f0,
0xa0f0a0d2,
0x7311a0f3,
0x663e7312,
0x66cac080,
0xc035b0d2,
0x9b757100,
0xb074ba38,
0x6144b112,
0xa0f0a0d2,
0x7311a0f3,
0x663e7312,
0xc000c18b,
0x120c91e0,
0x786a1218,
0x788e787d,
0xb07410a9,
0xc020b0d2,
0x7100b112,
0xc090695c,
0xc03566ca,
0x7100b112,
0x8bf09b75,
0x8ca165d3,
0x416f2201,
0x1ca81080,
0x1208456e,
0x65ca1618,
0x65d38c00,
0x22018ca1,
0x1090417a,
0x1e091a19,
0x10a9457a,
0x818465ca,
0x41621e04,
0x1c4c14bc,
0x61624ead,
0xa0f0a0d2,
0x7311a0f3,
0x663e7312,
0x120c721e,
0xb0741205,
0xc020b0d2,
0x7100b112,
0xc0a0698e,
0x789d66ca,
0xb11289ce,
0x8c907100,
0x419e2200,
0x22108230,
0xb231459e,
0x8ab29a3d,
0x3d823182,
0x31808af0,
0x18023d80,
0x1e0e063e,
0x1e2e41c0,
0x1e3e41b2,
0x105641b9,
0x3d161426,
0x61c11065,
0x31261056,
0x14261856,
0x10653d26,
0x105661c1,
0x18563136,
0x3d361426,
0x61c11065,
0x39761026,
0x818491c6,
0x41951e04,
0x1c4c161c,
0x61954ead,
0xc0b01001,
0x391191c1,
0x10001000,
0x69cc1000,
0x31307000,
0x1cd03d30,
0x1ce04dda,
0x700049dc,
0x700010d0,
0x700010e0,
0x66cac0b0,
0xa0f0a0d2,
0x7311a0f3,
0x663e7312,
0xb0f0b130,
0x80b07100,
0x45ed2200,
0xb23161e8,
0x66cac0c0,
0xa0f0b130,
0xc035b0d2,
0x9b757100,
0xb074ba38,
0x61f4b112,
0x66cac0d0,
0xa0f0a0d2,
0x7311a0f3,
0x663e7312,
0xc000c18b,
0x120c91e0,
0x786a1218,
0x788e787d,
0xb13010a9,
0x7100b0f0,
0x220080b0,
0x620d4612,
0xb231b074,
0x66cac0e0,
0xa0f0b130,
0xc020b0d2,
0x7100b112,
0xc0356a1a,
0x7100b112,
0x8bf09b75,
0x8ca165d3,
0x422b2201,
0x1ca81080,
0x1208462a,
0x65ca1618,
0x65d38c00,
0x22018ca1,
0x10904236,
0x1e091a19,
0x10a94636,
0x818465ca,
0x421e1e04,
0x1c4c14bc,
0x621e4ead,
0x22308240,
0xb0d54646,
0xb1157100,
0x623ea0d5,
0x66cac0f0,
0xb006b118,
0xb004b016,
0xb002b014,
0x8440b012,
0x04207842,
0x39838173,
0x94e32a73,
0x1832c1f2,
0x10213162,
0x00123151,
0x94400020,
0x16101030,
0x22103930,
0x12204264,
0x10033150,
0x16303180,
0x12029380,
0x22731204,
0x84a04276,
0x89829970,
0x84c01a82,
0x89849970,
0x62781a84,
0x42832263,
0x997084b0,
0x1a808980,
0x84d01402,
0x89809970,
0x14041a80,
0x84b0628f,
0x04107851,
0x89829970,
0x84d01a42,
0x04107851,
0x89849970,
0x31521a44,
0x39633154,
0x16130633,
0x38343832,
0x39823182,
0x00423184,
0x84a09722,
0x84b09590,
0x84c095a0,
0x84d095b0,
0x781095c0,
0x90509030,
0x90407820,
0xb2359060,
0x9170cd90,
0xa2357000,
0x7100b112,
0xb112a0d2,
0x81b0ba3c,
0x39248b54,
0x00043184,
0xc10091b4,
0x739166ca,
0x66c47291,
0x72027206,
0x73057204,
0x60787306,
0xc8018630,
0x04103151,
0x70009630,
0x89f09a00,
0x46cb2200,
0x7000b9e0
};
PATCH_FUN_SPEC void rf_patch_mce_iqdump(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 360; i++) {
HWREG(RFC_MCERAM_BASE + 4 * i) = patchIqdumpMce[i];
}
#else
const uint32_t *pS = patchIqdumpMce;
volatile unsigned long *pD = &HWREG(RFC_MCERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 45;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
#endif
}

View File

@ -1,11 +1,9 @@
/******************************************************************************
* Filename: rf_patch_mce_iqdump.h
* Revised: $Date: 2019-01-31 15:04:25 +0100 (to, 31 jan 2019) $
* Revision: $Revision: 18842 $
*
* Description: RF core patch for IQ-dump support in CC13x2 PG2.1 and CC26x2 PG2.1
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -40,399 +38,9 @@
#define _RF_PATCH_MCE_IQDUMP_H
#include <stdint.h>
#include "../inc/hw_types.h"
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
#ifndef MCE_PATCH_TYPE
#define MCE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef RFC_MCERAM_BASE
#define RFC_MCERAM_BASE 0x21008000
#endif
#ifndef MCE_PATCH_MODE
#define MCE_PATCH_MODE 0
#endif
MCE_PATCH_TYPE patchIqdumpMce[337] = {
0x2fcf6030,
0x00013f9d,
0xff00003f,
0x07ff0fff,
0x0300f800,
0x00068080,
0x00170003,
0x00003d1f,
0x08000000,
0x0000000f,
0x00000387,
0x00434074,
0x00828000,
0x06f00080,
0x091e0000,
0x00540510,
0x00000007,
0x00505014,
0xc02f0000,
0x017f0c30,
0x00000000,
0x00000000,
0x00000000,
0x0000aa00,
0x66957223,
0xa4e5a35d,
0x73057303,
0x73047203,
0x72047306,
0x72917391,
0xffc0b008,
0xa0089010,
0x720e720d,
0x7210720f,
0x7100b0d0,
0xa0d0b110,
0x8162721b,
0x39521020,
0x00200670,
0x11011630,
0x6c011401,
0x60816080,
0x610b60fd,
0x60806080,
0x60806080,
0x60816080,
0x61af60fd,
0x60806080,
0x60806080,
0x60816080,
0x611b60fd,
0x60806080,
0x60806080,
0x60816080,
0x61cb60fd,
0x60806080,
0x60806080,
0x60816080,
0x615360fd,
0x72231210,
0x73127311,
0x81b17313,
0x91b00010,
0x6044b070,
0xc0306076,
0xc0c1669b,
0xc4e0c2b2,
0x6f131820,
0x16116e23,
0x68871612,
0x99c07830,
0x948078a0,
0xc4f29490,
0x1820c750,
0x12034099,
0x16126e23,
0x78b06896,
0x72639990,
0x6076b63c,
0x96408190,
0x39808170,
0x10012a70,
0x84a21611,
0xc0f384b4,
0xc200c0f5,
0x40c21c01,
0x1c10c100,
0x4cba40b8,
0x18031013,
0x1a131830,
0x39121a10,
0x60c268b5,
0x60c213f3,
0x101513f3,
0x1850c100,
0x1a101a15,
0x68c03914,
0x7100b0e8,
0xa0e8b128,
0xb910b230,
0x99308990,
0xb0d1b111,
0xb0027100,
0xb111b012,
0x7291a0d1,
0xb003b630,
0x722cb013,
0x7100b0e0,
0x8170b120,
0x710092c0,
0x8170b120,
0x44db22f0,
0x1c0313f0,
0x92c340e7,
0x71009642,
0x92c5b120,
0x71009644,
0xb0e0b120,
0x7000a630,
0xc030a0e1,
0xc0409910,
0xb1119930,
0x7100b0d1,
0xa0d1b111,
0xa0037291,
0xa230a002,
0x73117000,
0xc0407312,
0xc100669b,
0x649e91f0,
0xb113b633,
0x7100b0d3,
0x64eea0d3,
0xa0d26076,
0xa0f3a0f0,
0x73127311,
0xc050660f,
0xb0d2669b,
0x7100c035,
0xba389b75,
0xb112b074,
0xa0d26115,
0xa0f3a0f0,
0x73127311,
0xc18b660f,
0x91e0c000,
0x1218120c,
0x787d786a,
0x10a9788e,
0xb0d2b074,
0xb112c020,
0x692d7100,
0x669bc060,
0xb112c035,
0x9b757100,
0x65a48bf0,
0x22018ca1,
0x10804140,
0x453f1ca8,
0x16181208,
0x8c00659b,
0x8ca165a4,
0x414b2201,
0x1a191090,
0x454b1e09,
0x659b10a9,
0x1e048184,
0x14bc4133,
0x4e7e1c4c,
0xa0d26133,
0xa0f3a0f0,
0x73127311,
0x721e660f,
0x1205120c,
0xb0d2b074,
0xb112c020,
0x695f7100,
0x669bc070,
0x89ce789d,
0x7100b112,
0x22008c90,
0x8230416f,
0x456f2210,
0x9a3db231,
0x31828ab2,
0x8af03d82,
0x3d803180,
0x063e1802,
0x41911e0e,
0x41831e2e,
0x418a1e3e,
0x14261056,
0x10653d16,
0x10566192,
0x18563126,
0x3d261426,
0x61921065,
0x31361056,
0x14261856,
0x10653d36,
0x10266192,
0x91c63976,
0x1e048184,
0x161c4166,
0x4e7e1c4c,
0x10016166,
0x91c1c0b0,
0x10003911,
0x10001000,
0x7000699d,
0x3d303130,
0x4dab1cd0,
0x49ad1ce0,
0x10d07000,
0x10e07000,
0xc0807000,
0xa0d2669b,
0xa0f3a0f0,
0x73127311,
0xb130660f,
0x7100b0f0,
0x220080b0,
0x61b945be,
0xc090b231,
0xb130669b,
0xb0d2a0f0,
0x7100c035,
0xba389b75,
0xb112b074,
0xc0a061c5,
0xa0d2669b,
0xa0f3a0f0,
0x73127311,
0xc18b660f,
0x91e0c000,
0x1218120c,
0x787d786a,
0x10a9788e,
0xb0f0b130,
0x80b07100,
0x45e32200,
0xb07461de,
0xc0b0b231,
0xb130669b,
0xb0d2a0f0,
0xb112c020,
0x69eb7100,
0xb112c035,
0x9b757100,
0x65a48bf0,
0x22018ca1,
0x108041fc,
0x45fb1ca8,
0x16181208,
0x8c00659b,
0x8ca165a4,
0x42072201,
0x1a191090,
0x46071e09,
0x659b10a9,
0x1e048184,
0x14bc41ef,
0x4e7e1c4c,
0x824061ef,
0x46172230,
0x7100b0d5,
0xa0d5b115,
0xc0c0620f,
0xb118669b,
0xb016b006,
0xb014b004,
0xb012b002,
0x78428440,
0x81730420,
0x2a733983,
0xc1f294e3,
0x31621832,
0x31511021,
0x00200012,
0x10309440,
0x39301610,
0x42352210,
0x31501220,
0x31801003,
0x93801630,
0x12041202,
0x42472273,
0x997084a0,
0x1a828982,
0x997084c0,
0x1a848984,
0x22636249,
0x84b04254,
0x89809970,
0x14021a80,
0x997084d0,
0x1a808980,
0x62601404,
0x785184b0,
0x99700410,
0x1a428982,
0x785184d0,
0x99700410,
0x1a448984,
0x31543152,
0x06333963,
0x38321613,
0x31823834,
0x31843982,
0x97220042,
0x959084a0,
0x95a084b0,
0x95b084c0,
0x95c084d0,
0x90307810,
0x78209050,
0x90609040,
0xcd90b235,
0x70009170,
0xb112a235,
0xa0d27100,
0xba3cb112,
0x8b5481b0,
0x31843924,
0x91b40004,
0x669bc0d0,
0x72917391,
0x72066695,
0x72047202,
0x73067305,
0x86306076,
0x3151c801,
0x96300410,
0x9a007000,
0x220089f0,
0xb9e0469c,
0x00007000
};
PATCH_FUN_SPEC void rf_patch_mce_iqdump(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 337; i++) {
HWREG(RFC_MCERAM_BASE + 4 * i) = patchIqdumpMce[i];
}
#else
const uint32_t *pS = patchIqdumpMce;
volatile unsigned long *pD = &HWREG(RFC_MCERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 42;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
t1 = *pS++;
*pD++ = t1;
#endif
}
extern void rf_patch_mce_iqdump(void);
#endif

View File

@ -1,609 +0,0 @@
/******************************************************************************
* Filename: rf_patch_mce_tof.h
* Revised: $Date: 2019-01-31 15:04:59 +0100 (to, 31 jan 2019) $
* Revision: $Revision: 18843 $
*
* Description: RF core MCE patch for time of flight 2Mbps PHY for CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* 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 ORGANIZATION 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 _RF_PATCH_MCE_TOF_H
#define _RF_PATCH_MCE_TOF_H
#include <stdint.h>
#include "../inc/hw_types.h"
#ifndef MCE_PATCH_TYPE
#define MCE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef RFC_MCERAM_BASE
#define RFC_MCERAM_BASE 0x21008000
#endif
#ifndef MCE_PATCH_MODE
#define MCE_PATCH_MODE 0
#endif
MCE_PATCH_TYPE patchTofMce[506] = {
0x0003605b,
0x00f1000f,
0x00000000,
0x000c8000,
0x00000000,
0x0c650000,
0x80000000,
0x00800010,
0x00000000,
0x0594091e,
0x00000350,
0x7c200000,
0x000000c2,
0x34340013,
0x0003005a,
0x00000032,
0xfe6b2840,
0xdeade8ca,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x07d00011,
0x6fdd2fea,
0x0fb00ff0,
0xf80f0003,
0x007f7f30,
0x3434001f,
0x8010005a,
0x01900000,
0x40000800,
0xc0300c65,
0x722367ee,
0xa35d7263,
0x73057303,
0x73047203,
0x72047306,
0x72917391,
0x8001c7c0,
0x90010001,
0x08019010,
0x720d9001,
0x720f720e,
0xb0d07210,
0xc0407100,
0xa0d067ee,
0x721bb110,
0x10208162,
0x06703952,
0x16300020,
0x14011101,
0x60936c01,
0x60c260a4,
0x6219617b,
0x60936093,
0x60936093,
0x60c260a4,
0x6219617b,
0x60936093,
0x60976093,
0x12206095,
0xc050609a,
0x121267ee,
0x73117223,
0x73137312,
0x81b17314,
0x91b20012,
0x6073b070,
0xc2b2c011,
0x1820c710,
0x6e236f13,
0x16121611,
0x7d7068a8,
0xc0229990,
0x39818161,
0xd0601812,
0x67ee9a12,
0x40971e01,
0x99907d80,
0x93807d50,
0x93307d60,
0x93007d90,
0x6097b360,
0xc07067e5,
0x677e67ee,
0x91f0c070,
0x670bb750,
0xb233b914,
0xa750672d,
0x95b488d4,
0x95c488e4,
0x95948ca4,
0x95a487c4,
0x2a007cb0,
0x88d49060,
0x88e495d4,
0xc0f495e4,
0x91449134,
0x22008c80,
0xb0f040e5,
0xb0f6b130,
0xb0d5b0d0,
0xb110b136,
0xb140b100,
0x73137314,
0x2a007cb0,
0xc0f19060,
0x40f51e0e,
0x99311611,
0xc037b912,
0xb115b041,
0xa910c031,
0xb0737100,
0xba3eb910,
0x22008090,
0x80b24574,
0x45182262,
0x220280c2,
0xb061410b,
0x2250b140,
0x824040f9,
0x45152200,
0x40f9220f,
0x679e100f,
0x100f60f9,
0x60f967b4,
0xb234a913,
0x93acba39,
0xa0d58462,
0xb0d1720f,
0x7100b111,
0xb1119937,
0xb35d7100,
0x9930c3f0,
0xc0d0b074,
0x894193f0,
0x67bf9791,
0x14018941,
0x7100b111,
0xba3aba3b,
0xc210b078,
0xa2329930,
0xb111b235,
0xa35d7100,
0x7291b06e,
0x8af2a0d1,
0x3d823182,
0x67eec080,
0x8c528c33,
0x8c441423,
0x14248c62,
0x06f28b32,
0x31418b21,
0x97a20012,
0x0424cff2,
0x31433143,
0x97b40034,
0x6957c8f0,
0xb130b235,
0xb136a0f0,
0xb140a0f6,
0xb914a100,
0xa7507291,
0xa002a003,
0x9010c7c0,
0x72047203,
0x73067305,
0xa23267e5,
0x8242b235,
0x456b1e02,
0xc0907223,
0x609767ee,
0xa232b235,
0xd0a08942,
0x67ee9a12,
0x67e56159,
0x677ec00f,
0x91f0c070,
0xc0b0670b,
0xb01367ee,
0x22008c80,
0xb0f04189,
0xb0f6b130,
0xb0d5b0d0,
0xb136b111,
0x72917313,
0xc0e1b912,
0x41951e0e,
0x99311611,
0xb041c037,
0xc031b232,
0xb115a910,
0xb0737100,
0xba3eb910,
0x22008090,
0x80b24614,
0x45b32262,
0x41992250,
0x22008240,
0x220f45b0,
0x100f4199,
0x6199679e,
0x67b4100f,
0xb9136199,
0xba39b234,
0xa0d593ac,
0x7313720f,
0x73147210,
0x264081b0,
0xb0d191b0,
0x7100b111,
0x9937b041,
0x7100b111,
0xc3f0b35d,
0xb0749930,
0x93f0c0d0,
0x7100b111,
0xc210b078,
0xa2329930,
0x7100b111,
0xb06ea35d,
0xa0d1a910,
0x899167bf,
0x81a01401,
0x99311401,
0xb0d6b116,
0xb1167100,
0x8090a0d6,
0x46142200,
0x88d4b012,
0x88e495b4,
0x8ca495c4,
0x87c49594,
0x729195a4,
0x2a208230,
0x92302630,
0xc070672d,
0x8af287b1,
0x3d823182,
0x69fbc310,
0xb111b064,
0xa0f6b136,
0xa0f0b130,
0x8242b235,
0x46021e02,
0x7291b914,
0xa002a003,
0x9010c7c0,
0x72047203,
0x73067305,
0x67eec0c0,
0x609767e5,
0x67eec0d0,
0x7291b235,
0x677e6202,
0xc070c00b,
0x670b91f0,
0x67eec0e0,
0x727ab914,
0xb0137226,
0x73147313,
0x8c8072c9,
0x422d2200,
0xb130b0f0,
0x85b06231,
0x95d085c1,
0xb10095e1,
0xb110b140,
0xb0f6b064,
0xb0d5b0d0,
0x7313b136,
0xb041b061,
0x42411e1b,
0xb9127291,
0xc13772c9,
0x1e0ec070,
0x16104247,
0x9930c0b7,
0xb115b232,
0xa910c031,
0xb0737100,
0xba3eb910,
0x22008090,
0x80b24705,
0x46682262,
0x220280c2,
0xb061425b,
0x2250b140,
0x82404249,
0x46652200,
0x4249220f,
0x679e100f,
0x100f6249,
0x624967b4,
0x1e1bb234,
0xa9154285,
0xb913b916,
0x8b33ba3b,
0x8b2406f3,
0x00433144,
0x8c3397a3,
0x14038c50,
0x8c448c60,
0x31431404,
0x00343143,
0x81b097b4,
0x91b02650,
0x67eec0f0,
0xa91362bf,
0x264081b0,
0x993791b0,
0x93acba39,
0x720fa0d5,
0xb111b0d1,
0x7100b111,
0xc3e0b35d,
0xb0749930,
0x93f0c0d0,
0x97918941,
0xb11167bf,
0xb0787100,
0x9930c210,
0xb235a232,
0x7100b111,
0xb06ea35d,
0xa0d17291,
0x31828af2,
0xba3b3d82,
0x06f38b33,
0x31448b24,
0x92630043,
0x8c508c33,
0x8c601403,
0x14048c44,
0x31433143,
0x97b40034,
0x6abdc8f0,
0xbc9062e3,
0x95b488d4,
0x95c488e4,
0x95948ca4,
0x95a487c4,
0x85b0c01b,
0x95d085c1,
0x731195e1,
0x73137312,
0xb1007314,
0xb0f6b140,
0xb110b136,
0xa232b064,
0x22628242,
0x722342d7,
0xb115b064,
0xc410b232,
0x679e6ae0,
0xb2356249,
0xa100b140,
0xa0f6b136,
0x7291b914,
0xa003a750,
0xc7c0a002,
0x72039010,
0x73057204,
0x73117306,
0x73137312,
0x720f7314,
0x7210720d,
0x7223720e,
0xb235a232,
0x1e028242,
0x722346fc,
0x67eec100,
0xc1106097,
0xb23567ee,
0x8942a232,
0x824262e4,
0x430b2212,
0xb016b006,
0xb002b012,
0xb014b004,
0x90307ca0,
0x7cb09050,
0x90609040,
0x73127311,
0x73147313,
0x720e720d,
0x7210720f,
0xb0e1b121,
0xb0727100,
0xd680a0e1,
0x679e6b28,
0x93f0c090,
0xbc907000,
0x9930c040,
0xb910b911,
0xb111b0d1,
0x72917100,
0xb111a0d1,
0x9635722c,
0xc0f38c82,
0xb013b003,
0x92c08170,
0x96408190,
0xb120b0e0,
0x22027100,
0x85b04750,
0x92c39640,
0x7100b120,
0x964085c0,
0x7100b120,
0x96408590,
0xb12092c3,
0x85a07100,
0xb1209640,
0x8cb07100,
0x0410cff1,
0xb1209640,
0x96367100,
0x9930c040,
0xb910b911,
0xb111b0d1,
0xb120a0e0,
0x72917100,
0xb111a0d1,
0x1e108750,
0xb2354371,
0xa9156378,
0xb913b916,
0x2a308230,
0x92302620,
0x6b79c090,
0xc120ac90,
0x700067ee,
0x721b7223,
0x92c0c0f0,
0xc1f1722f,
0xc01592d1,
0x7c977c86,
0x8c807ccc,
0x43912200,
0x94407cf0,
0x94607d10,
0x7d206393,
0xac909440,
0xc1009636,
0x816e91e0,
0xc01d398e,
0x439d1e0e,
0x7000c03d,
0x726a7269,
0xb0537ce2,
0xc76093a2,
0x73a36ba4,
0x96908a40,
0x96a18a51,
0x7cd093a6,
0x8a4393a0,
0x31338a54,
0x31343d33,
0x70003d34,
0x8a439a31,
0x31338a54,
0x31343d63,
0x96933d64,
0xb05396a4,
0x1e0e7000,
0x8c3143d6,
0x18108c40,
0xc0024fd0,
0x161110d1,
0x16201812,
0x1c203d20,
0x10204fe4,
0x63e41610,
0x3d201620,
0x4be41cd0,
0x63e410d0,
0xc082c000,
0x8c448c33,
0x1c241834,
0x14424fe0,
0x63e44be2,
0x63e410d0,
0x18d0c000,
0x720d7000,
0x720f720e,
0x73117210,
0x73137312,
0x70007314,
0x89f09a00,
0x47ef2200,
0x7000b9e0
};
PATCH_FUN_SPEC void rf_patch_mce_tof(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 506; i++) {
HWREG(RFC_MCERAM_BASE + 4 * i) = patchTofMce[i];
}
#else
const uint32_t *pS = patchTofMce;
volatile unsigned long *pD = &HWREG(RFC_MCERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 63;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
t1 = *pS++;
t2 = *pS++;
*pD++ = t1;
*pD++ = t2;
#endif
}
#endif

View File

@ -0,0 +1,492 @@
/******************************************************************************
* Filename: rf_patch_rfe_genook.h
*
* Description: RF core patch for General OOK support in CC13x2 and CC26x2.
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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.
*
******************************************************************************/
#include <stdint.h>
#include "rf_patch_rfe_genook.h"
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
#ifndef RFE_PATCH_TYPE
#define RFE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC
#endif
#ifndef RFC_RFERAM_BASE
#define RFC_RFERAM_BASE 0x2100C000
#endif
#ifndef RFE_PATCH_MODE
#define RFE_PATCH_MODE 0
#endif
RFE_PATCH_TYPE patchGenookRfe[383] = {
0x00006122,
0x11011000,
0x004d1203,
0x002e24f1,
0x0a940018,
0x003ffffe,
0x00ff007f,
0x000003ff,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x40300000,
0x40014000,
0x40074003,
0x404f400f,
0x41cf40cf,
0x47cf43cf,
0x3fcf4fcf,
0x1fcf2fcf,
0x00000fcf,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x9100c050,
0xc0707000,
0x70009100,
0x00213182,
0xb1109131,
0x81017000,
0xa100b101,
0x91323182,
0x9101b110,
0x81411011,
0x406d2241,
0x700006f1,
0xc0501025,
0xc3f49100,
0x1420c2b0,
0x10316f03,
0xc0220441,
0x00213182,
0xb1109131,
0x10313963,
0xc0820441,
0x00213182,
0xb1109131,
0x10313963,
0x3182c0a2,
0x91310021,
0x1050b110,
0x14053115,
0x70009255,
0xc2b2645d,
0x06311031,
0x02c13161,
0xc1126460,
0x39211031,
0x31510671,
0x646002e1,
0x645d7000,
0x7100b054,
0xb064a054,
0x220080f0,
0xc11140a4,
0x6460c122,
0x82b1645a,
0x39813181,
0x6460c0e2,
0x68b5c300,
0x1240645d,
0xb03290b0,
0x395382a3,
0x64943953,
0x68bfc360,
0x90b01280,
0x7000b032,
0xc101645d,
0x6460c122,
0xc0c2c101,
0x82a36460,
0x12c06494,
0xb03290b0,
0x645d7000,
0xc081c272,
0xc1226460,
0x6460c111,
0xc111c002,
0xc0626460,
0x6460c331,
0xc111c362,
0xc3026460,
0x6460c111,
0x395382a3,
0xc3e26494,
0x22116465,
0xc24240e7,
0x6460c881,
0xc111c252,
0xc2726460,
0x6460cee1,
0xc881c202,
0xc2026460,
0x6460c801,
0x68fbc170,
0x645d7000,
0xc801c242,
0xc2526460,
0x6460c011,
0xc0e1c272,
0xc0026460,
0x6460c101,
0xc301c062,
0xc1226460,
0x6460c101,
0xc101c362,
0xc3026460,
0x6460c101,
0x649482a3,
0x00007000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x72057306,
0x720e720b,
0x7100b050,
0xb0608081,
0x8092a050,
0x224180a2,
0x80804543,
0x0410c1f1,
0x11011630,
0x6c011401,
0x615e615e,
0x615e615e,
0x615e615e,
0x615e615e,
0x615e615e,
0x615e615e,
0x809162d5,
0x0421c0f2,
0x80823121,
0x14122a42,
0x11011632,
0x6c011421,
0x617b616e,
0x62d5616e,
0x615e615f,
0x615e615e,
0x617b616e,
0x62d5616e,
0x615e615f,
0x615e615e,
0x64d16163,
0x64fd657b,
0x12106163,
0x616690b0,
0x9050c010,
0x906078a0,
0x1210720e,
0x61269030,
0x91a07850,
0x92607860,
0x92707870,
0x92807880,
0x92907890,
0x90a0c1a0,
0xa0bc6163,
0xb060a0e1,
0x80f0a054,
0x45862250,
0x22008040,
0x617d46a2,
0x66f7cff0,
0x393080f0,
0x22100630,
0x7841418f,
0x22006194,
0x78314193,
0x78216194,
0x827d91e1,
0x39408280,
0x0410c0f1,
0xc0121007,
0x82693072,
0x0419c0f1,
0xc0f1826a,
0x041a394a,
0xc0f1826e,
0x041e398e,
0x10bc10ab,
0x647210c2,
0x78e7c00f,
0xb003b013,
0xb0536646,
0xb013b050,
0xc082661c,
0x662d6682,
0xb0637100,
0x22018041,
0x80f046a2,
0x41b82250,
0x45b82210,
0x46c022f0,
0x6682c082,
0x392010f0,
0x82239210,
0x1030664c,
0x4dd618d3,
0x16130bf3,
0x49ea1ce3,
0x82339213,
0x61db143b,
0x49ea1ce3,
0x82339213,
0x1cab183b,
0x1c9b4e29,
0x1cbc4a2b,
0x10b241ea,
0x22d08260,
0x80f041e8,
0x45ea2210,
0x65eb6472,
0x10c061b8,
0x49fd18b0,
0x39101003,
0x41f41e00,
0x3807380f,
0x420d2203,
0x392010f0,
0x1070180f,
0x18073920,
0x1003620d,
0x1801c001,
0x1e013911,
0x301f4205,
0x22033017,
0x10f0420d,
0x140f3920,
0x39201070,
0x66991407,
0x06f08280,
0x80f13110,
0x06313931,
0x42171e01,
0xb0633810,
0x6a177100,
0x700010bc,
0x06f08280,
0x80f13110,
0x06313931,
0x42251e01,
0xb0633810,
0x6a257100,
0x10ab7000,
0x109b61df,
0x10f261df,
0x92123922,
0x82518222,
0x81a11812,
0x82911812,
0x3d813181,
0x4a3e1c12,
0xb032b0e1,
0x66f7cfe0,
0x1421c7f1,
0xc8124e42,
0x91c291b2,
0x7000b031,
0xc0061208,
0x91b0c800,
0x700091c0,
0x10308251,
0x81a11810,
0x14061810,
0x829280e1,
0x3d823182,
0x4a5e1c20,
0x46682211,
0xb032b0e1,
0x66f7cfd0,
0x42682211,
0x1c201a32,
0xa0e14e68,
0xdfc0b032,
0x66f79342,
0x39418281,
0x1e0106f1,
0x16184273,
0x3010c010,
0x46811c08,
0xc7f13c16,
0x4e771461,
0x91b6c816,
0x318181c1,
0x1c163d81,
0x91c64a7e,
0xc006b031,
0x70001208,
0x31238203,
0x187110f1,
0x10153c21,
0x4e8b1c37,
0x1037628d,
0x1417628e,
0x4a911c3f,
0x103f6293,
0x1e016299,
0x12114696,
0x42991e0f,
0x10f1181f,
0x39311471,
0x063080e0,
0x14103121,
0x700090e0,
0x81b28251,
0x3d823182,
0x9341efb0,
0x66f79352,
0x64fda003,
0x81b16163,
0x3d813181,
0x39808290,
0x1cf11801,
0x14014abf,
0x22c080b0,
0xb0bc46bf,
0xefa0b033,
0x935f9341,
0x700066f7,
0xb063a003,
0xb054b064,
0x64fdb0e0,
0x80407100,
0x46a22200,
0x64d1b064,
0x7100a0e0,
0x22008040,
0xb06446a2,
0xb003a054,
0xcf9061b8,
0x64a366f7,
0xb054b0e1,
0xb064645d,
0x80f07100,
0x46f22240,
0x42e32210,
0xc20162ee,
0x6460c0c2,
0x318080a0,
0x6ae93940,
0xc0c2c101,
0x62db6460,
0xc0c2c331,
0x62db6460,
0xcf80a054,
0x64c466f7,
0x93306163,
0x22008320,
0xb31046f8,
0x00007000
};
PATCH_FUN_SPEC void rf_patch_rfe_genook(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 383; i++) {
HWREG(RFC_RFERAM_BASE + 4 * i) = patchGenookRfe[i];
}
#else
const uint32_t *pS = patchGenookRfe;
volatile unsigned long *pD = &HWREG(RFC_RFERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 47;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
#endif
}

View File

@ -0,0 +1,47 @@
/******************************************************************************
* Filename: rf_patch_rfe_genook.h
*
* Description: RF core patch for General OOK support in CC13x2 and CC26x2.
*
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* 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 ORGANIZATION 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 _RF_PATCH_RFE_GENOOK_H
#define _RF_PATCH_RFE_GENOOK_H
#include <stdint.h>
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(inc/hw_types.h)
extern void rf_patch_rfe_genook(void);
#endif

View File

@ -1,571 +0,0 @@
/******************************************************************************
* Filename: rf_patch_rfe_tof.h
* Revised: $Date: 2019-01-31 15:04:59 +0100 (to, 31 jan 2019) $
* Revision: $Revision: 18843 $
*
* Description: RF core RFE patch for time of flight 2Mbps PHY for CC13x2 and CC26x2
*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* 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 ORGANIZATION 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 _RF_PATCH_RFE_TOF_H
#define _RF_PATCH_RFE_TOF_H
#include <stdint.h>
#include "../inc/hw_types.h"
#ifndef RFE_PATCH_TYPE
#define RFE_PATCH_TYPE static const uint32_t
#endif
#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static inline
#endif
#ifndef RFC_RFERAM_BASE
#define RFC_RFERAM_BASE 0x2100C000
#endif
#ifndef RFE_PATCH_MODE
#define RFE_PATCH_MODE 0
#endif
RFE_PATCH_TYPE patchTofRfe[461] = {
0x00006194,
0x004535aa,
0x0421a355,
0x1f40004c,
0x0000003f,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x40004030,
0x40034001,
0x400f4007,
0x40cf404f,
0x43cf41cf,
0x4fcf47cf,
0x2fcf3fcf,
0x0fcf1fcf,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x40004030,
0x40034001,
0x400f4007,
0x40cf404f,
0x6fcf7fcf,
0x4fcf5fcf,
0x2fcf3fcf,
0x0fcf1fcf,
0x00000000,
0x00000000,
0x9100c050,
0xc0707000,
0x70009100,
0x00213182,
0xb1109131,
0x81017000,
0xa100b101,
0x91323182,
0x9101b110,
0x81411011,
0x40772241,
0x700006f1,
0x9150c050,
0xc0707000,
0x70009150,
0x00213182,
0xb1609181,
0x10257000,
0x9100c050,
0xc140c3f4,
0x6f031420,
0x04411031,
0x22f082a0,
0x26514094,
0x3182c022,
0x91310021,
0x3963b110,
0x04411031,
0x3182c082,
0x91310021,
0x3963b110,
0xc0a21031,
0x00213182,
0xb1109131,
0x31151050,
0x92551405,
0x64677000,
0x1031c2b2,
0x31610631,
0x646a02c1,
0x1031c112,
0x06713921,
0x02e13151,
0x7000646a,
0x82b16464,
0x39813181,
0x646ac0e2,
0xc1116467,
0x646ac122,
0x68c7c470,
0xc0c2c111,
0x64e0646a,
0x700064f3,
0x82b1647c,
0x39813181,
0x6482c182,
0xc111647f,
0x6482c0a2,
0x68d9c470,
0xc162c331,
0x64e06482,
0x700064f3,
0xb054b050,
0x80407100,
0x44ed2240,
0x40e02200,
0x8081b060,
0x44e01e11,
0xa0547000,
0x80f0b064,
0x40e02200,
0x12407000,
0xb03290b0,
0x395382a3,
0x64ad3953,
0x68fbc2f0,
0xc1f18080,
0xc1510410,
0x41071c10,
0xc2216467,
0x646ac0c2,
0x647f610b,
0xc162c441,
0xce306482,
0x1280690c,
0xb03290b0,
0x64677000,
0xc0c2c201,
0x80a0646a,
0x39403180,
0xc1016918,
0x646ac0c2,
0xc122c101,
0x82a3646a,
0x12c064ad,
0xb03290b0,
0x647f7000,
0xc162c401,
0x80a06482,
0x39403180,
0xc301692c,
0x6482c162,
0xc0a2c101,
0x82a36482,
0x12c064ad,
0xb03290b0,
0x64677000,
0xc081c272,
0xc122646a,
0x646ac111,
0xc111c002,
0xc062646a,
0x646ac331,
0xc111c362,
0xc302646a,
0x646ac111,
0x395382a3,
0xc3e264ad,
0x2211646f,
0xc242414f,
0x646ac881,
0xc111c252,
0xc272646a,
0x646acee1,
0xc881c202,
0xc202646a,
0x646ac801,
0x6963c170,
0x64677000,
0xc801c242,
0xc252646a,
0x646ac011,
0xc0e1c272,
0xc002646a,
0x646ac101,
0xc301c062,
0xc122646a,
0x646ac101,
0xc101c362,
0xc302646a,
0x646ac101,
0x64ad82a3,
0x80817000,
0x418f1e11,
0xb054b050,
0x80407100,
0x41902240,
0xb064a054,
0x220180f1,
0x70004584,
0x41842200,
0x6181b060,
0x72057306,
0x720e720b,
0x7100b050,
0xa050b060,
0x80928081,
0x45b32241,
0xc1f18080,
0x16300410,
0x14011101,
0x61c66c01,
0x61c661c6,
0x61c661c6,
0x61e661c6,
0x61e661c6,
0x61c661c6,
0x809161c6,
0x0421c0f2,
0x80823121,
0x14122a42,
0x11011632,
0x6c011421,
0x61c661cf,
0x61c661cf,
0x61c661c6,
0x61c661c6,
0x61c861c8,
0x61cbb0b0,
0x7306b0b1,
0xb0307205,
0x78206198,
0x78427831,
0x78547873,
0x78667885,
0x92719260,
0x92939282,
0x92b592a4,
0xc01f91a6,
0x3940924f,
0x100106f0,
0x14103110,
0x61c89250,
0xcff0b060,
0x66306793,
0xb0e16624,
0xb054b050,
0x8262b064,
0x39823182,
0x64873942,
0x7100b0e1,
0x22008040,
0xb0644621,
0x225280f2,
0x22224611,
0x22324608,
0x1e02460f,
0xdfe041f5,
0x67939342,
0x61f56511,
0x663f663a,
0x80f0b064,
0x46112250,
0x663561f5,
0xcfd061f5,
0xa0546793,
0xa050b064,
0xa052b060,
0xa053b062,
0x6565b063,
0xcfc06511,
0x720e6793,
0xcfb061c8,
0x62116793,
0x82b16464,
0x39813181,
0x646ac0e2,
0xc1116467,
0x646ac122,
0x700064f3,
0x70006539,
0x70006511,
0x64676565,
0xc0c2c111,
0x7000646a,
0xc1016467,
0x646ac0c2,
0xc8007000,
0x81a991b0,
0x8091b050,
0x46b02241,
0x31828262,
0x39423982,
0x82626487,
0x102f06f2,
0x142f311f,
0x22d68266,
0xc1404655,
0xc5006256,
0x6f0d1420,
0x10de396d,
0x044ec3f4,
0x3182c082,
0x396d002e,
0x3182c0a2,
0x826a002d,
0x06fa398a,
0x31808270,
0xc00b3980,
0x10bc180b,
0x825318ac,
0x149b1439,
0x06f08260,
0x31101001,
0x81a11410,
0x140c1410,
0x46ea22c6,
0x39408280,
0x100206f0,
0x3001c011,
0x1801c010,
0x31821802,
0x26c10021,
0xb00391e1,
0xb063b013,
0x8041b053,
0x46e12201,
0x92148204,
0x1cb58225,
0x18954e99,
0x80f091b5,
0x428b2240,
0x913d62ae,
0x913eb110,
0x80e0b110,
0x46a32200,
0x42a322e6,
0x1895b0e0,
0x925f91b5,
0x14f981a9,
0x225080f0,
0x224046e1,
0x637646ae,
0x6793cfa0,
0xa052b063,
0xc0f28280,
0x10020420,
0x3001c011,
0x1801c010,
0x31821802,
0x26c10021,
0x720e91e1,
0xb01391e1,
0xb063b003,
0xb064b053,
0x7100b054,
0x22018041,
0xb06346e1,
0x80f0b064,
0x42e12220,
0x92118201,
0x18918221,
0xb03191b1,
0x674e62c7,
0x81a9a0e0,
0x14598255,
0x7100c080,
0x6addb063,
0xb0e6628b,
0xa053a052,
0x81b28251,
0x3d823182,
0x7000a003,
0x39478287,
0x82803987,
0x06f03980,
0xc0111002,
0xc0103001,
0x18021801,
0x00213182,
0x91d126c1,
0xb012b002,
0x39408280,
0x100206f0,
0x3001c011,
0x1801c010,
0x31821802,
0x26c10021,
0xb00391e1,
0xb063b013,
0x7100b053,
0xb062a053,
0x8041b052,
0x46e12201,
0x921481f4,
0x82048225,
0x4f201cb5,
0x91b51895,
0x224080f0,
0x62ae4311,
0x92148204,
0x10408224,
0x91b01890,
0x1c751845,
0x80f04f2d,
0x43112240,
0x913d62ae,
0x913eb110,
0x80e0b110,
0x47372200,
0x433722e6,
0x91b5b0e0,
0x81a9925f,
0x80f014f9,
0x463f2250,
0x46ae2240,
0x674e6355,
0x81a9a0e0,
0x14598255,
0x7100c140,
0x6b47b062,
0x80a26311,
0x61c86487,
0x39428262,
0x608706f2,
0x7100b050,
0x829061c8,
0x22018041,
0x81f446e1,
0x82259214,
0x91b51895,
0x224180f1,
0x6b5646ae,
0x318181b1,
0xdf903d81,
0x67939341,
0x22018041,
0x81f446e1,
0x82259214,
0x4b411cc5,
0x91b51895,
0x224080f0,
0x62ae4362,
0x6793cf80,
0x80418290,
0x46e12201,
0x92148204,
0x18958225,
0x80f191b5,
0x46ae2241,
0x80416b79,
0x46e12201,
0x92148204,
0x1cc58225,
0x18954ad7,
0x80f091b5,
0x43852240,
0x933062ae,
0x22008320,
0xb3104794,
0x00007000
};
PATCH_FUN_SPEC void rf_patch_rfe_tof(void)
{
#ifdef __PATCH_NO_UNROLLING
uint32_t i;
for (i = 0; i < 461; i++) {
HWREG(RFC_RFERAM_BASE + 4 * i) = patchTofRfe[i];
}
#else
const uint32_t *pS = patchTofRfe;
volatile unsigned long *pD = &HWREG(RFC_RFERAM_BASE);
uint32_t t1, t2, t3, t4, t5, t6, t7, t8;
uint32_t nIterations = 57;
do {
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
t6 = *pS++;
t7 = *pS++;
t8 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
*pD++ = t6;
*pD++ = t7;
*pD++ = t8;
} while (--nIterations);
t1 = *pS++;
t2 = *pS++;
t3 = *pS++;
t4 = *pS++;
t5 = *pS++;
*pD++ = t1;
*pD++ = t2;
*pD++ = t3;
*pD++ = t4;
*pD++ = t5;
#endif
}
#endif

View File

@ -186,7 +186,7 @@
//#####################################
#ifndef SET_CCFG_MODE_CONF_SCLK_LF_OPTION
// #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x0 // LF clock derived from High Frequency XOSC
// #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x0 // LF clock derived from HF clock. Note: using this configuration will block the device from entering Standby mode.
// #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x1 // External LF clock
#define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x2 // LF XOSC
// #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x3 // LF RCOSC
@ -213,9 +213,10 @@
// Special HF clock source setting
//#####################################
#ifndef SET_CCFG_MODE_CONF_XOSC_FREQ
// #define SET_CCFG_MODE_CONF_XOSC_FREQ 0x1 // Use HPOSC as HF source (if executing on a HPOSC chip, otherwise using default (=0x3))
#define SET_CCFG_MODE_CONF_XOSC_FREQ 0x2 // HF source is a 48 MHz xtal (default on x2/x4 chips)
// #define SET_CCFG_MODE_CONF_XOSC_FREQ 0x3 // HF source is a 24 MHz xtal (default on x0 chips)
// #define SET_CCFG_MODE_CONF_XOSC_FREQ 0x0 // HF source is 48 MHz TCXO
// #define SET_CCFG_MODE_CONF_XOSC_FREQ 0x1 // HF source is HPOSC (BAW) (only valid for CC2652RB)
#define SET_CCFG_MODE_CONF_XOSC_FREQ 0x2 // HF source is a 48 MHz xtal
// #define SET_CCFG_MODE_CONF_XOSC_FREQ 0x3 // HF source is a 24 MHz xtal (not supported)
#endif
//#####################################
@ -353,11 +354,19 @@
#endif
//#####################################
// Select TCXO
// TCXO settings
//#####################################
#ifndef SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO
#define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO 0x1 // Disable TCXO
// #define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO 0x0 // Enable TXCO
#define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_TCXO 0x1 // Deprecated. Must be set to 0x1.
#endif
#ifndef SET_CCFG_MODE_CONF_1_TCXO_TYPE
#define SET_CCFG_MODE_CONF_1_TCXO_TYPE 0x1 // 1 = Clipped-sine type.
//#define SET_CCFG_MODE_CONF_1_TCXO_TYPE 0x0 // 0 = CMOS type.
#endif
#ifndef SET_CCFG_MODE_CONF_1_TCXO_MAX_START
#define SET_CCFG_MODE_CONF_1_TCXO_MAX_START 0x7F // Maximum TCXO startup time in units of 100us.
#endif
//*****************************************************************************
@ -406,6 +415,8 @@
((((uint32_t)( SET_CCFG_EXT_LF_CLK_RTC_INCREMENT )) << CCFG_EXT_LF_CLK_RTC_INCREMENT_S ) | ~CCFG_EXT_LF_CLK_RTC_INCREMENT_M ) )
#define DEFAULT_CCFG_MODE_CONF_1 ( \
((((uint32_t)( SET_CCFG_MODE_CONF_1_TCXO_TYPE )) << CCFG_MODE_CONF_1_TCXO_TYPE_S ) | ~CCFG_MODE_CONF_1_TCXO_TYPE_M ) & \
((((uint32_t)( SET_CCFG_MODE_CONF_1_TCXO_MAX_START )) << CCFG_MODE_CONF_1_TCXO_MAX_START_S ) | ~CCFG_MODE_CONF_1_TCXO_MAX_START_M ) & \
((((uint32_t)( SET_CCFG_MODE_CONF_1_ALT_DCDC_VMIN )) << CCFG_MODE_CONF_1_ALT_DCDC_VMIN_S ) | ~CCFG_MODE_CONF_1_ALT_DCDC_VMIN_M ) & \
((((uint32_t)( SET_CCFG_MODE_CONF_1_ALT_DCDC_DITHER_EN )) << CCFG_MODE_CONF_1_ALT_DCDC_DITHER_EN_S ) | ~CCFG_MODE_CONF_1_ALT_DCDC_DITHER_EN_M ) & \
((((uint32_t)( SET_CCFG_MODE_CONF_1_ALT_DCDC_IPEAK )) << CCFG_MODE_CONF_1_ALT_DCDC_IPEAK_S ) | ~CCFG_MODE_CONF_1_ALT_DCDC_IPEAK_M ) & \

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
* * Neither the name of Texas Instruments Incorporated 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 OWNER 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.
*/
/*
* ======== Temperature.c ========
*
*/
#include <stdlib.h>
#include <string.h>
#include <ti/drivers/Temperature.h>
/*
* ======== Temperature_getThresholdHigh ========
*/
int16_t Temperature_getThresholdHigh(Temperature_NotifyObj *notifyObject) {
return notifyObject->thresholdHigh;
}
/*
* ======== Temperature_getThresholdLow ========
*/
int16_t Temperature_getThresholdLow(Temperature_NotifyObj *notifyObject) {
return notifyObject->thresholdLow;
}
/*
* ======== Temperature_getThresholdRange ========
*/
void Temperature_getThresholdRange(Temperature_NotifyObj *notifyObject,
int16_t *thresholdHigh,
int16_t *thresholdLow) {
*thresholdHigh = notifyObject->thresholdHigh;
*thresholdLow = notifyObject->thresholdLow;
}
/*
* ======== Temperature_getClientArg ========
*/
uintptr_t Temperature_getClientArg(Temperature_NotifyObj *notifyObject) {
return notifyObject->clientArg;
}
/*
* ======== Temperature_getNotifyFxn ========
*/
Temperature_NotifyFxn Temperature_getNotifyFxn(Temperature_NotifyObj *notifyObject) {
return notifyObject->notifyFxn;
}

View File

@ -0,0 +1,550 @@
/*
* Copyright (c) 2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
* * Neither the name of Texas Instruments Incorporated 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 OWNER 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.
*/
/*!****************************************************************************
* @file Temperature.h
*
* @brief Temperature driver
*
* @anchor ti_drivers_Temperature_Overview
* # Overview #
* The Temperature driver provides services related to measuring and reacting
* to the current temperature of the chip and changes to it.
*
* The two main services provided are:
* - Getting the current temperature
* - Providing notification callbacks when the temperature changes
*
* @anchor ti_drivers_Temperature_Usage
* # Usage #
*
* ## Initialisation #
* Unlike most drivers, there is only a single instance of the temperature
* driver that is always available once #Temperature_init() is called.
* #Temperature_init() should be called once before using other Temperature
* driver APIs. Subsequent #Temperature_init() calls will have no effect.
*
* ## Getting the Current Temperature #
* The most basic function of the driver is to provide the current temperature
* and return it. It is encoded as a signed integer in degrees C.
*
* ## Notifications #
* The other major function of the Temperature driver is to notify the
* application when the temperature changes and crosses an application-defined
* threshold.
*
* There are three default usecases for this:
* - High threshold.
* The application will receive a notification callback when
* currentTemperature >= thresholdHigh.
* - Low threshold.
* The application will receive a notification callback when
* currentTemperature <= thresholdLow.
* - Range threshold.
* The application will receive a notification callback when
* currentTemperature >= thresholdHigh || currentTemperature <=
* thresholdLow. This setup addresses usecases
* where a notification is required when the temperature changes by a
* certain amount regardless of whether it is up or down. Adjusting
* clock offsets based on temperature is a good example of this.
*
* ### Registering Notifications
* There are three functions that register a notification for the application:
* - #Temperature_registerNotifyHigh()
* - #Temperature_registerNotifyLow()
* - #Temperature_registerNotifyRange()
*
* Multiple notifications may be registered. The different parts of the
* application and drivers that need to respond to a temperature change do not
* need to know of one another.
* Each notification must have its own #Temperature_NotifyObj and must be
* registered individually.
*
* ### Notification Callbacks
* Once the chip temperature crosses the smallest high threshold or largest
* low threshold amongst the registered notifications, the driver will
* iterate over the entire list of registered notification and check which
* ones have triggered. Notifications that have triggered are removed from
* the list of registered notifications and thus are no longer registered.
* Their callback function is then invoked.
*
* If an application wishes to reregister a notification that just triggered
* and was unregistered, it may register it again from within the notification
* callback or another context.
*
* It is possible to determine whether the high or low threshold triggered
* the notification callback as follows:
* - currentTemperature <= thresholdTemperature: Low threshold triggered
* - currentTemperature >= thresholdTemperature: High threshold triggered
* This information is only reasonably useful when registering a notification
* with both a high and low threshold using #Temperature_registerNotifyRange().
* Even then, the expected basic usecase only cares about the current
* temperature and adding an offset to it when registering the notification
* again.
*
* ### Unregistering Notifications
* Registered notifications are unregistered in two ways:
* - Automatically when a notification triggers
* - By calling #Temperature_unregisterNotify()
*
* Unregistered notifications may be registered again at any time.
*
* # Measured vs True Temperature
* While the driver aims to supply and act on an accurate absolute temperature,
* there will be differences between the measured vs the true temperature due
* to inherent variances in the manufacturing process. The nature of these
* differences varies by device family.
*
* Examples of such differences:
* - A constant per-chip offset between the measured and the true
* temperature
* - An temperature dependent per-chip offset between the measured and the
* true temperature
* - A variance in the measured temperature when measuring multiple times
* at the same chip temperature
*
* It is strongly recommended to read the device-specific Temperature driver
* documentation for details of the temperature sensor characteristics and
* how they might affect choices of threshold values.
*
* @anchor ti_drivers_Temperature_Synopsis
* # Synopsis #
* @anchor ti_drivers_Temperature_Synopsis_Code
* @code
* #include <ti/drivers/Temperature.h>
*
* #define WINDOW_DELTA 10
*
* Temperature_init();
*
* currentTemperature = Temperature_getTemperature();
*
* result = Temperature_registerNotifyRange(&notifyObject,
* currentTemperature + WINDOW_DELTA,
* currentTemperature - WINDOW_DELTA,
* myNotifyFxn,
* clientArg);
* @endcode
*
* @anchor ti_drivers_Temperature_Examples
* # Examples #
*
* ## Register a High Threshold Notification #
*
* @code
*
* // The notification will trigger when the temperature reaches 40 C
* #define THRESHOLD_CUTOFF 40
*
* #include <ti/drivers/Temperature.h>
*
* void thresholdNotifyFxn(int16_t currentTemperature,
* int16_t thresholdTemperature,
* uintptr_t clientArg,
* Temperature_NotifyObj *notifyObject) {
* // Post a semaphore, set a flag, or otherwise act upon the temperature
* // change.
* }
*
* ...
*
* // Initialize the Temperature driver and register a notification.
*
* Temperature_init();
*
* int_fast16_t status = Temperature_registerNotifyHigh(notifyObject,
* THRESHOLD_CUTOFF,
* thresholdNotifyFxn,
* NULL);
*
* if (status != Temperature_STATUS_SUCCESS) {
* // Handle error
* }
*
* @endcode
*
* ## Register a Range Threshold Notification and Reregister in Callback #
*
* @code
*
* #define THRESHOLD_DELTA 5
*
* #include <ti/drivers/Temperature.h>
*
*
* void deltaNotificationFxn(int16_t currentTemperature,
* int16_t thresholdTemperature,
* uintptr_t clientArg,
* Temperature_NotifyObj *notifyObject) {
* int_fast16_t status;
*
* status = Temperature_registerNotifyRange(notifyObject,
* currentTemperature + THRESHOLD_DELTA,
* currentTemperature - THRESHOLD_DELTA,
* deltaNotificationFxn,
* NULL);
*
* if (status != Temperature_STATUS_SUCCESS) {
* while(1);
* }
* }
*
* ...
*
* // Initialize the Temperature driver and register a notification.
*
* Temperature_init();
*
* int16_t currentTemperature = Temperature_getTemperature();
*
* int_fast16_t status = Temperature_registerNotifyRange(notifyObject,
* currentTemperature + THRESHOLD_DELTA,
* currentTemperature - THRESHOLD_DELTA,
* deltaNotificationFxn,
* NULL);
* @endcode
*/
#ifndef ti_drivers_Temperature__include
#define ti_drivers_Temperature__include
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/drivers/utils/List.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* Common Temperature status code reservation offset.
* Temperature driver implementations should offset status codes with
* Temperature_STATUS_RESERVED growing negatively.
*
* Example implementation specific status codes:
* @code
* #define TemperatureXYZ_STATUS_ERROR0 Temperature_STATUS_RESERVED - 0
* #define TemperatureXYZ_STATUS_ERROR1 Temperature_STATUS_RESERVED - 1
* #define TemperatureXYZ_STATUS_ERROR2 Temperature_STATUS_RESERVED - 2
* @endcode
*/
#define Temperature_STATUS_RESERVED (-32)
/*!
* @brief Successful status code.
*
* Functions return Temperature_STATUS_SUCCESS if the function was executed
* successfully.
*/
#define Temperature_STATUS_SUCCESS (0)
/*!
* @brief Generic error status code.
*
* Functions return Temperature_STATUS_ERROR if the function was not executed
* successfully.
*/
#define Temperature_STATUS_ERROR (-1)
/* @cond
*
* Type declaration for the notification object made separately from the
* struct definition because of the circular dependency between
* #Temperature_NotifyFxn() and #Temperature_NotifyObj.
*/
typedef struct Temperature_NotifyObj Temperature_NotifyObj;
/* @endcond */
/*!
* @brief Function prototype for a notification callback.
*
* @param [in] currentTemperature Current chip temperature
*
* @param [in] thresholdTemperature Temperature threshold that caused
* this notification callback.
*
* @param [in] clientArg Argument provided by the application
* during registration.
*
* @param [in/out] notifyObject The notification object that was
* registered previously. This pointer
* may be used to register the
* notification again with updated
* inputs from within the notification
* callback.
*/
typedef void (*Temperature_NotifyFxn) (int16_t currentTemperature,
int16_t thresholdTemperature,
uintptr_t clientArg,
Temperature_NotifyObj *notifyObject);
/*!
* @brief Temperature notify object structure.
*
* This structure specification is for internal use. Notification clients must
* pre-allocate a notify object when registering for a notification;
* #Temperature_registerNotifyHigh(), #Temperature_registerNotifyLow(),
* or #Temperature_registerNotifyRange() will take care initializing the
* internal elements appropriately.
*/
struct Temperature_NotifyObj {
List_Elem link; /*!< For placing on the notify list */
Temperature_NotifyFxn notifyFxn; /*!< Application callback function */
int16_t thresholdHigh; /*!< High threshold in degrees C */
int16_t thresholdLow; /*!< Low threshold in degrees C */
uintptr_t clientArg; /*!< Application provided arg */
bool isRegistered; /*!< Is the notification active */
};
/*!
* @brief This function initializes the Temperature driver.
*
* This function initializes the internal state of the Temperature driver.
* It must be called before calling any other Temperature functions. Calling
* this function multiple times will only have an effect the first time.
*/
void Temperature_init();
/*!
* @brief Gets the current temperature in degrees C.
*
* @return Current temperature in degrees C
*/
int16_t Temperature_getTemperature(void);
/*!
* @brief Registers a notification with a high threshold.
*
* This function registers a Temperature notification with a high threshold.
* Once the chip temperature rises above @c thresholdHigh, @c notifyFxn is
* called and the notification is automatically unregistered.
*
* @param notifyObject Structure to be initialized. After returning,
* it will contain the data necessary to issue a
* notification callback. The memory of the
* structure must persist while the notification
* is registered.
*
* @param [in] thresholdHigh Threshold temperature in degrees C
*
* @param [in] notifyFxn Callback function that is called once the
* chip temperature rises above
* @c thresholdHigh.
*
* @param [in] clientArg Application-specified argument
*
* @retval #Temperature_STATUS_SUCCESS The notification was successfully
* registered.
* @retval #Temperature_STATUS_ERROR There was an error during registration.
*
* @pre Temperature_init() called
*/
int_fast16_t Temperature_registerNotifyHigh(Temperature_NotifyObj *notifyObject,
int16_t thresholdHigh,
Temperature_NotifyFxn notifyFxn,
uintptr_t clientArg);
/*!
* @brief Registers a notification with a low threshold.
*
* This function registers a Temperature notification with a low threshold.
* Once the chip temperature falls below @c thresholdLow, @c notifyFxn is
* called and the notification is automatically unregistered.
*
* @param notifyObject Structure to be initialized. After returning,
* it will contain the data necessary to issue a
* notification callback. The memory of the
* structure must persist while the notification
* is registered.
*
* @param [in] thresholdLow Threshold temperature in degrees C
*
* @param [in] notifyFxn Callback function that is called once the
* chip temperature falls below
* @c thresholdLow.
*
* @param [in] clientArg Application-specified argument
*
* @retval #Temperature_STATUS_SUCCESS The notification was successfully
* registered.
* @retval #Temperature_STATUS_ERROR There was an error during registration.
*
* @pre Temperature_init() called
*/
int_fast16_t Temperature_registerNotifyLow(Temperature_NotifyObj *notifyObject,
int16_t thresholdLow,
Temperature_NotifyFxn notifyFxn,
uintptr_t clientArg);
/*!
* @brief Registers a notification with both a high and low threshold.
*
* This function registers a Temperature notification with a high and low
* threshold. Once the chip temperature rises above @c thresholdHigh or
* falls below @c thresholdLow, @c notifyFxn is called and the notification is
* automatically unregistered.
*
* @param notifyObject Structure to be initialized. After returning,
* it will contain the data necessary to issue a
* notification callback. The memory of the
* structure must persist while the notification
* is registered.
*
* @param [in] thresholdHigh High threshold temperature in degrees C
*
* @param [in] thresholdLow Low threshold temperature in degrees C
*
* @param [in] notifyFxn Callback function that is called once the
* chip temperature falls below
* @c thresholdLow, or rises above
* @c thresholdHigh.
*
* @param [in] clientArg Application-specified argument
*
* @retval #Temperature_STATUS_SUCCESS The notification was successfully
* registered
* @retval #Temperature_STATUS_ERROR There was an error during registration
*
* @pre Temperature_init() called
*/
int_fast16_t Temperature_registerNotifyRange(Temperature_NotifyObj *notifyObject,
int16_t thresholdHigh,
int16_t thresholdLow,
Temperature_NotifyFxn notifyFxn,
uintptr_t clientArg);
/*!
* @brief Unregisters a currently registered notification.
*
* This function unregisters a currently registered notification. It should not
* be called on a @c notifyObject that is not currently registered.
*
* @param notifyObject Notification to unregister.
*
* @retval #Temperature_STATUS_SUCCESS The notification was successfully
* unregistered.
* @retval #Temperature_STATUS_ERROR There was an error during
* unregistration.
*
* @pre Register @c notifyObject with #Temperature_registerNotifyHigh(),
* #Temperature_registerNotifyLow(), or #Temperature_registerNotifyRange()
*/
int_fast16_t Temperature_unregisterNotify(Temperature_NotifyObj *notifyObject);
/*!
* @brief Get the high threshold of a notification.
*
* This function should not be called on a @c notifyObject registered with
* #Temperature_registerNotifyLow(). The high threshold value returned in
* that case will be a device-specific invalid temperature.
*
* @param notifyObject Notification to get the high threshold of.
*
* @return High threshold in degrees C.
*
* @pre Register @c notifyObject with #Temperature_registerNotifyHigh(),
* or #Temperature_registerNotifyRange()
*/
int16_t Temperature_getThresholdHigh(Temperature_NotifyObj *notifyObject);
/*!
* @brief Get the low threshold of a notification.
*
* This function should not be called on a @c notifyObject registered with
* #Temperature_registerNotifyHigh(). The low threshold value returned in
* that case will be a device-specific invalid temperature.
*
* @param notifyObject Notification to get the low threshold of.
*
* @return Low threshold in degrees C.
*
* @pre Register @c notifyObject with #Temperature_registerNotifyLow(),
* or #Temperature_registerNotifyRange()
*/
int16_t Temperature_getThresholdLow(Temperature_NotifyObj *notifyObject);
/*!
* @brief Get the high and low threshold of a notification.
*
* This function should not be called on a @c notifyObject registered with
* #Temperature_registerNotifyLow() or #Temperature_registerNotifyHigh().
* The unconfigured threshold value returned in that case will be a
* device-specific invalid temperature.
*
* @param notifyObject Notification to get the high and low threshold of.
*
* @param [out] thresholdHigh High threshold value in degrees C written back
* by this function.
*
* @param [out] thresholdLow Low threshold value in degrees C written back
* by this function.
*
* @pre Register @c notifyObject with #Temperature_registerNotifyRange()
*/
void Temperature_getThresholdRange(Temperature_NotifyObj *notifyObject,
int16_t *thresholdHigh,
int16_t *thresholdLow);
/*!
* @brief Get the application-provided clientArg of a notification.
*
* @param notifyObject Notification to get the clientArg of.
*
* @return The clientArg provided during registration.
*
* @pre Register @c notifyObject with #Temperature_registerNotifyHigh(),
* #Temperature_registerNotifyLow(), or #Temperature_registerNotifyRange()
*/
uintptr_t Temperature_getClientArg(Temperature_NotifyObj *notifyObject);
/*!
* @brief Get the notifyFxn provided during registration.
*
* @param notifyObject Notification to get the notifyFxn of.
*
* @return The notifyFxn provided during registration
*
* @pre Register @c notifyObject with #Temperature_registerNotifyHigh(),
* #Temperature_registerNotifyLow(), or #Temperature_registerNotifyRange()
*/
Temperature_NotifyFxn Temperature_getNotifyFxn(Temperature_NotifyObj *notifyObject);
#ifdef __cplusplus
}
#endif
#endif /* ti_drivers_Temperature__include */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019, Texas Instruments Incorporated
* Copyright (c) 2015-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -42,6 +42,7 @@
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26X2.h>
#include <ti/drivers/Temperature.h>
/* driverlib header files */
#include <ti/devices/DeviceFamily.h>
@ -65,7 +66,6 @@
#include DeviceFamily_constructPath(driverlib/osc.h)
#include DeviceFamily_constructPath(driverlib/cpu.h)
#include DeviceFamily_constructPath(driverlib/vims.h)
#include DeviceFamily_constructPath(driverlib/rfc.h)
#include DeviceFamily_constructPath(driverlib/sys_ctrl.h)
#include DeviceFamily_constructPath(driverlib/driverlib_release.h)
#include DeviceFamily_constructPath(driverlib/setup.h)
@ -79,6 +79,12 @@ static void disableLFClockQualifiers(void);
static void emptyClockFunc(uintptr_t arg);
static int_fast16_t notify(uint_fast16_t eventType);
static void oscillatorISR(uintptr_t arg);
static void switchToTCXO(void);
static void delayUs(uint32_t us);
static void hposcRtcCompensateFxn(int16_t currentTemperature,
int16_t thresholdTemperature,
uintptr_t clientArg,
Temperature_NotifyObj *notifyObject);
/* RCOSC calibration functions functions */
extern void PowerCC26X2_calibrate(void);
@ -94,8 +100,11 @@ PowerCC26X2_ModuleState PowerCC26X2_module = {
.notifyList = {0}, /* list of registered notifications */
.constraintMask = 0, /* the constraint mask */
.clockObj = {0}, /* Clock object for scheduling wakeups */
.calibrationClock = {0}, /* Clock object for RCOSC calibration */
.tcxoEnableClock = {0}, /* Clock object for TCXO startup */
.tdcHwi = {0}, /* hwi object for calibration */
.oscHwi = {0}, /* hwi object for oscillators */
.hposcRtcCompNotifyObj = {0}, /* Temperature notification */
.nDeltaFreqCurr = 0, /* RCOSC calibration variable */
.nCtrimCurr = 0, /* RCOSC calibration variable */
.nCtrimFractCurr = 0, /* RCOSC calibration variable */
@ -149,6 +158,12 @@ const PowerCC26XX_ResourceRecord resourceDB[PowerCC26X2_NUMRESOURCES] = {
{PowerCC26XX_PERIPH | PowerCC26XX_DOMAIN_PERIPH, PRCM_PERIPH_UART1}, /* PERIPH_UART1 */
};
/* Defines */
#define TCXO_RAMP_DELAY 10
#define CC26X2_CLOCK_FREQUENCY 48000000
/* This is an approximate scaling factor previously used in test firmware. */
#define DELAY_SCALING_FACTOR 6000000
/* ****************** Power APIs ******************** */
@ -273,6 +288,22 @@ int_fast16_t Power_init()
/* copy the Power policy function to module state */
PowerCC26X2_module.policyFxn = PowerCC26X2_config.policyFxn;
/* Check if TCXO is selected in CCFG and in addition configured to be
* enabled by the function pointed to by PowerCC26X2_config.enableTCXOFxn
*/
if ((CCFGRead_XOSC_FREQ() == CCFGREAD_XOSC_FREQ_TCXO) &&
(PowerCC26X2_config.enableTCXOFxn != NULL)) {
/* Construct the Clock object for TCXO startup time.
* Set timeout to TCXO startup time as specified in CCFG.
*/
ClockP_construct(&PowerCC26X2_module.tcxoEnableClock,
(ClockP_Fxn)&switchToTCXO,
(CCFGRead_TCXO_MAX_START()*100)/ClockP_getSystemTickPeriod(),
NULL);
HWREG(AUX_DDI0_OSC_BASE + DDI_O_CLR + DDI_0_OSC_O_CTL0) = DDI_0_OSC_CTL0_XTAL_IS_24M;
}
/* construct the Clock object for scheduling of wakeups */
/* initiated and started by the power policy */
ClockP_Params_init(&clockParams);
@ -695,7 +726,6 @@ int_fast16_t Power_sleep(uint_fast16_t sleepState)
unsigned int constraints;
bool retainCache = false;
uint32_t modeVIMS;
unsigned int swiKey;
/* first validate the sleep code */
if (sleepState != PowerCC26XX_STANDBY) {
@ -720,7 +750,7 @@ int_fast16_t Power_sleep(uint_fast16_t sleepState)
postEvent = PowerCC26XX_AWAKE_STANDBY;
postEventLate = PowerCC26XX_AWAKE_STANDBY_LATE;
/* disable Task scheduling */
/* disable scheduling */
PowerCC26XX_schedulerDisable();
/* signal all clients registered for pre-sleep notification */
@ -733,9 +763,6 @@ int_fast16_t Power_sleep(uint_fast16_t sleepState)
return (status);
}
/* now disable Swi scheduling */
swiKey = SwiP_disable();
/* 1. Query and save domain states before powering them off */
if (Power_getDependencyCount(PowerCC26XX_DOMAIN_RFCORE)) {
poweredDomains |= PRCM_DOMAIN_RFCORE;
@ -875,10 +902,7 @@ int_fast16_t Power_sleep(uint_fast16_t sleepState)
*/
PowerCC26X2_module.state = Power_ACTIVE;
/* Re-enable Swi scheduling */
SwiP_restore(swiKey);
/* re-enable Task scheduling */
/* 19. Re-enable scheduling */
PowerCC26XX_schedulerRestore();
/* if there was a notification error, set return status */
@ -912,6 +936,35 @@ void Power_unregisterNotify(Power_NotifyObj * pNotifyObj)
/* ****************** CC26XX specific APIs ******************** */
/*
* ======== PowerCC26X2_enableHposcRtcCompensation ========
* This function enabled temperature based compensation of the RTC when
* SCLK_LF is derived from HPOSC.
*/
void PowerCC26X2_enableHposcRtcCompensation(void) {
/* If we are using HPOSC and SCLK_LF is derived from it, we need to
* compensate the RTC to account for HPOSC frequency drift over temperature.
*/
if (OSC_IsHPOSCEnabledWithHfDerivedLfClock()) {
Temperature_init();
int16_t currentTemperature = Temperature_getTemperature();
OSC_HPOSCInitializeFrequencyOffsetParameters();
/* The compensation fxn will register itself with updated thresholds
* based on the current temperature each time it is invoked. If we
* call it from the init function, it will register itself for the
* first time and handle initial RTC compensation.
*/
hposcRtcCompensateFxn(currentTemperature,
currentTemperature + PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA,
(uintptr_t)NULL,
&PowerCC26X2_module.hposcRtcCompNotifyObj);
}
}
/*
* ======== PowerCC26XX_calibrate ========
* Plug this function into the PowerCC26X2_Config structure
@ -1055,6 +1108,32 @@ void PowerCC26XX_switchXOSC_HF(void)
/* * * * * * * * * * * internal and support functions * * * * * * * * * * */
/*
* ======== hposcRtcCompensateFxn ========
*/
void hposcRtcCompensateFxn(int16_t currentTemperature,
int16_t thresholdTemperature,
uintptr_t clientArg,
Temperature_NotifyObj *notifyObject) {
int_fast16_t status;
int32_t relFreqOffset;
relFreqOffset = OSC_HPOSCRelativeFrequencyOffsetGet(currentTemperature);
OSC_HPOSCRtcCompensate(relFreqOffset);
/* Register the notification again with updated thresholds */
status = Temperature_registerNotifyRange(notifyObject,
currentTemperature + PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA,
currentTemperature - PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA,
hposcRtcCompensateFxn,
(uintptr_t)NULL);
if (status != Temperature_STATUS_SUCCESS) {
while(1);
}
}
/*
* ======== oscillatorISR ========
*/
@ -1156,6 +1235,17 @@ static unsigned int nopResourceHandler(unsigned int action)
return (0);
}
/*
* ======== delayUs ========
* Polls for an approximate number of us. Not very accurate.
* In this use case we only care about waiting 'at least X'
* and a few extra microseconds will only allow additional
* stabilisation time.
*/
static void delayUs(uint32_t us) {
CPUdelay((CC26X2_CLOCK_FREQUENCY / DELAY_SCALING_FACTOR) * us);
}
/*
* ======== notify ========
* Send notifications to registered clients.
@ -1202,16 +1292,11 @@ static int_fast16_t notify(uint_fast16_t eventType)
/*
* ======== configureRFCoreClocks ========
* Special dependency function for controlling RF core clocks.
* This function does nothing, but is kept for legacy reasons.
* All functionality has been integrated into the RF driver.
*/
static unsigned int configureRFCoreClocks(unsigned int action)
{
if (action == PowerCC26XX_ENABLE) {
RFCClockEnable();
}
else {
RFCClockDisable();
}
return (0);
}
@ -1272,18 +1357,62 @@ static unsigned int configureXOSCHF(unsigned int action)
OSCClockSourceGet(OSC_SRC_CLK_HF) != OSC_XOSC_HF &&
PowerCC26X2_module.xoscPending == false) {
OSCHF_TurnOnXosc();
/* Check if TCXO is selected in CCFG and in addition configured to be enabled
* by the function pointed to by PowerCC26X2_config.enableTCXOFxn.
*/
if ((CCFGRead_XOSC_FREQ() == CCFGREAD_XOSC_FREQ_TCXO) &&
(PowerCC26X2_config.enableTCXOFxn != NULL)) {
/* Enable clock qualification on 48MHz signal from TCXO */
if (CCFGRead_TCXO_TYPE() == 0x1) {
/* If the selected TCXO type is clipped-sine, also enable
* internal common-mode bias
*/
HWREG(AUX_DDI0_OSC_BASE + DDI_O_SET + DDI_0_OSC_O_XOSCHFCTL) = DDI_0_OSC_XOSCHFCTL_TCXO_MODE_XOSC_HF_EN |
DDI_0_OSC_XOSCHFCTL_TCXO_MODE;
}
else {
HWREG(AUX_DDI0_OSC_BASE + DDI_O_SET + DDI_0_OSC_O_XOSCHFCTL) = DDI_0_OSC_XOSCHFCTL_TCXO_MODE;
}
/* Wait for ~10 us for common mode bias to stabilise and clock
* qual to take affect.
*/
delayUs(TCXO_RAMP_DELAY);
/* Enable power on TCXO */
(*(PowerCC26X2_config.enableTCXOFxn))(true);
/* Start clock to wait for TCXO startup time before clock switch
* can be attempted.
*/
ClockP_start(ClockP_handle(&PowerCC26X2_module.tcxoEnableClock));
}
else {
/* Turn on and request XOSC_HF from the hardware for regular
* XOSC and HPOSC. TCXO does not require this call until right
* before switching since we do not rely on the harware to
* interrupt the system once the XOSC is stable.
*/
OSCHF_TurnOnXosc();
}
PowerCC26X2_module.xoscPending = true;
/* Unless it is disallowed, unmask the XOSC_HF ready to switch flag */
if (!(Power_getConstraintMask() & (1 << PowerCC26XX_SWITCH_XOSC_HF_MANUALLY))) {
if (!((CCFGRead_XOSC_FREQ() == CCFGREAD_XOSC_FREQ_TCXO) &&
(PowerCC26X2_config.enableTCXOFxn != NULL)))
{
if (!(Power_getConstraintMask() & (1 << PowerCC26XX_SWITCH_XOSC_HF_MANUALLY))) {
/* Clearing the flag in the ISR does not always work. Clear it again just in case */
HWREG(PRCM_BASE + PRCM_O_OSCICR) = PRCM_OSCICR_HFSRCPENDC_M;
/* Clearing the flag in the ISR does not always work. Clear it
* again just in case
* */
HWREG(PRCM_BASE + PRCM_O_OSCICR) = PRCM_OSCICR_HFSRCPENDC_M;
/* Turn on oscillator interrupt for SCLK_HF switching */
HWREG(PRCM_BASE + PRCM_O_OSCIMSC) |= PRCM_OSCIMSC_HFSRCPENDIM_M;
/* Turn on oscillator interrupt for SCLK_HF switching */
HWREG(PRCM_BASE + PRCM_O_OSCIMSC) |= PRCM_OSCIMSC_HFSRCPENDIM_M;
}
}
/* If the device goes into IDLE in between turning on XOSC_HF and
@ -1299,6 +1428,43 @@ static unsigned int configureXOSCHF(unsigned int action)
else if (action == PowerCC26XX_DISABLE) {
OSCHF_SwitchToRcOscTurnOffXosc();
/* Handle TCXO if selected in CCFG */
if ((CCFGRead_XOSC_FREQ() == CCFGREAD_XOSC_FREQ_TCXO) &&
(PowerCC26X2_config.enableTCXOFxn != NULL)) {
/* Disable Clock in case we have started it and are waiting for
* the TCXO to stabilise.
* If the Clock is not currently active, this should do nothing.
*/
ClockP_stop(ClockP_handle(&PowerCC26X2_module.tcxoEnableClock));
/* Disable clock qualification on 48MHz signal from TCXO and turn
* off TCXO bypass.
* If we do not disable clock qualificaition, it will not run the
* next time we switch to TCXO.
*/
if (CCFGRead_TCXO_TYPE() == 1) {
/* Also turn off bias if clipped sine TCXO type. The bias
* consumes a few hundred uA. That is fine while the TCXO is
* running but we should not incur this penalty when not running
* on TCXO.
*/
HWREG(AUX_DDI0_OSC_BASE + DDI_O_CLR + DDI_0_OSC_O_XOSCHFCTL) = DDI_0_OSC_XOSCHFCTL_TCXO_MODE |
DDI_0_OSC_XOSCHFCTL_BYPASS |
DDI_0_OSC_XOSCHFCTL_TCXO_MODE_XOSC_HF_EN;
}
else {
HWREG(AUX_DDI0_OSC_BASE + DDI_O_CLR + DDI_0_OSC_O_XOSCHFCTL) = DDI_0_OSC_XOSCHFCTL_TCXO_MODE |
DDI_0_OSC_XOSCHFCTL_BYPASS;
}
/* Check if function for enabling/disabling TCXO is supported */
if (PowerCC26X2_config.enableTCXOFxn != NULL) {
/* Disable TCXO by turning off power */
(*(PowerCC26X2_config.enableTCXOFxn))(false);
}
}
/* If we have not actually switched to XOSC_HF yet, we need to
* undo what we did above when turning on XOSC_HF. Otherwise,
* we may not balance the constraints correctly or get
@ -1319,3 +1485,23 @@ static unsigned int configureXOSCHF(unsigned int action)
}
return (0);
}
/*
* ======== switchToTCXO ========
* Switching to TCXO after TCXO startup time has expired.
*/
static void switchToTCXO(void)
{
/* Set bypass bit */
HWREG(AUX_DDI0_OSC_BASE + DDI_O_SET + DDI_0_OSC_O_XOSCHFCTL) = DDI_0_OSC_XOSCHFCTL_BYPASS;
/* Request XOSC_HF. In this instance, that is the TCXO and it will
* immediately be ready to switch to after requesting since we turned it on
* earlier with a GPIO and waited for it to stabilise.
*/
OSCHF_TurnOnXosc();
/* Switch to TCXO */
switchXOSCHF();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, Texas Instruments Incorporated
* Copyright (c) 2017-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,14 +52,15 @@
#ifndef ti_drivers_power_PowerCC26X2_
#define ti_drivers_power_PowerCC26X2_
#ifdef __cplusplus
extern "C" {
#endif
#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/ClockP.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/drivers/Temperature.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! The latency to reserve for resume from STANDBY (usec). */
#define PowerCC26X2_RESUMETIMESTANDBY 750
@ -92,6 +93,11 @@ extern "C" {
#define PowerCC26X2_PERIPH_UART1 PowerCC26XX_NUMRESOURCES + 1 /*!< Resource ID: UART1 */
/*! The temperature delta in degrees C before the RTC is re-compensated when
* SCLK_LF is derived from SCLK_HF and SCLK_HF is supplied by HPOSC.
*/
#define PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA 3
/* \cond */
#define PowerCC26X2_NUMRESOURCES (PowerCC26XX_NUMRESOURCES + 2) /* Number of resources in database */
/* \endcond */
@ -111,7 +117,7 @@ extern "C" {
/*! @brief Global configuration structure */
typedef struct PowerCC26X2_Config {
typedef struct {
/*!
* @brief The Power Policy's initialization function
*
@ -184,6 +190,13 @@ typedef struct PowerCC26X2_Config {
* RCOSC_HF should be calibrated.
*/
bool calibrateRCOSC_HF;
/*!
* @brief The function to be used for enabling or disabling the TCXO
*
* If TCXO is configured to be enabled in CCFG this function will
* enable or disable the TCXO by asserting or deasserting power to it.
*/
void (*enableTCXOFxn)(bool);
} PowerCC26X2_Config;
/*!
@ -192,13 +205,18 @@ typedef struct PowerCC26X2_Config {
* Power manager state structure. The application must not access any members
* of this structure!
*/
typedef struct PowerCC26X2_ModuleState {
typedef struct {
List_List notifyList; /*!< Event notification list */
uint32_t constraintMask; /*!< Aggregate constraints mask */
ClockP_Struct clockObj; /*!< Clock object for scheduling wakeups */
ClockP_Struct calibrationClock; /*!< Clock object for scheduling wakeups */
ClockP_Struct tcxoEnableClock; /*!< Clock object for TCXO startup time */
HwiP_Struct oscHwi; /*!< Hwi object for oscillator stabilisation */
HwiP_Struct tdcHwi; /*!< Hwi object for RCOSC calibration */
Temperature_NotifyObj hposcRtcCompNotifyObj;
/*! Temperature notification to compensate the RTC when SCLK_LF is derived
* from SCLK_HF when SCLK_HF is configured as HPOSC.
*/
int32_t nDeltaFreqCurr; /*!< RCOSC calibration variable */
int32_t nCtrimCurr; /*!< RCOSC calibration variable */
int32_t nCtrimFractCurr; /*!< RCOSC calibration variable */
@ -226,6 +244,18 @@ typedef struct PowerCC26X2_ModuleState {
Power_PolicyFxn policyFxn; /*!< The Power policy function */
} PowerCC26X2_ModuleState;
/*!
* @brief Enable RTC compensation when SCLK_LF is derived from HPOSC
*
* Enables automatic compensation for temperature based clock drift of the RTC
* when SCLK_LF is derived from HPOSC.
*
* It only needs to be called once after the system boots.
*
* This function should only be called when SCLK_LF is configured to be drived
* from HPOSC.
*/
void PowerCC26X2_enableHposcRtcCompensation(void);
#ifdef __cplusplus
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, Texas Instruments Incorporated
* Copyright (c) 2017-2019, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -87,7 +87,7 @@
#define PowerCC26X2_STATE_CLEANUP 6
/* FSM results */
typedef enum PowerCC26X2_FsmResult_ {
typedef enum {
PowerCC26X2_FSM_RESULT_RUN_FSM,
PowerCC26X2_FSM_RESULT_WAIT_FOR_TDC,
PowerCC26X2_FSM_RESULT_DONE,

Some files were not shown because too many files have changed in this diff Show More