CC13xx Driver Library
aon_ioc.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: aon_ioc.h
3 * Revised: 2015-09-08 16:38:55 +0200 (Tue, 08 Sep 2015)
4 * Revision: 44531
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 // Defines for the drive strength
72 //
73 //*****************************************************************************
74 #define AONIOC_DRV_STR_1 0x00000000 // Lowest drive strength
75 #define AONIOC_DRV_STR_2 0x00000001
76 #define AONIOC_DRV_STR_3 0x00000003
77 #define AONIOC_DRV_STR_4 0x00000002
78 #define AONIOC_DRV_STR_5 0x00000006
79 #define AONIOC_DRV_STR_6 0x00000007
80 #define AONIOC_DRV_STR_7 0x00000005
81 #define AONIOC_DRV_STR_8 0x00000004 // Highest drive strength
82 
83 #define AONIOC_DRV_LVL_MIN (AON_IOC_O_IOSTRMIN)
84 #define AONIOC_DRV_LVL_MED (AON_IOC_O_IOSTRMED)
85 #define AONIOC_DRV_LVL_MAX (AON_IOC_O_IOSTRMAX)
86 
87 //*****************************************************************************
88 //
89 // API Functions and prototypes
90 //
91 //*****************************************************************************
92 
93 //*****************************************************************************
94 //
131 //
132 //*****************************************************************************
133 __STATIC_INLINE void
134 AONIOCDriveStrengthSet(uint32_t ui32DriveLevel, uint32_t ui32DriveStrength)
135 {
136  ASSERT((ui32DriveLevel == AONIOC_DRV_LVL_MIN) ||
137  (ui32DriveLevel == AONIOC_DRV_LVL_MED) ||
138  (ui32DriveLevel == AONIOC_DRV_LVL_MAX));
139  ASSERT((ui32DriveStrength == AONIOC_DRV_STR_1) ||
140  (ui32DriveStrength == AONIOC_DRV_STR_2) ||
141  (ui32DriveStrength == AONIOC_DRV_STR_3) ||
142  (ui32DriveStrength == AONIOC_DRV_STR_4) ||
143  (ui32DriveStrength == AONIOC_DRV_STR_5) ||
144  (ui32DriveStrength == AONIOC_DRV_STR_6) ||
145  (ui32DriveStrength == AONIOC_DRV_STR_7) ||
146  (ui32DriveStrength == AONIOC_DRV_STR_8));
147 
148  //
149  // Set the drive strength.
150  //
151  HWREG(AON_IOC_BASE + ui32DriveLevel) = ui32DriveStrength;
152 }
153 
154 //*****************************************************************************
155 //
180 //
181 //*****************************************************************************
182 __STATIC_INLINE uint32_t
183 AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
184 {
185  //
186  // Check the arguments.
187  //
188  ASSERT((ui32DriveLevel == AONIOC_DRV_LVL_MIN) ||
189  (ui32DriveLevel == AONIOC_DRV_LVL_MED) ||
190  (ui32DriveLevel == AONIOC_DRV_LVL_MAX));
191 
192  //
193  // Return the drive strength value.
194  //
195  return( HWREG(AON_IOC_BASE + ui32DriveLevel) );
196 }
197 
198 //*****************************************************************************
199 //
211 //
212 //*****************************************************************************
213 __STATIC_INLINE void
215 {
216  //
217  // Set the AON IO latches as static.
218  //
219  HWREG(AON_IOC_BASE + AON_IOC_O_IOCLATCH) = 0x0;
220 }
221 
222 //*****************************************************************************
223 //
234 //
235 //*****************************************************************************
236 __STATIC_INLINE void
238 {
239  //
240  // Set the AON IOC latches as transparent.
241  //
243 }
244 
245 //*****************************************************************************
246 //
256 //
257 //*****************************************************************************
258 __STATIC_INLINE void
260 {
261  //
262  // Disable the LF clock output.
263  //
265 }
266 
267 //*****************************************************************************
268 //
278 //
279 //*****************************************************************************
280 __STATIC_INLINE void
282 {
283  //
284  // Enable the LF clock output.
285  //
286  HWREG(AON_IOC_BASE + AON_IOC_O_CLK32KCTL) = 0x0;
287 }
288 
289 //*****************************************************************************
290 //
291 // Mark the end of the C bindings section for C++ compilers.
292 //
293 //*****************************************************************************
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif // __AON_IOC_H__
299 
300 //*****************************************************************************
301 //
305 //
306 //*****************************************************************************
#define AONIOC_DRV_STR_3
Definition: aon_ioc.h:76
#define AONIOC_DRV_STR_5
Definition: aon_ioc.h:78
static void AONIOCFreezeEnable(void)
Freeze the IOs.
Definition: aon_ioc.h:214
#define AONIOC_DRV_LVL_MIN
Definition: aon_ioc.h:83
static void AONIOC32kHzOutputDisable(void)
Disable the 32kHz clock output.
Definition: aon_ioc.h:259
static void AONIOCFreezeDisable(void)
Un-freeze the IOs.
Definition: aon_ioc.h:237
#define AONIOC_DRV_STR_4
Definition: aon_ioc.h:77
#define AONIOC_DRV_STR_1
Definition: aon_ioc.h:74
#define AONIOC_DRV_LVL_MAX
Definition: aon_ioc.h:85
#define AONIOC_DRV_STR_6
Definition: aon_ioc.h:79
#define AONIOC_DRV_STR_8
Definition: aon_ioc.h:81
#define ASSERT(expr)
Definition: debug.h:74
#define AONIOC_DRV_LVL_MED
Definition: aon_ioc.h:84
static void AONIOC32kHzOutputEnable(void)
Enable the 32kHz clock output.
Definition: aon_ioc.h:281
static uint32_t AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
Get a specific drive level setting for all IOs.
Definition: aon_ioc.h:183
#define AONIOC_DRV_STR_2
Definition: aon_ioc.h:75
#define AONIOC_DRV_STR_7
Definition: aon_ioc.h:80
static void AONIOCDriveStrengthSet(uint32_t ui32DriveLevel, uint32_t ui32DriveStrength)
Configure drive strength values for the manual drive strength options.
Definition: aon_ioc.h:134