CC13xx Driver Library
setup_rom.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: setup_rom.h
3 * Revised: 2016-07-07 19:12:02 +0200 (to, 07 jul 2016)
4 * Revision: 46848
5 *
6 * Description: Prototypes and defines for the setup API.
7 *
8 * Copyright (c) 2015 - 2016, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 //*****************************************************************************
40 //
45 //
46 //*****************************************************************************
47 
48 #ifndef __SETUP_ROM_H__
49 #define __SETUP_ROM_H__
50 
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 // Hardware headers
63 #include <inc/hw_types.h>
64 // Driverlib headers
65 // - None needed
66 
67 //*****************************************************************************
68 //
69 // Support for DriverLib in ROM:
70 // This section renames all functions that are not "static inline", so that
71 // calling these functions will default to implementation in flash. At the end
72 // of this file a second renaming will change the defaults to implementation in
73 // ROM for available functions.
74 //
75 // To force use of the implementation in flash, e.g. for debugging:
76 // - Globally: Define DRIVERLIB_NOROM at project level
77 // - Per function: Use prefix "NOROM_" when calling the function
78 //
79 //*****************************************************************************
80 #if !defined(DOXYGEN)
81  #define SetupAfterColdResetWakeupFromShutDownCfg1 NOROM_SetupAfterColdResetWakeupFromShutDownCfg1
82  #define SetupAfterColdResetWakeupFromShutDownCfg2 NOROM_SetupAfterColdResetWakeupFromShutDownCfg2
83  #define SetupAfterColdResetWakeupFromShutDownCfg3 NOROM_SetupAfterColdResetWakeupFromShutDownCfg3
84  #define SetupGetTrimForAdcShModeEn NOROM_SetupGetTrimForAdcShModeEn
85  #define SetupGetTrimForAdcShVbufEn NOROM_SetupGetTrimForAdcShVbufEn
86  #define SetupGetTrimForAmpcompCtrl NOROM_SetupGetTrimForAmpcompCtrl
87  #define SetupGetTrimForAmpcompTh1 NOROM_SetupGetTrimForAmpcompTh1
88  #define SetupGetTrimForAmpcompTh2 NOROM_SetupGetTrimForAmpcompTh2
89  #define SetupGetTrimForAnabypassValue1 NOROM_SetupGetTrimForAnabypassValue1
90  #define SetupGetTrimForDblrLoopFilterResetVoltage NOROM_SetupGetTrimForDblrLoopFilterResetVoltage
91  #define SetupGetTrimForRadcExtCfg NOROM_SetupGetTrimForRadcExtCfg
92  #define SetupGetTrimForRcOscLfIBiasTrim NOROM_SetupGetTrimForRcOscLfIBiasTrim
93  #define SetupGetTrimForRcOscLfRtuneCtuneTrim NOROM_SetupGetTrimForRcOscLfRtuneCtuneTrim
94  #define SetupGetTrimForXoscHfCtl NOROM_SetupGetTrimForXoscHfCtl
95  #define SetupGetTrimForXoscHfFastStart NOROM_SetupGetTrimForXoscHfFastStart
96  #define SetupGetTrimForXoscHfIbiastherm NOROM_SetupGetTrimForXoscHfIbiastherm
97  #define SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio NOROM_SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio
98  #define SetupSetCacheModeAccordingToCcfgSetting NOROM_SetupSetCacheModeAccordingToCcfgSetting
99  #define SetupSetAonRtcSubSecInc NOROM_SetupSetAonRtcSubSecInc
100  #define SetupSetVddrLevel NOROM_SetupSetVddrLevel
101 #endif
102 
103 //*****************************************************************************
104 //
106 //
107 //*****************************************************************************
108 extern void SetupAfterColdResetWakeupFromShutDownCfg1( uint32_t ccfg_ModeConfReg );
109 
110 //*****************************************************************************
111 //
113 //
114 //*****************************************************************************
115 extern void SetupAfterColdResetWakeupFromShutDownCfg2( uint32_t ui32Fcfg1Revision, uint32_t ccfg_ModeConfReg );
116 
117 //*****************************************************************************
118 //
120 //
121 //*****************************************************************************
122 extern void SetupAfterColdResetWakeupFromShutDownCfg3( uint32_t ccfg_ModeConfReg );
123 
124 //*****************************************************************************
125 //
127 //
128 //*****************************************************************************
129 extern uint32_t SetupGetTrimForAdcShModeEn( uint32_t ui32Fcfg1Revision );
130 
131 //*****************************************************************************
132 //
134 //
135 //*****************************************************************************
136 extern uint32_t SetupGetTrimForAdcShVbufEn( uint32_t ui32Fcfg1Revision );
137 
138 //*****************************************************************************
139 //
141 //
142 //*****************************************************************************
143 extern uint32_t SetupGetTrimForAmpcompCtrl( uint32_t ui32Fcfg1Revision );
144 
145 //*****************************************************************************
146 //
148 //
149 //*****************************************************************************
150 extern uint32_t SetupGetTrimForAmpcompTh1( void );
151 
152 //*****************************************************************************
153 //
155 //
156 //*****************************************************************************
157 extern uint32_t SetupGetTrimForAmpcompTh2( void );
158 
159 //*****************************************************************************
160 //
162 //
163 //*****************************************************************************
164 extern uint32_t SetupGetTrimForAnabypassValue1( uint32_t ccfg_ModeConfReg );
165 
166 //*****************************************************************************
167 //
169 //
170 //*****************************************************************************
171 extern uint32_t SetupGetTrimForDblrLoopFilterResetVoltage( uint32_t ui32Fcfg1Revision );
172 
173 //*****************************************************************************
174 //
176 //
177 //*****************************************************************************
178 extern uint32_t SetupGetTrimForRadcExtCfg( uint32_t ui32Fcfg1Revision );
179 
180 //*****************************************************************************
181 //
183 //
184 //*****************************************************************************
185 extern uint32_t SetupGetTrimForRcOscLfIBiasTrim( uint32_t ui32Fcfg1Revision );
186 
187 //*****************************************************************************
188 //
191 //
192 //*****************************************************************************
193 extern uint32_t SetupGetTrimForRcOscLfRtuneCtuneTrim( void );
194 
195 //*****************************************************************************
196 //
198 //
199 //*****************************************************************************
200 extern uint32_t SetupGetTrimForXoscHfCtl( uint32_t ui32Fcfg1Revision );
201 
202 //*****************************************************************************
203 //
205 //
206 //*****************************************************************************
207 extern uint32_t SetupGetTrimForXoscHfFastStart( void );
208 
209 //*****************************************************************************
210 //
213 //
214 //*****************************************************************************
215 extern uint32_t SetupGetTrimForXoscHfIbiastherm( void );
216 
217 //*****************************************************************************
218 //
221 //
222 //*****************************************************************************
223 extern uint32_t SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio( uint32_t ui32Fcfg1Revision );
224 
225 //*****************************************************************************
226 //
230 //
231 //*****************************************************************************
232 __STATIC_INLINE int32_t
233 SetupSignExtendVddrTrimValue( uint32_t ui32VddrTrimVal )
234 {
235  //
236  // The VDDR trim value is 5 bits representing the range from -10 to +21
237  // (where -10=0x16, -1=0x1F, 0=0x00, 1=0x01 and +21=0x15)
238  //
239  int32_t i32SignedVddrVal = ui32VddrTrimVal;
240  if ( i32SignedVddrVal > 0x15 ) {
241  i32SignedVddrVal -= 0x20;
242  }
243  return ( i32SignedVddrVal );
244 }
245 
246 //*****************************************************************************
247 //
251 //
252 //*****************************************************************************
253 extern void SetupSetCacheModeAccordingToCcfgSetting( void );
254 
255 //*****************************************************************************
256 //
260 //
261 //*****************************************************************************
262 extern void SetupSetAonRtcSubSecInc( uint32_t subSecInc );
263 
264 //*****************************************************************************
265 //
269 //
270 //*****************************************************************************
271 extern void SetupSetVddrLevel( uint32_t ccfg_ModeConfReg );
272 
273 //*****************************************************************************
274 //
275 // Support for DriverLib in ROM:
276 // Redirect to implementation in ROM when available.
277 //
278 //*****************************************************************************
279 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
280  #include <driverlib/rom.h>
281  #ifdef ROM_SetupAfterColdResetWakeupFromShutDownCfg1
282  #undef SetupAfterColdResetWakeupFromShutDownCfg1
283  #define SetupAfterColdResetWakeupFromShutDownCfg1 ROM_SetupAfterColdResetWakeupFromShutDownCfg1
284  #endif
285  #ifdef ROM_SetupAfterColdResetWakeupFromShutDownCfg2
286  #undef SetupAfterColdResetWakeupFromShutDownCfg2
287  #define SetupAfterColdResetWakeupFromShutDownCfg2 ROM_SetupAfterColdResetWakeupFromShutDownCfg2
288  #endif
289  #ifdef ROM_SetupAfterColdResetWakeupFromShutDownCfg3
290  #undef SetupAfterColdResetWakeupFromShutDownCfg3
291  #define SetupAfterColdResetWakeupFromShutDownCfg3 ROM_SetupAfterColdResetWakeupFromShutDownCfg3
292  #endif
293  #ifdef ROM_SetupGetTrimForAdcShModeEn
294  #undef SetupGetTrimForAdcShModeEn
295  #define SetupGetTrimForAdcShModeEn ROM_SetupGetTrimForAdcShModeEn
296  #endif
297  #ifdef ROM_SetupGetTrimForAdcShVbufEn
298  #undef SetupGetTrimForAdcShVbufEn
299  #define SetupGetTrimForAdcShVbufEn ROM_SetupGetTrimForAdcShVbufEn
300  #endif
301  #ifdef ROM_SetupGetTrimForAmpcompCtrl
302  #undef SetupGetTrimForAmpcompCtrl
303  #define SetupGetTrimForAmpcompCtrl ROM_SetupGetTrimForAmpcompCtrl
304  #endif
305  #ifdef ROM_SetupGetTrimForAmpcompTh1
306  #undef SetupGetTrimForAmpcompTh1
307  #define SetupGetTrimForAmpcompTh1 ROM_SetupGetTrimForAmpcompTh1
308  #endif
309  #ifdef ROM_SetupGetTrimForAmpcompTh2
310  #undef SetupGetTrimForAmpcompTh2
311  #define SetupGetTrimForAmpcompTh2 ROM_SetupGetTrimForAmpcompTh2
312  #endif
313  #ifdef ROM_SetupGetTrimForAnabypassValue1
314  #undef SetupGetTrimForAnabypassValue1
315  #define SetupGetTrimForAnabypassValue1 ROM_SetupGetTrimForAnabypassValue1
316  #endif
317  #ifdef ROM_SetupGetTrimForDblrLoopFilterResetVoltage
318  #undef SetupGetTrimForDblrLoopFilterResetVoltage
319  #define SetupGetTrimForDblrLoopFilterResetVoltage ROM_SetupGetTrimForDblrLoopFilterResetVoltage
320  #endif
321  #ifdef ROM_SetupGetTrimForRadcExtCfg
322  #undef SetupGetTrimForRadcExtCfg
323  #define SetupGetTrimForRadcExtCfg ROM_SetupGetTrimForRadcExtCfg
324  #endif
325  #ifdef ROM_SetupGetTrimForRcOscLfIBiasTrim
326  #undef SetupGetTrimForRcOscLfIBiasTrim
327  #define SetupGetTrimForRcOscLfIBiasTrim ROM_SetupGetTrimForRcOscLfIBiasTrim
328  #endif
329  #ifdef ROM_SetupGetTrimForRcOscLfRtuneCtuneTrim
330  #undef SetupGetTrimForRcOscLfRtuneCtuneTrim
331  #define SetupGetTrimForRcOscLfRtuneCtuneTrim ROM_SetupGetTrimForRcOscLfRtuneCtuneTrim
332  #endif
333  #ifdef ROM_SetupGetTrimForXoscHfCtl
334  #undef SetupGetTrimForXoscHfCtl
335  #define SetupGetTrimForXoscHfCtl ROM_SetupGetTrimForXoscHfCtl
336  #endif
337  #ifdef ROM_SetupGetTrimForXoscHfFastStart
338  #undef SetupGetTrimForXoscHfFastStart
339  #define SetupGetTrimForXoscHfFastStart ROM_SetupGetTrimForXoscHfFastStart
340  #endif
341  #ifdef ROM_SetupGetTrimForXoscHfIbiastherm
342  #undef SetupGetTrimForXoscHfIbiastherm
343  #define SetupGetTrimForXoscHfIbiastherm ROM_SetupGetTrimForXoscHfIbiastherm
344  #endif
345  #ifdef ROM_SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio
346  #undef SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio
347  #define SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio ROM_SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio
348  #endif
349  #ifdef ROM_SetupSetCacheModeAccordingToCcfgSetting
350  #undef SetupSetCacheModeAccordingToCcfgSetting
351  #define SetupSetCacheModeAccordingToCcfgSetting ROM_SetupSetCacheModeAccordingToCcfgSetting
352  #endif
353  #ifdef ROM_SetupSetAonRtcSubSecInc
354  #undef SetupSetAonRtcSubSecInc
355  #define SetupSetAonRtcSubSecInc ROM_SetupSetAonRtcSubSecInc
356  #endif
357  #ifdef ROM_SetupSetVddrLevel
358  #undef SetupSetVddrLevel
359  #define SetupSetVddrLevel ROM_SetupSetVddrLevel
360  #endif
361 #endif
362 
363 //*****************************************************************************
364 //
365 // Mark the end of the C bindings section for C++ compilers.
366 //
367 //*****************************************************************************
368 #ifdef __cplusplus
369 }
370 #endif
371 
372 #endif // __SETUP_ROM_H__
373 
374 //*****************************************************************************
375 //
379 //
380 //*****************************************************************************
uint32_t SetupGetTrimForAmpcompTh1(void)
Returns the trim value to be used for the AMPCOMP_TH1 register in OSC_DIG.
Definition: setup_rom.c:696
uint32_t SetupGetTrimForRcOscLfRtuneCtuneTrim(void)
Returns the trim value to be used for the RCOSCLF_RTUNE_TRIM and the RCOSCLF_CTUNE_TRIM bit fields in...
Definition: setup_rom.c:613
uint32_t SetupGetTrimForAmpcompTh2(void)
Returns the trim value to be used for the AMPCOMP_TH2 register in OSC_DIG.
Definition: setup_rom.c:661
uint32_t SetupGetTrimForDblrLoopFilterResetVoltage(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as DBLR_LOOP_FILTER_RESET_VOLTAGE setting.
Definition: setup_rom.c:809
void SetupAfterColdResetWakeupFromShutDownCfg3(uint32_t ccfg_ModeConfReg)
Third part of configuration required when waking up from shutdown.
Definition: setup_rom.c:411
uint32_t SetupGetTrimForAdcShVbufEn(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as ADC_SH_VBUF_EN setting.
Definition: setup_rom.c:847
uint32_t SetupGetTrimForRadcExtCfg(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the RADCEXTCFG register in OSC_DIG.
Definition: setup_rom.c:916
void SetupSetAonRtcSubSecInc(uint32_t subSecInc)
Doing the tricky stuff needed to enter new RTCSUBSECINC value.
Definition: setup_rom.c:1043
uint32_t SetupGetTrimForRcOscLfIBiasTrim(uint32_t ui32Fcfg1Revision)
Returns the FCFG1 OSC_CONF_ATESTLF_RCOSCLF_IBIAS_TRIM.
Definition: setup_rom.c:948
void SetupAfterColdResetWakeupFromShutDownCfg1(uint32_t ccfg_ModeConfReg)
First part of configuration required when waking up from shutdown.
Definition: setup_rom.c:191
uint32_t SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio(uint32_t ui32Fcfg1Revision)
Returns XOSCLF_REGULATOR_TRIM and XOSCLF_CMIRRWR_RATIO as one packet spanning bits [5:0] in the retur...
Definition: setup_rom.c:968
uint32_t SetupGetTrimForAnabypassValue1(uint32_t ccfg_ModeConfReg)
Returns the trim value to be used for the ANABYPASS_VALUE1 register in OSC_DIG.
Definition: setup_rom.c:543
void SetupSetCacheModeAccordingToCcfgSetting(void)
Set correct VIMS_MODE according to CCFG setting (CACHE or GPRAM)
Definition: setup_rom.c:990
uint32_t SetupGetTrimForAdcShModeEn(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as ADC_SH_MODE_EN setting.
Definition: setup_rom.c:828
uint32_t SetupGetTrimForAmpcompCtrl(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the AMPCOMP_CTRL register in OSC_DIG.
Definition: setup_rom.c:731
void SetupSetVddrLevel(uint32_t ccfg_ModeConfReg)
Set VDDR boost mode.
Definition: setup_rom.c:127
uint32_t SetupGetTrimForXoscHfFastStart(void)
Returns the trim value to be used as OSC_DIG:CTL1.XOSC_HF_FAST_START.
Definition: setup_rom.c:898
void SetupAfterColdResetWakeupFromShutDownCfg2(uint32_t ui32Fcfg1Revision, uint32_t ccfg_ModeConfReg)
Second part of configuration required when waking up from shutdown.
Definition: setup_rom.c:295
uint32_t SetupGetTrimForXoscHfCtl(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the XOSCHFCTL register in OSC_DIG.
Definition: setup_rom.c:866
uint32_t SetupGetTrimForXoscHfIbiastherm(void)
Returns the trim value to be used for the XOSC_HF_IBIASTHERM bit field in the ANABYPASS_VALUE2 regist...
Definition: setup_rom.c:641
static int32_t SetupSignExtendVddrTrimValue(uint32_t ui32VddrTrimVal)
Sign extend the VDDR_TRIM setting (special format ranging from -10 to +21)
Definition: setup_rom.h:233