CC26xx Driver Library
aon_ioc.c
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: aon_ioc.c
3 * Revised: 2015-01-13 16:59:55 +0100 (Tue, 13 Jan 2015)
4 * Revision: 42365
5 *
6 * Description: Driver 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 #include <driverlib/aon_ioc.h>
40 
41 //*****************************************************************************
42 //
43 // Handle support for DriverLib in ROM:
44 // This section will undo prototype renaming made in the header file
45 //
46 //*****************************************************************************
47 #if !defined(DOXYGEN)
48  #undef AONIOCDriveStrengthSet
49  #define AONIOCDriveStrengthSet NOROM_AONIOCDriveStrengthSet
50  #undef AONIOCDriveStrengthGet
51  #define AONIOCDriveStrengthGet NOROM_AONIOCDriveStrengthGet
52 #endif
53 
54 //*****************************************************************************
55 //
57 //
58 //*****************************************************************************
59 void
60 AONIOCDriveStrengthSet(uint32_t ui32LowDrvStr, uint32_t ui32MedDrvStr,
61  uint32_t ui32MaxDrvStr)
62 {
63  ASSERT((ui32LowDrvStr == AONIOC_DRV_STR5_7_14) ||
64  (ui32LowDrvStr == AONIOC_DRV_STR5_10_20) ||
65  (ui32LowDrvStr == AONIOC_DRV_STR7_14_28) ||
66  (ui32LowDrvStr == AONIOC_DRV_STR10_20_40) ||
67  (ui32LowDrvStr == AONIOC_DRV_STR14_28_56) ||
68  (ui32LowDrvStr == AONIOC_DRV_STR20_40_80) ||
69  (ui32LowDrvStr == AONIOC_DRV_STR28_56_112) ||
70  (ui32LowDrvStr == AONIOC_DRV_STR40_80_112));
71  ASSERT((ui32MedDrvStr == AONIOC_DRV_STR5_7_14) ||
72  (ui32MedDrvStr == AONIOC_DRV_STR5_10_20) ||
73  (ui32MedDrvStr == AONIOC_DRV_STR7_14_28) ||
74  (ui32MedDrvStr == AONIOC_DRV_STR10_20_40) ||
75  (ui32MedDrvStr == AONIOC_DRV_STR14_28_56) ||
76  (ui32MedDrvStr == AONIOC_DRV_STR20_40_80) ||
77  (ui32MedDrvStr == AONIOC_DRV_STR28_56_112) ||
78  (ui32MedDrvStr == AONIOC_DRV_STR40_80_112));
79  ASSERT((ui32MaxDrvStr == AONIOC_DRV_STR5_7_14) ||
80  (ui32MaxDrvStr == AONIOC_DRV_STR5_10_20) ||
81  (ui32MaxDrvStr == AONIOC_DRV_STR7_14_28) ||
82  (ui32MaxDrvStr == AONIOC_DRV_STR10_20_40) ||
83  (ui32MaxDrvStr == AONIOC_DRV_STR14_28_56) ||
84  (ui32MaxDrvStr == AONIOC_DRV_STR20_40_80) ||
85  (ui32MaxDrvStr == AONIOC_DRV_STR28_56_112) ||
86  (ui32MaxDrvStr == AONIOC_DRV_STR40_80_112));
87 
88  //
89  // Set the minimum drive strength.
90  //
91  HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMIN) = ui32LowDrvStr &
93  //
94  // Set the medium drive strength.
95  //
96  HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMED) = ui32MedDrvStr &
98  //
99  // Set the maximum drive strength.
100  //
101  HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMAX) = ui32MaxDrvStr &
103 
104 }
105 
106 //*****************************************************************************
107 //
109 //
110 //*****************************************************************************
111 uint32_t
112 AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
113 {
114  uint32_t ui32DrvStr;
115 
116  //
117  // Check the arguments.
118  //
119  ASSERT((ui32DriveLevel == AONIOC_MAX_DRIVE) ||
120  (ui32DriveLevel == AONIOC_MED_DRIVE) ||
121  (ui32DriveLevel == AONIOC_MIN_DRIVE));
122 
123  //
124  // Get the specified drive strength level.
125  //
126  if(ui32DriveLevel == AONIOC_MAX_DRIVE)
127  {
128  ui32DrvStr = HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMAX);
129  }
130  else if(ui32DriveLevel == AONIOC_MED_DRIVE)
131  {
132  ui32DrvStr = HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMED);
133  }
134  else
135  {
136  ui32DrvStr = HWREG(AON_IOC_BASE + AON_IOC_O_IOSTRMIN);
137  }
138 
139  //
140  // Return the drive strength value.
141  //
142  return(ui32DrvStr);
143 }
#define AONIOC_DRV_STR14_28_56
Definition: aon_ioc.h:96
#define AONIOC_DRV_STR5_10_20
Definition: aon_ioc.h:93
#define AONIOC_MIN_DRIVE
Definition: aon_ioc.h:103
#define AONIOC_DRV_STR7_14_28
Definition: aon_ioc.h:94
#define AONIOC_DRV_STR5_7_14
Definition: aon_ioc.h:92
#define AONIOC_DRV_STR28_56_112
Definition: aon_ioc.h:98
#define AONIOC_MED_DRIVE
Definition: aon_ioc.h:102
#define ASSERT(expr)
Definition: debug.h:74
#define AONIOC_MAX_DRIVE
Definition: aon_ioc.h:101
uint32_t AONIOCDriveStrengthGet(uint32_t ui32DriveLevel)
Get a specific drive level setting for all IOs.
Definition: aon_ioc.c:112
#define AONIOC_DRV_STR20_40_80
Definition: aon_ioc.h:97
#define AONIOC_DRV_STR10_20_40
Definition: aon_ioc.h:95
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
#define AONIOC_DRV_STR40_80_112
Definition: aon_ioc.h:99