CC26xx Driver Library
aux_wuc.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: aon_wuc.h
3 * Revised: 2016-07-07 19:12:02 +0200 (Thu, 07 Jul 2016)
4 * Revision: 46848
5 *
6 * Description: Defines and prototypes for the AUX Wakeup Controller
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 __AUX_WUC_H__
49 #define __AUX_WUC_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 #include <stdbool.h>
63 #include <stdint.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_memmap.h>
66 #include <inc/hw_aux_wuc.h>
67 #include <driverlib/debug.h>
68 
69 //*****************************************************************************
70 //
71 // Support for DriverLib in ROM:
72 // This section renames all functions that are not "static inline", so that
73 // calling these functions will default to implementation in flash. At the end
74 // of this file a second renaming will change the defaults to implementation in
75 // ROM for available functions.
76 //
77 // To force use of the implementation in flash, e.g. for debugging:
78 // - Globally: Define DRIVERLIB_NOROM at project level
79 // - Per function: Use prefix "NOROM_" when calling the function
80 //
81 //*****************************************************************************
82 #if !defined(DOXYGEN)
83  #define AUXWUCClockEnable NOROM_AUXWUCClockEnable
84  #define AUXWUCClockDisable NOROM_AUXWUCClockDisable
85  #define AUXWUCClockStatus NOROM_AUXWUCClockStatus
86  #define AUXWUCPowerCtrl NOROM_AUXWUCPowerCtrl
87 #endif
88 
89 //*****************************************************************************
90 //
91 // Defines for the AUX power control.
92 //
93 //*****************************************************************************
94 #define AUX_WUC_POWER_OFF 0x00000001
95 #define AUX_WUC_POWER_DOWN 0x00000002
96 #define AUX_WUC_POWER_ACTIVE 0x00000004
97 
98 //*****************************************************************************
99 //
100 // Defines for the AUX peripherals clock control.
101 //
102 //*****************************************************************************
103 #define AUX_WUC_SMPH_CLOCK (AUX_WUC_MODCLKEN0_SMPH_EN)
104 #define AUX_WUC_AIODIO0_CLOCK (AUX_WUC_MODCLKEN0_AIODIO0_EN)
105 #define AUX_WUC_AIODIO1_CLOCK (AUX_WUC_MODCLKEN0_AIODIO1_EN)
106 #define AUX_WUC_TIMER_CLOCK (AUX_WUC_MODCLKEN0_TIMER_EN)
107 #define AUX_WUC_ANAIF_CLOCK (AUX_WUC_MODCLKEN0_ANAIF_EN)
108 #define AUX_WUC_TDCIF_CLOCK (AUX_WUC_MODCLKEN0_TDC_EN)
109 #define AUX_WUC_OSCCTRL_CLOCK (AUX_WUC_MODCLKEN0_AUX_DDI0_OSC_EN)
110 #define AUX_WUC_ADI_CLOCK (AUX_WUC_MODCLKEN0_AUX_ADI4_EN)
111 #define AUX_WUC_MODCLK_MASK 0x000000FF
112 
113 #define AUX_WUC_TDC_CLOCK 0x00000100
114 #define AUX_WUC_ADC_CLOCK 0x00000200
115 #define AUX_WUC_REF_CLOCK 0x00000400
116 
117 #define AUX_WUC_CLOCK_OFF 0x00000000
118 #define AUX_WUC_CLOCK_UNSTABLE 0x00000001
119 #define AUX_WUC_CLOCK_READY 0x00000011
120 
121 #define AUX_WUC_CLOCK_HIFREQ 0x00000000
122 #define AUX_WUC_CLOCK_LOFREQ 0x00000001
123 
124 //*****************************************************************************
125 //
126 // API Functions and prototypes
127 //
128 //*****************************************************************************
129 
130 //****************************************************************************
131 //
153 //
154 //****************************************************************************
155 extern void AUXWUCClockEnable(uint32_t ui32Clocks);
156 
157 //****************************************************************************
158 //
180 //
181 //****************************************************************************
182 extern void AUXWUCClockDisable(uint32_t ui32Clocks);
183 
184 //****************************************************************************
185 //
207 //
208 //****************************************************************************
209 extern uint32_t AUXWUCClockStatus(uint32_t ui32Clocks);
210 
211 //****************************************************************************
212 //
229 //
230 //****************************************************************************
231 __STATIC_INLINE void
232 AUXWUCClockFreqReq(uint32_t ui32ClockFreq)
233 {
234  //
235  // Check the arguments.
236  //
237  ASSERT((ui32ClockFreq == AUX_WUC_CLOCK_HIFREQ) ||
238  (ui32ClockFreq == AUX_WUC_CLOCK_LOFREQ));
239 
240  //
241  // Set the request
242  //
243  HWREG(AUX_WUC_BASE + AUX_WUC_O_CLKLFREQ) = ui32ClockFreq;
244 }
245 
246 //****************************************************************************
247 //
259 //
260 //****************************************************************************
261 extern void AUXWUCPowerCtrl(uint32_t ui32PowerMode);
262 
263 //*****************************************************************************
264 //
276 //
277 //*****************************************************************************
278 __STATIC_INLINE void
280 {
281  //
282  // Set the AUX WUC latches as static.
283  //
284  HWREG(AUX_WUC_BASE + AUX_WUC_O_AUXIOLATCH) = 0x0;
285 }
286 
287 //*****************************************************************************
288 //
301 //
302 //*****************************************************************************
303 __STATIC_INLINE void
305 {
306  //
307  // Set the AUX WUC latches as transparent.
308  //
310 }
311 
312 //*****************************************************************************
313 //
314 // Support for DriverLib in ROM:
315 // Redirect to implementation in ROM when available.
316 //
317 //*****************************************************************************
318 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
319  #include <driverlib/rom.h>
320  #ifdef ROM_AUXWUCClockEnable
321  #undef AUXWUCClockEnable
322  #define AUXWUCClockEnable ROM_AUXWUCClockEnable
323  #endif
324  #ifdef ROM_AUXWUCClockDisable
325  #undef AUXWUCClockDisable
326  #define AUXWUCClockDisable ROM_AUXWUCClockDisable
327  #endif
328  #ifdef ROM_AUXWUCClockStatus
329  #undef AUXWUCClockStatus
330  #define AUXWUCClockStatus ROM_AUXWUCClockStatus
331  #endif
332  #ifdef ROM_AUXWUCPowerCtrl
333  #undef AUXWUCPowerCtrl
334  #define AUXWUCPowerCtrl ROM_AUXWUCPowerCtrl
335  #endif
336 #endif
337 
338 //*****************************************************************************
339 //
340 // Mark the end of the C bindings section for C++ compilers.
341 //
342 //*****************************************************************************
343 #ifdef __cplusplus
344 }
345 #endif
346 
347 #endif // __AUX_WUC_H__
348 
349 //****************************************************************************
350 //
354 //
355 //****************************************************************************
static void AUXWUCClockFreqReq(uint32_t ui32ClockFreq)
Request a high or low frequency clock source.
Definition: aux_wuc.h:232
#define AUX_WUC_CLOCK_LOFREQ
Definition: aux_wuc.h:122
void AUXWUCClockEnable(uint32_t ui32Clocks)
Enable clocks for peripherals in the AUX domain.
Definition: aux_wuc.c:64
void AUXWUCPowerCtrl(uint32_t ui32PowerMode)
Control the power to the AUX domain.
Definition: aux_wuc.c:274
uint32_t AUXWUCClockStatus(uint32_t ui32Clocks)
Get the status of a clock.
Definition: aux_wuc.c:162
static void AUXWUCFreezeDisable(void)
Unfreeze the AUX IOs.
Definition: aux_wuc.h:304
#define AUX_WUC_CLOCK_HIFREQ
Definition: aux_wuc.h:121
void AUXWUCClockDisable(uint32_t ui32Clocks)
Disable clocks for peripherals in the AUX domain.
Definition: aux_wuc.c:113
#define ASSERT(expr)
Definition: debug.h:74
static void AUXWUCFreezeEnable(void)
Freeze the AUX IOs.
Definition: aux_wuc.h:279