CC13xx Driver Library
aon_ioc.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: aon_ioc.h
3 * Revised: 2015-07-16 12:12:04 +0200 (Thu, 16 Jul 2015)
4 * Revision: 44151
5 *
6 * Description: Defines and prototypes for the AON IO Controller
7 *
8 * Copyright (c) 2015, 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 __AON_IOC_H__
49 #define __AON_IOC_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_aon_ioc.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 AONIOCDriveStrengthSet NOROM_AONIOCDriveStrengthSet
84  #define AONIOCDriveStrengthGet NOROM_AONIOCDriveStrengthGet
85 #endif
86 
87 //*****************************************************************************
88 //
89 // Defines for the drive strength
90 //
91 //*****************************************************************************
92 #define AONIOC_DRV_STR5_7_14 0x00000000 //
93 #define AONIOC_DRV_STR5_10_20 0x00000001 //
94 #define AONIOC_DRV_STR7_14_28 0x00000003 //
95 #define AONIOC_DRV_STR10_20_40 0x00000002 //
96 #define AONIOC_DRV_STR14_28_56 0x00000006 //
97 #define AONIOC_DRV_STR20_40_80 0x00000007 //
98 #define AONIOC_DRV_STR28_56_112 0x00000005 //
99 #define AONIOC_DRV_STR40_80_112 0x00000004 //
100 
101 #define AONIOC_MAX_DRIVE AONIOC_DRV_STR40_80_112
102 #define AONIOC_MED_DRIVE AONIOC_DRV_STR14_28_56
103 #define AONIOC_MIN_DRIVE AONIOC_DRV_STR5_7_14
104 
105 //*****************************************************************************
106 //
107 // API Functions and prototypes
108 //
109 //*****************************************************************************
110 
111 //*****************************************************************************
112 //
150 //
151 //*****************************************************************************
152 extern void AONIOCDriveStrengthSet(uint32_t ui32LowDrvStr,
153  uint32_t ui32MedDrvStr,
154  uint32_t ui32MaxDrvStr);
155 
156 //*****************************************************************************
157 //
180 //
181 //*****************************************************************************
182 extern uint32_t AONIOCDriveStrengthGet(uint32_t ui32DriveLevel);
183 
184 //*****************************************************************************
185 //
197 //
198 //*****************************************************************************
199 __STATIC_INLINE void
201 {
202  //
203  // Set the AON IO latches as static.
204  //
205  HWREG(AON_IOC_BASE + AON_IOC_O_IOCLATCH) = 0x0;
206 }
207 
208 //*****************************************************************************
209 //
220 //
221 //*****************************************************************************
222 __STATIC_INLINE void
224 {
225  //
226  // Set the AON IOC latches as transparent.
227  //
229 }
230 
231 //*****************************************************************************
232 //
242 //
243 //*****************************************************************************
244 __STATIC_INLINE void
246 {
247  //
248  // Disable the LF clock output.
249  //
251 }
252 
253 //*****************************************************************************
254 //
264 //
265 //*****************************************************************************
266 __STATIC_INLINE void
268 {
269  //
270  // Enable the LF clock output.
271  //
272  HWREG(AON_IOC_BASE + AON_IOC_O_CLK32KCTL) = 0x0;
273 }
274 
275 //*****************************************************************************
276 //
277 // Support for DriverLib in ROM:
278 // Redirect to implementation in ROM when available.
279 //
280 //*****************************************************************************
281 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
282  #include <driverlib/rom.h>
283  #ifdef ROM_AONIOCDriveStrengthSet
284  #undef AONIOCDriveStrengthSet
285  #define AONIOCDriveStrengthSet ROM_AONIOCDriveStrengthSet
286  #endif
287  #ifdef ROM_AONIOCDriveStrengthGet
288  #undef AONIOCDriveStrengthGet
289  #define AONIOCDriveStrengthGet ROM_AONIOCDriveStrengthGet
290  #endif
291 #endif
292 
293 //*****************************************************************************
294 //
295 // Mark the end of the C bindings section for C++ compilers.
296 //
297 //*****************************************************************************
298 #ifdef __cplusplus
299 }
300 #endif
301 
302 #endif // __AON_IOC_H__
303 
304 //*****************************************************************************
305 //
309 //
310 //*****************************************************************************
static void AONIOCFreezeEnable(void)
Freeze the IOs.
Definition: aon_ioc.h:200
static void AONIOC32kHzOutputDisable(void)
Disable the 32kHz clock output.
Definition: aon_ioc.h:245
static void AONIOCFreezeDisable(void)
Un-freeze the IOs.
Definition: aon_ioc.h:223
static void AONIOC32kHzOutputEnable(void)
Enable the 32kHz clock output.
Definition: aon_ioc.h:267
uint32_t AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
Get a specific drive level setting for all IOs.
Definition: aon_ioc.c:112
void AONIOCDriveStrengthSet(uint32_t ui32LowDrvStr, uint32_t ui32MedDrvStr, uint32_t ui32MaxDrvStr)
Set up the drive strength for all IOs on the chip.
Definition: aon_ioc.c:60