CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
aon_ioc.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: aon_ioc.h
3 * Revised: 2015-01-14 12:12:44 +0100 (on, 14 jan 2015)
4 * Revision: 42373
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 //
43 //
44 //*****************************************************************************
45
46 #ifndef __AON_IOC_H__
47 #define __AON_IOC_H__
48
49 //*****************************************************************************
50 //
51 // If building with a C++ compiler, make all of the definitions in this header
52 // have a C binding.
53 //
54 //*****************************************************************************
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59
60 #include <stdbool.h>
61 #include <stdint.h>
62 #include <inc/hw_types.h>
63 #include <inc/hw_memmap.h>
64 #include <inc/hw_aon_ioc.h>
65 #include <driverlib/debug.h>
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 // Do not define DRIVERLIB_GENERATE_ROM!
80 //
81 //*****************************************************************************
82 #ifndef DRIVERLIB_GENERATE_ROM
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
200 AONIOCFreezeEnable(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
223 AONIOCFreezeDisable(void)
224 {
225 //
226 // Set the AON IOC latches as transparent.
227 //
228 HWREG(AON_IOC_BASE + AON_IOC_O_IOCLATCH) = AON_IOC_IOCLATCH_EN;
229 }
230
231 //*****************************************************************************
232 //
242 //
243 //*****************************************************************************
244 __STATIC_INLINE void
245 AONIOC32kHzOutputDisable(void)
246 {
247 //
248 // Disable the LF clock output.
249 //
250 HWREG(AON_IOC_BASE + AON_IOC_O_CLK32KCTL) = AON_IOC_CLK32KCTL_OE_N;
251 }
252
253 //*****************************************************************************
254 //
264 //
265 //*****************************************************************************
266 __STATIC_INLINE void
267 AONIOC32kHzOutputEnable(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 #ifndef DRIVERLIB_NOROM
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 //
308 //
309 //*****************************************************************************
AONIOC32kHzOutputDisable
__STATIC_INLINE void AONIOC32kHzOutputDisable(void)
Disable the 32kHz clock output.
Definition: aon_ioc.h:245
debug.h
AONIOCFreezeEnable
__STATIC_INLINE void AONIOCFreezeEnable(void)
Freeze the IOs.
Definition: aon_ioc.h:200
AONIOC32kHzOutputEnable
__STATIC_INLINE void AONIOC32kHzOutputEnable(void)
Enable the 32kHz clock output.
Definition: aon_ioc.h:267
AONIOCFreezeDisable
__STATIC_INLINE void AONIOCFreezeDisable(void)
Un-freeze the IOs.
Definition: aon_ioc.h:223
AONIOCDriveStrengthGet
uint32_t AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
Get a specific drive level setting for all IOs.
Definition: aon_ioc.c:112
rom.h
AONIOCDriveStrengthSet
void AONIOCDriveStrengthSet(uint32_t ui32LowDrvStr, uint32_t ui32MedDrvStr, uint32_t ui32MaxDrvStr)
Setup the drive strength for all IOs on the chip.
Definition: aon_ioc.c:60