1 /******************************************************************************
2 * Filename: ioc.h
3 * Revised: 2020-02-14 11:30:20 +0100 (Fri, 14 Feb 2020)
4 * Revision: 56760
5 *
6 * Description: Defines and prototypes for the IO Controller.
7 *
8 * Copyright (c) 2015 - 2017, 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 //
41 //! \addtogroup peripheral_group
42 //! @{
43 //! \addtogroup ioc_api
44 //! @{
45 //
46 //*****************************************************************************
47
48 #ifndef __IOC_H__
49 #define __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_ioc.h"
67 #include "../inc/hw_ints.h"
68 #include "interrupt.h"
69 #include "debug.h"
70 #include "gpio.h"
71
72 //*****************************************************************************
73 //
74 // Support for DriverLib in ROM:
75 // This section renames all functions that are not "static inline", so that
76 // calling these functions will default to implementation in flash. At the end
77 // of this file a second renaming will change the defaults to implementation in
78 // ROM for available functions.
79 //
80 // To force use of the implementation in flash, e.g. for debugging:
81 // - Globally: Define DRIVERLIB_NOROM at project level
82 // - Per function: Use prefix "NOROM_" when calling the function
83 //
84 //*****************************************************************************
85 #if !defined(DOXYGEN)
86 #define IOCPortConfigureSet NOROM_IOCPortConfigureSet
87 #define IOCPortConfigureGet NOROM_IOCPortConfigureGet
88 #define IOCIOShutdownSet NOROM_IOCIOShutdownSet
89 #define IOCIOModeSet NOROM_IOCIOModeSet
90 #define IOCIOIntSet NOROM_IOCIOIntSet
91 #define IOCIOEvtSet NOROM_IOCIOEvtSet
92 #define IOCIOPortPullSet NOROM_IOCIOPortPullSet
93 #define IOCIOHystSet NOROM_IOCIOHystSet
94 #define IOCIOInputSet NOROM_IOCIOInputSet
95 #define IOCIOSlewCtrlSet NOROM_IOCIOSlewCtrlSet
96 #define IOCIODrvStrengthSet NOROM_IOCIODrvStrengthSet
97 #define IOCIOPortIdSet NOROM_IOCIOPortIdSet
98 #define IOCIntEnable NOROM_IOCIntEnable
99 #define IOCIntDisable NOROM_IOCIntDisable
100 #define IOCPinTypeGpioInput NOROM_IOCPinTypeGpioInput
101 #define IOCPinTypeGpioOutput NOROM_IOCPinTypeGpioOutput
102 #define IOCPinTypeUart NOROM_IOCPinTypeUart
103 #define IOCPinTypeSsiMaster NOROM_IOCPinTypeSsiMaster
104 #define IOCPinTypeSsiSlave NOROM_IOCPinTypeSsiSlave
105 #define IOCPinTypeI2c NOROM_IOCPinTypeI2c
106 #define IOCPinTypeAux NOROM_IOCPinTypeAux
107 #endif
108
109 //*****************************************************************************
110 //
111 // Number of IOs (max. total of 32)
112 //
113 //*****************************************************************************
114 #define NUM_IO_MAX 32
115
116 //*****************************************************************************
117 //
118 // The following fields are IO Id for the IOC module
119 //
120 //*****************************************************************************
121 #define IOID_0 0x00000000 // IO Id 0
122 #define IOID_1 0x00000001 // IO Id 1
123 #define IOID_2 0x00000002 // IO Id 2
124 #define IOID_3 0x00000003 // IO Id 3
125 #define IOID_4 0x00000004 // IO Id 4
126 #define IOID_5 0x00000005 // IO Id 5
127 #define IOID_6 0x00000006 // IO Id 6
128 #define IOID_7 0x00000007 // IO Id 7
129 #define IOID_8 0x00000008 // IO Id 8
130 #define IOID_9 0x00000009 // IO Id 9
131 #define IOID_10 0x0000000A // IO Id 10
132 #define IOID_11 0x0000000B // IO Id 11
133 #define IOID_12 0x0000000C // IO Id 12
134 #define IOID_13 0x0000000D // IO Id 13
135 #define IOID_14 0x0000000E // IO Id 14
136 #define IOID_15 0x0000000F // IO Id 15
137 #define IOID_16 0x00000010 // IO Id 16
138 #define IOID_17 0x00000011 // IO Id 17
139 #define IOID_18 0x00000012 // IO Id 18
140 #define IOID_19 0x00000013 // IO Id 19
141 #define IOID_20 0x00000014 // IO Id 20
142 #define IOID_21 0x00000015 // IO Id 21
143 #define IOID_22 0x00000016 // IO Id 22
144 #define IOID_23 0x00000017 // IO Id 23
145 #define IOID_24 0x00000018 // IO Id 24
146 #define IOID_25 0x00000019 // IO Id 25
147 #define IOID_26 0x0000001A // IO Id 26
148 #define IOID_27 0x0000001B // IO Id 27
149 #define IOID_28 0x0000001C // IO Id 28
150 #define IOID_29 0x0000001D // IO Id 29
151 #define IOID_30 0x0000001E // IO Id 30
152 #define IOID_31 0x0000001F // IO Id 31
153 #define IOID_UNUSED 0xFFFFFFFF // Unused IO Id
154
155 #define IOC_IOID_MASK 0x000000FF // IOC IO Id bit mask
156
157 //*****************************************************************************
158 //
159 // Number of IO ports
160 //
161 //*****************************************************************************
162 #define NUM_IO_PORTS 56
163
164 //*****************************************************************************
165 //
166 // IOC Peripheral Port Mapping
167 //
168 //*****************************************************************************
169 #define IOC_PORT_GPIO 0x00000000 // Default general purpose IO usage
170 #define IOC_PORT_AON_CLK32K 0x00000007 // AON External 32kHz clock
171 #define IOC_PORT_AUX_IO 0x00000008 // AUX IO Pin
172 #define IOC_PORT_MCU_SSI0_RX 0x00000009 // MCU SSI0 Receive Pin
173 #define IOC_PORT_MCU_SSI0_TX 0x0000000A // MCU SSI0 Transmit Pin
174 #define IOC_PORT_MCU_SSI0_FSS 0x0000000B // MCU SSI0 FSS Pin
175 #define IOC_PORT_MCU_SSI0_CLK 0x0000000C // MCU SSI0 Clock Pin
176 #define IOC_PORT_MCU_I2C_MSSDA 0x0000000D // MCU I2C Data Pin
177 #define IOC_PORT_MCU_I2C_MSSCL 0x0000000E // MCU I2C Clock Pin
178 #define IOC_PORT_MCU_UART0_RX 0x0000000F // MCU UART0 Receive Pin
179 #define IOC_PORT_MCU_UART0_TX 0x00000010 // MCU UART0 Transmit Pin
180 #define IOC_PORT_MCU_UART0_CTS 0x00000011 // MCU UART0 Clear To Send Pin
181 #define IOC_PORT_MCU_UART0_RTS 0x00000012 // MCU UART0 Request To Send Pin
182 #define IOC_PORT_MCU_UART1_RX 0x00000013 // MCU UART1 Receive Pin
183 #define IOC_PORT_MCU_UART1_TX 0x00000014 // MCU UART1 Transmit Pin
184 #define IOC_PORT_MCU_UART1_CTS 0x00000015 // MCU UART1 Clear To Send Pin
185 #define IOC_PORT_MCU_UART1_RTS 0x00000016 // MCU UART1 Request To Send Pin
186 #define IOC_PORT_MCU_PORT_EVENT0 0x00000017 // MCU PORT EVENT 0
187 #define IOC_PORT_MCU_PORT_EVENT1 0x00000018 // MCU PORT EVENT 1
188 #define IOC_PORT_MCU_PORT_EVENT2 0x00000019 // MCU PORT EVENT 2
189 #define IOC_PORT_MCU_PORT_EVENT3 0x0000001A // MCU PORT EVENT 3
190 #define IOC_PORT_MCU_PORT_EVENT4 0x0000001B // MCU PORT EVENT 4
191 #define IOC_PORT_MCU_PORT_EVENT5 0x0000001C // MCU PORT EVENT 5
192 #define IOC_PORT_MCU_PORT_EVENT6 0x0000001D // MCU PORT EVENT 6
193 #define IOC_PORT_MCU_PORT_EVENT7 0x0000001E // MCU PORT EVENT 7
194 #define IOC_PORT_MCU_SWV 0x00000020 // Serial Wire Viewer
195 #define IOC_PORT_MCU_SSI1_RX 0x00000021 // MCU SSI1 Receive Pin
196 #define IOC_PORT_MCU_SSI1_TX 0x00000022 // MCU SSI1 Transmit Pin
197 #define IOC_PORT_MCU_SSI1_FSS 0x00000023 // MCU SSI1 FSS Pin
198 #define IOC_PORT_MCU_SSI1_CLK 0x00000024 // MCU SSI1 Clock Pin
199 #define IOC_PORT_MCU_I2S_AD0 0x00000025 // MCU I2S Data Pin 0
200 #define IOC_PORT_MCU_I2S_AD1 0x00000026 // MCU I2S Data Pin 1
201 #define IOC_PORT_MCU_I2S_WCLK 0x00000027 // MCU I2S Frame/Word Clock
202 #define IOC_PORT_MCU_I2S_BCLK 0x00000028 // MCU I2S Bit Clock
203 #define IOC_PORT_MCU_I2S_MCLK 0x00000029 // MCU I2S Master clock 2
204 #define IOC_PORT_RFC_TRC 0x0000002E // RF Core Tracer
205 #define IOC_PORT_RFC_GPO0 0x0000002F // RC Core Data Out Pin 0
206 #define IOC_PORT_RFC_GPO1 0x00000030 // RC Core Data Out Pin 1
207 #define IOC_PORT_RFC_GPO2 0x00000031 // RC Core Data Out Pin 2
208 #define IOC_PORT_RFC_GPO3 0x00000032 // RC Core Data Out Pin 3
209 #define IOC_PORT_RFC_GPI0 0x00000033 // RC Core Data In Pin 0
210 #define IOC_PORT_RFC_GPI1 0x00000034 // RC Core Data In Pin 1
211 #define IOC_PORT_RFC_SMI_DL_OUT 0x00000035 // RF Core SMI Data Link Out
212 #define IOC_PORT_RFC_SMI_DL_IN 0x00000036 // RF Core SMI Data Link in
213 #define IOC_PORT_RFC_SMI_CL_OUT 0x00000037 // RF Core SMI Command Link Out
214 #define IOC_PORT_RFC_SMI_CL_IN 0x00000038 // RF Core SMI Command Link In
215
216 //*****************************************************************************
217 //
218 // Defines for enabling/disabling an IO
219 //
220 //*****************************************************************************
221 #define IOC_SLEW_ENABLE 0x00001000
222 #define IOC_SLEW_DISABLE 0x00000000
223 #define IOC_INPUT_ENABLE 0x20000000
224 #define IOC_INPUT_DISABLE 0x00000000
225 #define IOC_HYST_ENABLE 0x40000000
226 #define IOC_HYST_DISABLE 0x00000000
227
228 //*****************************************************************************
229 //
230 // Defines that can be used to set the shutdown mode of an IO
231 //
232 //*****************************************************************************
233 #define IOC_NO_WAKE_UP 0x00000000
234 #define IOC_WAKE_ON_LOW 0x10000000
235 #define IOC_WAKE_ON_HIGH 0x18000000
236
237 //*****************************************************************************
238 //
239 // Defines that can be used to set the IO Mode of an IO
240 //
241 //*****************************************************************************
242 #define IOC_IOMODE_NORMAL 0x00000000 // Normal Input/Output
243 #define IOC_IOMODE_INV 0x01000000 // Inverted Input/Output
244 #define IOC_IOMODE_OPEN_DRAIN_NORMAL \
245 0x04000000 // Open Drain, Normal Input/Output
246 #define IOC_IOMODE_OPEN_DRAIN_INV \
247 0x05000000 // Open Drain, Inverted
248 // Input/Output
249 #define IOC_IOMODE_OPEN_SRC_NORMAL \
250 0x06000000 // Open Source, Normal Input/Output
251 #define IOC_IOMODE_OPEN_SRC_INV \
252 0x07000000 // Open Source, Inverted
253 // Input/Output
254
255 //*****************************************************************************
256 //
257 // Defines that can be used to set the edge detection on an IO
258 //
259 //*****************************************************************************
260 #define IOC_NO_EDGE 0x00000000 // No edge detection
261 #define IOC_FALLING_EDGE 0x00010000 // Edge detection on falling edge
262 #define IOC_RISING_EDGE 0x00020000 // Edge detection on rising edge
263 #define IOC_BOTH_EDGES 0x00030000 // Edge detection on both edges
264 #define IOC_INT_ENABLE 0x00040000 // Enable interrupt on edge detect
265 #define IOC_INT_DISABLE 0x00000000 // Disable interrupt on edge detect
266 #define IOC_INT_M 0x00070000 // Int config mask
267
268 //*****************************************************************************
269 //
270 // Defines that be used to set pull on an IO
271 //
272 //*****************************************************************************
273 #define IOC_NO_IOPULL 0x00006000 // No IO pull
274 #define IOC_IOPULL_UP 0x00004000 // Pull up
275 #define IOC_IOPULL_DOWN 0x00002000 // Pull down
276 #define IOC_IOPULL_M 0x00006000 // Pull config mask
277 #define IOC_IOPULL_M 0x00006000
278
279 //*****************************************************************************
280 //
281 // Defines that can be used to select the drive strength of an IO
282 //
283 //*****************************************************************************
284 #define IOC_CURRENT_2MA 0x00000000 // 2mA drive strength
285 #define IOC_CURRENT_4MA 0x00000400 // 4mA drive strength
286 #define IOC_CURRENT_8MA 0x00000800 // 4 or 8mA drive strength
287
288 #define IOC_STRENGTH_AUTO 0x00000000 // Automatic Drive Strength
289 // (2/4/8 mA @ VVDS)
290 #define IOC_STRENGTH_MAX 0x00000300 // Maximum Drive Strength
291 // (2/4/8 mA @ 1.8V)
292 #define IOC_STRENGTH_MED 0x00000200 // Medium Drive Strength
293 // (2/4/8 mA @ 2.5V)
294 #define IOC_STRENGTH_MIN 0x00000100 // Minimum Drive Strength
295 // (2/4/8 mA @ 3.3V)
296
297 //*****************************************************************************
298 //
299 // Defines that can be used to enable event generation on edge detect
300 //
301 //*****************************************************************************
302 #define IOC_EVT_AON_PROG2_DISABLE 0x00000000
303 #define IOC_EVT_AON_PROG2_ENABLE 0x00800000
304 #define IOC_EVT_AON_PROG1_DISABLE 0x00000000
305 #define IOC_EVT_AON_PROG1_ENABLE 0x00400000
306 #define IOC_EVT_AON_PROG0_DISABLE 0x00000000
307 #define IOC_EVT_AON_PROG0_ENABLE 0x00200000
308 #define IOC_EVT_RTC_DISABLE 0x00000000
309 #define IOC_EVT_RTC_ENABLE 0x00000080
310 #define IOC_EVT_MCU_WU_DISABLE 0x00000000
311 #define IOC_EVT_MCU_WU_ENABLE 0x00000040
312
313 //*****************************************************************************
314 //
315 // Defines for standard IO setup
316 //
317 //*****************************************************************************
318 #define IOC_STD_INPUT (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
319 IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
320 IOC_HYST_DISABLE | IOC_NO_EDGE | \
321 IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
322 IOC_NO_WAKE_UP | IOC_INPUT_ENABLE )
323 #define IOC_STD_OUTPUT (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
324 IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
325 IOC_HYST_DISABLE | IOC_NO_EDGE | \
326 IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
327 IOC_NO_WAKE_UP | IOC_INPUT_DISABLE )
328
329 //*****************************************************************************
330 //
331 // API Functions and prototypes
332 //
333 //*****************************************************************************
334
335 //*****************************************************************************
336 //
337 //! \brief Set the configuration of an IO port.
338 //!
339 //! This function is used to configure the functionality of an IO.
340 //!
341 //! The \c ui32IOId parameter specifies which IO to configure.
342 //!
343 //! The \c ui32PortId parameter specifies which functional peripheral to hook
344 //! up to this IO.
345 //!
346 //! The \c ui32IOConfig parameter consists of a bitwise OR'ed value of all
347 //! the available configuration modes
348 //!
349 //! \note All IO Ports are tied to a specific functionality in a sub module
350 //! except for the \ref IOC_PORT_AUX_IO. Each of the IOs in the AUX domain are
351 //! hardcoded to a specific IO. When enabling one or more pins for the AUX
352 //! domain, they should all be configured to using \ref IOC_PORT_AUX_IO.
353 //!
354 //! \param ui32IOId defines the IO to configure and must be one of the following:
355 //! - \ref IOID_0
356 //! - ...
357 //! - \ref IOID_31
358 //! \param ui32PortId selects the functional IO port to connect.
359 //! The available IO ports are:
360 //! - \ref IOC_PORT_GPIO
361 //! - \ref IOC_PORT_AON_CLK32K
362 //! - \ref IOC_PORT_AUX_IO
363 //! - \ref IOC_PORT_MCU_SSI0_RX
364 //! - \ref IOC_PORT_MCU_SSI0_TX
365 //! - \ref IOC_PORT_MCU_SSI0_FSS
366 //! - \ref IOC_PORT_MCU_SSI0_CLK
367 //! - \ref IOC_PORT_MCU_I2C_MSSDA
368 //! - \ref IOC_PORT_MCU_I2C_MSSCL
369 //! - \ref IOC_PORT_MCU_UART0_RX
370 //! - \ref IOC_PORT_MCU_UART0_TX
371 //! - \ref IOC_PORT_MCU_UART0_CTS
372 //! - \ref IOC_PORT_MCU_UART0_RTS
373 //! - \ref IOC_PORT_MCU_UART1_RX
374 //! - \ref IOC_PORT_MCU_UART1_TX
375 //! - \ref IOC_PORT_MCU_UART1_CTS
376 //! - \ref IOC_PORT_MCU_UART1_RTS
377 //! - \ref IOC_PORT_MCU_PORT_EVENT0
378 //! - \ref IOC_PORT_MCU_PORT_EVENT1
379 //! - \ref IOC_PORT_MCU_PORT_EVENT2
380 //! - \ref IOC_PORT_MCU_PORT_EVENT3
381 //! - \ref IOC_PORT_MCU_PORT_EVENT4
382 //! - \ref IOC_PORT_MCU_PORT_EVENT5
383 //! - \ref IOC_PORT_MCU_PORT_EVENT6
384 //! - \ref IOC_PORT_MCU_PORT_EVENT7
385 //! - \ref IOC_PORT_MCU_SWV
386 //! - \ref IOC_PORT_MCU_SSI1_RX
387 //! - \ref IOC_PORT_MCU_SSI1_TX
388 //! - \ref IOC_PORT_MCU_SSI1_FSS
389 //! - \ref IOC_PORT_MCU_SSI1_CLK
390 //! - \ref IOC_PORT_MCU_I2S_AD0
391 //! - \ref IOC_PORT_MCU_I2S_AD1
392 //! - \ref IOC_PORT_MCU_I2S_WCLK
393 //! - \ref IOC_PORT_MCU_I2S_BCLK
394 //! - \ref IOC_PORT_MCU_I2S_MCLK
395 //! - \ref IOC_PORT_RFC_TRC
396 //! - \ref IOC_PORT_RFC_GPO0
397 //! - \ref IOC_PORT_RFC_GPO1
398 //! - \ref IOC_PORT_RFC_GPO2
399 //! - \ref IOC_PORT_RFC_GPO3
400 //! - \ref IOC_PORT_RFC_GPI0
401 //! - \ref IOC_PORT_RFC_GPI1
402 //! \param ui32IOConfig is the IO configuration consisting of
403 //! the bitwise OR of all configuration modes:
404 //! - Input/output mode:
405 //! - \ref IOC_IOMODE_NORMAL
406 //! - \ref IOC_IOMODE_INV
407 //! - \ref IOC_IOMODE_OPEN_DRAIN_NORMAL
408 //! - \ref IOC_IOMODE_OPEN_DRAIN_INV
409 //! - \ref IOC_IOMODE_OPEN_SRC_NORMAL
410 //! - \ref IOC_IOMODE_OPEN_SRC_INV
411 //! - Wake-up mode (from shutdown):
412 //! - \ref IOC_NO_WAKE_UP
413 //! - \ref IOC_WAKE_ON_LOW
414 //! - \ref IOC_WAKE_ON_HIGH
415 //! - Edge detection mode:
416 //! - \ref IOC_NO_EDGE
417 //! - \ref IOC_FALLING_EDGE
418 //! - \ref IOC_RISING_EDGE
419 //! - \ref IOC_BOTH_EDGES
420 //! - Interrupt mode on edge detection:
421 //! - \ref IOC_INT_ENABLE
422 //! - \ref IOC_INT_DISABLE
423 //! - Pull mode:
424 //! - \ref IOC_NO_IOPULL
425 //! - \ref IOC_IOPULL_UP
426 //! - \ref IOC_IOPULL_DOWN
427 //! - Input mode:
428 //! - \ref IOC_INPUT_ENABLE
429 //! - \ref IOC_INPUT_DISABLE
430 //! - Hysteresis mode:
431 //! - \ref IOC_HYST_ENABLE
432 //! - \ref IOC_HYST_DISABLE
433 //! - Slew rate reduction mode:
434 //! - \ref IOC_SLEW_ENABLE
435 //! - \ref IOC_SLEW_DISABLE
436 //! - Current mode (see \ref IOCIODrvStrengthSet() for more details):
437 //! - \ref IOC_CURRENT_2MA : Low-Current mode. Min 2 mA when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
438 //! - \ref IOC_CURRENT_4MA : High-Current mode. Min 4 mA when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
439 //! - \ref IOC_CURRENT_8MA : Extended-Current mode. Min 8 mA for double drive strength IOs (min 4 mA for normal IOs) when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
440 //! - Drive strength mode:
441 //! - \ref IOC_STRENGTH_AUTO : Automatic drive strength based on battery voltage.
442 //! - \ref IOC_STRENGTH_MAX : Maximum drive strength, used for low supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
443 //! - \ref IOC_STRENGTH_MED : Medium drive strength, used for medium supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
444 //! - \ref IOC_STRENGTH_MIN : Minimum drive strength, used for high supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
445 //! - Assert AON_PROG2 event on edge detection:
446 //! - \ref IOC_EVT_AON_PROG2_DISABLE
447 //! - \ref IOC_EVT_AON_PROG2_ENABLE
448 //! - Assert AON_PROG1 event on edge detection:
449 //! - \ref IOC_EVT_AON_PROG1_DISABLE
450 //! - \ref IOC_EVT_AON_PROG1_ENABLE
451 //! - Assert AON_PROG0 event on edge detection:
452 //! - \ref IOC_EVT_AON_PROG0_DISABLE
453 //! - \ref IOC_EVT_AON_PROG0_ENABLE
454 //! - Assert RTC event on edge detection:
455 //! - \ref IOC_EVT_RTC_DISABLE
456 //! - \ref IOC_EVT_RTC_ENABLE
457 //! - Assert MCU_WU event on edge detection:
458 //! - \ref IOC_EVT_MCU_WU_DISABLE
459 //! - \ref IOC_EVT_MCU_WU_ENABLE
460 //!
461 //! \return None
462 //
463 //*****************************************************************************
464 extern void IOCPortConfigureSet(uint32_t ui32IOId, uint32_t ui32PortId,
465 uint32_t ui32IOConfig);
466
467 //*****************************************************************************
468 //
469 //! \brief Get the configuration of an IO port.
470 //!
471 //! This function is used for getting the configuration of an IO.
472 //!
473 //! Each IO port has a dedicated register for setting up the IO. This function
474 //! returns the current configuration for the given IO.
475 //!
476 //! \param ui32IOId selects the IO to return the configuration for.
477 //! - \ref IOID_0
478 //! - ...
479 //! - \ref IOID_31
480 //!
481 //! \return Returns the IO Port configuration.
482 //! See \ref IOCPortConfigureSet() for configuration options.
483 //
484 //*****************************************************************************
485 extern uint32_t IOCPortConfigureGet(uint32_t ui32IOId);
486
487 //*****************************************************************************
488 //
489 //! \brief Set wake-up mode from shutdown on an IO port.
490 //!
491 //! This function is used to set the wake-up mode from shutdown of an IO.
492 //!
493 //! IO must be configured as input in order for wakeup to work. See \ref IOCIOInputSet().
494 //!
495 //! \param ui32IOId defines the IO to configure.
496 //! - \ref IOID_0
497 //! - ...
498 //! - \ref IOID_31
499 //! \param ui32IOShutdown enables wake-up from shutdown on LOW/HIGH by this IO port.
500 //! - \ref IOC_NO_WAKE_UP
501 //! - \ref IOC_WAKE_ON_LOW
502 //! - \ref IOC_WAKE_ON_HIGH
503 //!
504 //! \return None
505 //
506 //*****************************************************************************
507 extern void IOCIOShutdownSet(uint32_t ui32IOId, uint32_t ui32IOShutdown);
508
509
510 //*****************************************************************************
511 //
512 //! \brief Set the IO Mode of an IO Port.
513 //!
514 //! This function is used to set the input/output mode of an IO.
515 //!
516 //! \param ui32IOId defines the IO to configure.
517 //! - \ref IOID_0
518 //! - ...
519 //! - \ref IOID_31
520 //! \param ui32IOMode sets the port IO Mode.
521 //! - \ref IOC_IOMODE_NORMAL
522 //! - \ref IOC_IOMODE_INV
523 //! - \ref IOC_IOMODE_OPEN_DRAIN_NORMAL
524 //! - \ref IOC_IOMODE_OPEN_DRAIN_INV
525 //! - \ref IOC_IOMODE_OPEN_SRC_NORMAL
526 //! - \ref IOC_IOMODE_OPEN_SRC_INV
527 //!
528 //! \return None
529 //
530 //*****************************************************************************
531 extern void IOCIOModeSet(uint32_t ui32IOId, uint32_t ui32IOMode);
532
533 //*****************************************************************************
534 //
535 //! \brief Setup edge detection and interrupt generation on an IO Port.
536 //!
537 //! This function is used to setup the edge detection and interrupt generation on an IO.
538 //!
539 //! \param ui32IOId defines the IO to configure.
540 //! - \ref IOID_0
541 //! - ...
542 //! - \ref IOID_31
543 //! \param ui32Int enables/disables interrupt generation on this IO port.
544 //! - \ref IOC_INT_ENABLE
545 //! - \ref IOC_INT_DISABLE
546 //! \param ui32EdgeDet enables/disables edge detection events on this IO port.
547 //! - \ref IOC_NO_EDGE
548 //! - \ref IOC_FALLING_EDGE
549 //! - \ref IOC_RISING_EDGE
550 //! - \ref IOC_BOTH_EDGES
551 //!
552 //! \return None
553 //
554 //*****************************************************************************
555 extern void IOCIOIntSet(uint32_t ui32IOId, uint32_t ui32Int,
556 uint32_t ui32EdgeDet);
557
558 //*****************************************************************************
559 //
560 //! \brief Setup event generation on IO edge detection.
561 //!
562 //! This function is used to setup event generation for specific events
563 //! when an IO edge detection occurs.
564 //!
565 //! \param ui32IOId defines the IO to configure.
566 //! - \ref IOID_0
567 //! - ...
568 //! - \ref IOID_31
569 //! \param ui32Evt is a bitwise OR of the IO events to generate when an IO edge detection occurs.
570 //! All other IO event generations are disabled.
571 //! - \ref IOC_EVT_AON_PROG2_ENABLE : AON_PROG2 event.
572 //! - \ref IOC_EVT_AON_PROG1_ENABLE : AON_PROG1 event.
573 //! - \ref IOC_EVT_AON_PROG0_ENABLE : AON_PROG0 event.
574 //! - \ref IOC_EVT_RTC_ENABLE : RTC event.
575 //! - \ref IOC_EVT_MCU_WU_ENABLE : MCU_WU event.
576 //!
577 //
578 //*****************************************************************************
579 extern void IOCIOEvtSet(uint32_t ui32IOId, uint32_t ui32Evt);
580
581 //*****************************************************************************
582 //
583 //! \brief Set the pull on an IO port.
584 //!
585 //! This function is used to configure the pull on an IO.
586 //!
587 //! \param ui32IOId defines the IO to configure.
588 //! - \ref IOID_0
589 //! - ...
590 //! - \ref IOID_31
591 //! \param ui32Pull enables/disables pull on this IO port.
592 //! - \ref IOC_NO_IOPULL
593 //! - \ref IOC_IOPULL_UP
594 //! - \ref IOC_IOPULL_DOWN
595 //!
596 //! \return None
597 //
598 //*****************************************************************************
599 extern void IOCIOPortPullSet(uint32_t ui32IOId, uint32_t ui32Pull);
600
601 //*****************************************************************************
602 //
603 //! \brief Configure hysteresis on and IO port.
604 //!
605 //! This function is used to enable/disable hysteresis on an IO.
606 //!
607 //! \param ui32IOId defines the IO to configure.
608 //! - \ref IOID_0
609 //! - ...
610 //! - \ref IOID_31
611 //! \param ui32Hysteresis enable/disable input hysteresis on IO.
612 //! - \ref IOC_HYST_ENABLE
613 //! - \ref IOC_HYST_DISABLE
614 //!
615 //! \return None
616 //
617 //*****************************************************************************
618 extern void IOCIOHystSet(uint32_t ui32IOId, uint32_t ui32Hysteresis);
619
620 //*****************************************************************************
621 //
622 //! \brief Enable/disable IO port as input.
623 //!
624 //! This function is used to enable/disable input on an IO.
625 //!
626 //! \param ui32IOId defines the IO to configure.
627 //! - \ref IOID_0
628 //! - ...
629 //! - \ref IOID_31
630 //! \param ui32Input enable/disable input on IO.
631 //! - \ref IOC_INPUT_ENABLE
632 //! - \ref IOC_INPUT_DISABLE
633 //!
634 //! \return None
635 //
636 //*****************************************************************************
637 extern void IOCIOInputSet(uint32_t ui32IOId, uint32_t ui32Input);
638
639 //*****************************************************************************
640 //
641 //! \brief Configure slew rate on an IO port.
642 //!
643 //! This function is used to enable/disable reduced slew rate on an IO.
644 //!
645 //! \param ui32IOId defines the IO to configure.
646 //! - \ref IOID_0
647 //! - ...
648 //! - \ref IOID_31
649 //! \param ui32SlewEnable enables/disables reduced slew rate on an output.
650 //! - \ref IOC_SLEW_ENABLE
651 //! - \ref IOC_SLEW_DISABLE
652 //!
653 //! \return None
654 //
655 //*****************************************************************************
656 extern void IOCIOSlewCtrlSet(uint32_t ui32IOId, uint32_t ui32SlewEnable);
657
658 //*****************************************************************************
659 //
660 //! \brief Configure the drive strength source and current mode of an IO port.
661 //!
662 //! The drive strength of an IO is configured by a combination of multiple settings
663 //! in several modules. The drive strength source \ti_code{ui32DrvStrength} is used for controlling
664 //! drive strength at different supply levels. When set to AUTO the battery monitor
665 //! (BATMON) adjusts the drive strength to compensate for changes in supply voltage
666 //! in order to keep IO current constant. Alternatively, drive strength source can
667 //! be controlled manually by selecting one of three options each of which is configurable
668 //! in the AON IOC by \ref AONIOCDriveStrengthSet().
669 //!
670 //! Each drive strength source has three current modes: Low-Current (LC), High-Current (HC), and
671 //! Extended-Current (EC), and typically drive strength doubles when selecting a higher mode.
672 //! I.e. EC = 2 x HC = 4 x LC.
673 //!
674 //! \note Not all IOs support Extended-Current mode. See datasheet for more information
675 //! on the specific device.
676 //!
677 //! \param ui32IOId defines the IO to configure.
678 //! - \ref IOID_0
679 //! - ...
680 //! - \ref IOID_31
681 //! \param ui32IOCurrent selects the IO current mode.
682 //! - \ref IOC_CURRENT_2MA : Low-Current mode. Min 2 mA when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
683 //! - \ref IOC_CURRENT_4MA : High-Current mode. Min 4 mA when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
684 //! - \ref IOC_CURRENT_8MA : Extended-Current mode. Min 8 mA for double drive strength IOs (min 4 mA for normal IOs) when \ti_code{ui32DrvStrength} is set to \ref IOC_STRENGTH_AUTO.
685 //! \param ui32DrvStrength sets the source for drive strength control of the IO port.
686 //! - \ref IOC_STRENGTH_AUTO : Automatic drive strength based on battery voltage.
687 //! - \ref IOC_STRENGTH_MAX : Maximum drive strength, used for low supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
688 //! - \ref IOC_STRENGTH_MED : Medium drive strength, used for medium supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
689 //! - \ref IOC_STRENGTH_MIN : Minimum drive strength, used for high supply levels. Controlled by AON IOC (see \ref AONIOCDriveStrengthSet()).
690 //!
691 //! \return None
692 //
693 //*****************************************************************************
694 extern void IOCIODrvStrengthSet(uint32_t ui32IOId, uint32_t ui32IOCurrent,
695 uint32_t ui32DrvStrength);
696
697 //*****************************************************************************
698 //
699 //! \brief Setup the Port ID for this IO.
700 //!
701 //! The \c ui32PortId specifies which functional peripheral to hook up to this
702 //! IO.
703 //!
704 //! \param ui32IOId defines the IO to configure.
705 //! - \ref IOID_0
706 //! - ...
707 //! - \ref IOID_31
708 //! \param ui32PortId selects the port to map to the IO.
709 //! - \ref IOC_PORT_GPIO
710 //! - \ref IOC_PORT_AON_CLK32K
711 //! - \ref IOC_PORT_AUX_IO
712 //! - \ref IOC_PORT_MCU_SSI0_RX
713 //! - \ref IOC_PORT_MCU_SSI0_TX
714 //! - \ref IOC_PORT_MCU_SSI0_FSS
715 //! - \ref IOC_PORT_MCU_SSI0_CLK
716 //! - \ref IOC_PORT_MCU_I2C_MSSDA
717 //! - \ref IOC_PORT_MCU_I2C_MSSCL
718 //! - \ref IOC_PORT_MCU_UART0_RX
719 //! - \ref IOC_PORT_MCU_UART0_TX
720 //! - \ref IOC_PORT_MCU_UART0_CTS
721 //! - \ref IOC_PORT_MCU_UART0_RTS
722 //! - \ref IOC_PORT_MCU_UART1_RX
723 //! - \ref IOC_PORT_MCU_UART1_TX
724 //! - \ref IOC_PORT_MCU_UART1_CTS
725 //! - \ref IOC_PORT_MCU_UART1_RTS
726 //! - \ref IOC_PORT_MCU_PORT_EVENT0
727 //! - \ref IOC_PORT_MCU_PORT_EVENT1
728 //! - \ref IOC_PORT_MCU_PORT_EVENT2
729 //! - \ref IOC_PORT_MCU_PORT_EVENT3
730 //! - \ref IOC_PORT_MCU_PORT_EVENT4
731 //! - \ref IOC_PORT_MCU_PORT_EVENT5
732 //! - \ref IOC_PORT_MCU_PORT_EVENT6
733 //! - \ref IOC_PORT_MCU_PORT_EVENT7
734 //! - \ref IOC_PORT_MCU_SWV
735 //! - \ref IOC_PORT_MCU_SSI1_RX
736 //! - \ref IOC_PORT_MCU_SSI1_TX
737 //! - \ref IOC_PORT_MCU_SSI1_FSS
738 //! - \ref IOC_PORT_MCU_SSI1_CLK
739 //! - \ref IOC_PORT_MCU_I2S_AD0
740 //! - \ref IOC_PORT_MCU_I2S_AD1
741 //! - \ref IOC_PORT_MCU_I2S_WCLK
742 //! - \ref IOC_PORT_MCU_I2S_BCLK
743 //! - \ref IOC_PORT_MCU_I2S_MCLK
744 //! - \ref IOC_PORT_RFC_TRC
745 //! - \ref IOC_PORT_RFC_GPO0
746 //! - \ref IOC_PORT_RFC_GPO1
747 //! - \ref IOC_PORT_RFC_GPO2
748 //! - \ref IOC_PORT_RFC_GPO3
749 //! - \ref IOC_PORT_RFC_GPI0
750 //! - \ref IOC_PORT_RFC_GPI1
751 //!
752 //! \return None
753 //
754 //*****************************************************************************
755 extern void IOCIOPortIdSet(uint32_t ui32IOId, uint32_t ui32PortId);
756
757 //*****************************************************************************
758 //
759 //! \brief Register an interrupt handler for an IO edge interrupt in the dynamic interrupt table.
760 //!
761 //! \note Only use this function if you want to use the dynamic vector table (in SRAM)!
762 //!
763 //! This function registers a function as the interrupt handler for a specific
764 //! interrupt and enables the corresponding interrupt in the interrupt controller.
765 //!
766 //! Specific IO interrupts must be enabled via \ref IOCIntEnable(). It is the interrupt
767 //! handler's responsibility to clear the interrupt source.
768 //!
769 //! \param pfnHandler is a pointer to the function to be called when the
770 //! IOC interrupt occurs.
771 //!
772 //! \return None
773 //!
774 //! \sa \ref IntRegister() for important information about registering interrupt
775 //! handlers.
776 //
777 //*****************************************************************************
778 __STATIC_INLINE void
IOCIntRegister(void (* pfnHandler)(void))779 IOCIntRegister(void (*pfnHandler)(void))
780 {
781 // Register the interrupt handler.
782 IntRegister(INT_AON_GPIO_EDGE, pfnHandler);
783
784 // Enable the IO edge interrupt.
785 IntEnable(INT_AON_GPIO_EDGE);
786 }
787
788 //*****************************************************************************
789 //
790 //! \brief Unregisters an interrupt handler for a IO edge interrupt in the dynamic interrupt table.
791 //!
792 //! This function does the actual unregistering of the interrupt handler. It
793 //! clears the handler to be called when an IO edge interrupt occurs.
794 //!
795 //! \return None
796 //!
797 //! \sa \ref IntRegister() for important information about registering interrupt
798 //! handlers.
799 //
800 //*****************************************************************************
801 __STATIC_INLINE void
IOCIntUnregister(void)802 IOCIntUnregister(void)
803 {
804 // Disable the interrupts.
805 IntDisable(INT_AON_GPIO_EDGE);
806
807 // Unregister the interrupt handler.
808 IntUnregister(INT_AON_GPIO_EDGE);
809 }
810
811 //*****************************************************************************
812 //
813 //! \brief Enables individual IO edge detect interrupt.
814 //!
815 //! This function enables the indicated IO edge interrupt sources. Only the
816 //! sources that are enabled can be reflected to the processor interrupt;
817 //! disabled sources have no effect on the processor.
818 //!
819 //! \param ui32IOId is the IO to enable edge detect interrupt for.
820 //!
821 //! \return None
822 //
823 //*****************************************************************************
824 extern void IOCIntEnable(uint32_t ui32IOId);
825
826 //*****************************************************************************
827 //
828 //! \brief Disables individual IO edge interrupt sources.
829 //!
830 //! This function disables the indicated IO edge interrupt source. Only the
831 //! sources that are enabled can be reflected to the processor interrupt;
832 //! disabled sources have no effect on the processor.
833 //!
834 //! \param ui32IOId is the IO edge interrupt source to be disabled.
835 //! - \ref IOID_0
836 //! - ...
837 //! - \ref IOID_31
838 //!
839 //! \return None
840 //
841 //*****************************************************************************
842 extern void IOCIntDisable(uint32_t ui32IOId);
843
844 //*****************************************************************************
845 //
846 //! \brief Clears the IO edge interrupt source.
847 //!
848 //! The specified IO edge interrupt source is cleared, so that it no longer
849 //! asserts. This function must be called in the interrupt handler to keep the
850 //! interrupt from being recognized again immediately upon exit.
851 //!
852 //! \note Due to write buffers and synchronizers in the system it may take several
853 //! clock cycles from a register write clearing an event in a module and until the
854 //! event is actually cleared in the NVIC of the system CPU. It is recommended to
855 //! clear the event source early in the interrupt service routine (ISR) to allow
856 //! the event clear to propagate to the NVIC before returning from the ISR.
857 //! At the same time, an early event clear allows new events of the same type to be
858 //! pended instead of ignored if the event is cleared later in the ISR.
859 //! It is the responsibility of the programmer to make sure that enough time has passed
860 //! before returning from the ISR to avoid false re-triggering of the cleared event.
861 //! A simple, although not necessarily optimal, way of clearing an event before
862 //! returning from the ISR is:
863 //! -# Write to clear event (interrupt source). (buffered write)
864 //! -# Dummy read from the event source module. (making sure the write has propagated)
865 //! -# Wait two system CPU clock cycles (user code or two NOPs). (allowing cleared event to propagate through any synchronizers)
866 //!
867 //! \param ui32IOId is the IO causing the interrupt.
868 //! - \ref IOID_0
869 //! - ...
870 //! - \ref IOID_31
871 //!
872 //! \return None
873 //
874 //*****************************************************************************
875 __STATIC_INLINE void
IOCIntClear(uint32_t ui32IOId)876 IOCIntClear(uint32_t ui32IOId)
877 {
878 // Check the arguments.
879 ASSERT(ui32IOId <= IOID_31);
880
881 // Clear the requested interrupt source by clearing the event.
882 GPIO_clearEventDio(ui32IOId);
883 }
884
885 //*****************************************************************************
886 //
887 //! \brief Returns the status of the IO interrupts.
888 //!
889 //! \param ui32IOId is the IO to get the status for.
890 //! - \ref IOID_0
891 //! - ...
892 //! - \ref IOID_31
893 //!
894 //! \return None
895 //
896 //*****************************************************************************
897 __STATIC_INLINE uint32_t
IOCIntStatus(uint32_t ui32IOId)898 IOCIntStatus(uint32_t ui32IOId)
899 {
900 // Check the arguments.
901 ASSERT(ui32IOId <= IOID_31);
902
903 // Get the event status.
904 return (GPIO_getEventDio(ui32IOId));
905 }
906
907
908 //*****************************************************************************
909 //
910 //! \brief Setup an IO for standard GPIO input.
911 //!
912 //! Setup an IO for standard GPIO input with the following configuration:
913 //! - Port ID:
914 //! - \ref IOC_PORT_GPIO
915 //! - Configuration:
916 //! - \ref IOC_CURRENT_2MA
917 //! - \ref IOC_STRENGTH_AUTO
918 //! - \ref IOC_NO_IOPULL
919 //! - \ref IOC_SLEW_DISABLE
920 //! - \ref IOC_HYST_DISABLE
921 //! - \ref IOC_NO_EDGE
922 //! - \ref IOC_INT_DISABLE
923 //! - \ref IOC_IOMODE_NORMAL
924 //! - \ref IOC_NO_WAKE_UP
925 //! - \ref IOC_INPUT_ENABLE
926 //!
927 //! \param ui32IOId is the IO to setup for GPIO input
928 //! - \ref IOID_0
929 //! - ...
930 //! - \ref IOID_31
931 //!
932 //! \return None
933 //
934 //*****************************************************************************
935 extern void IOCPinTypeGpioInput(uint32_t ui32IOId);
936
937 //*****************************************************************************
938 //
939 //! \brief Setup an IO for standard GPIO output.
940 //!
941 //! Setup an IO for standard GPIO output with the following configuration:
942 //! - Port ID:
943 //! - \ref IOC_PORT_GPIO
944 //! - Configuration:
945 //! - \ref IOC_CURRENT_2MA
946 //! - \ref IOC_STRENGTH_AUTO
947 //! - \ref IOC_NO_IOPULL
948 //! - \ref IOC_SLEW_DISABLE
949 //! - \ref IOC_HYST_DISABLE
950 //! - \ref IOC_NO_EDGE
951 //! - \ref IOC_INT_DISABLE
952 //! - \ref IOC_IOMODE_NORMAL
953 //! - \ref IOC_NO_WAKE_UP
954 //! - \ref IOC_INPUT_DISABLE
955 //!
956 //! \param ui32IOId is the IO to setup for GPIO output
957 //! - \ref IOID_0
958 //! - ...
959 //! - \ref IOID_31
960 //!
961 //! \return None
962 //
963 //*****************************************************************************
964 extern void IOCPinTypeGpioOutput(uint32_t ui32IOId);
965
966 //*****************************************************************************
967 //
968 //! \brief Configure a set of IOs for standard UART peripheral control.
969 //!
970 //! The UART pins must be properly configured for the UART peripheral to
971 //! function correctly. This function provides a typical configuration for
972 //! those pin(s). Other configurations may work as well depending upon the
973 //! board setup (for example, using the on-chip pull-ups).
974 //!
975 //! \note If a UART pin is not intended to be used, then the parameter in the
976 //! function should be \ref IOID_UNUSED.
977 //!
978 //! \param ui32Base is the base address of the UART module.
979 //! \param ui32Rx is the IO Id of the IO to use as UART Receive.
980 //! - \ref IOID_0
981 //! - ...
982 //! - \ref IOID_31
983 //! - \ref IOID_UNUSED
984 //! \param ui32Tx is the IO Id of the IO to use as UART Transmit.
985 //! - \ref IOID_0
986 //! - ...
987 //! - \ref IOID_31
988 //! - \ref IOID_UNUSED
989 //! \param ui32Cts is the IO Id of the IO to use for UART Clear to send.
990 //! - \ref IOID_0
991 //! - ...
992 //! - \ref IOID_31
993 //! - \ref IOID_UNUSED
994 //! \param ui32Rts is the IO Id of the IO to use for UART Request to send.
995 //! - \ref IOID_0
996 //! - ...
997 //! - \ref IOID_31
998 //! - \ref IOID_UNUSED
999 //!
1000 //! \return None
1001 //
1002 //*****************************************************************************
1003 extern void IOCPinTypeUart(uint32_t ui32Base, uint32_t ui32Rx,
1004 uint32_t ui32Tx, uint32_t ui32Cts,
1005 uint32_t ui32Rts);
1006
1007 //*****************************************************************************
1008 //
1009 //! \brief Configure a set of IOs for standard SSI peripheral master control.
1010 //!
1011 //! \param ui32Base is the base address of the SSI module to connect to the IOs
1012 //! \param ui32Rx is the IO to connect to the SSI MISO line.
1013 //! - \ref IOID_0
1014 //! - ...
1015 //! - \ref IOID_31
1016 //! - \ref IOID_UNUSED
1017 //! \param ui32Tx is the IO to connect to the SSI MOSI line.
1018 //! - \ref IOID_0
1019 //! - ...
1020 //! - \ref IOID_31
1021 //! - \ref IOID_UNUSED
1022 //! \param ui32Fss is the IO to connect to the SSI FSS line.
1023 //! - \ref IOID_0
1024 //! - ...
1025 //! - \ref IOID_31
1026 //! - \ref IOID_UNUSED
1027 //! \param ui32Clk is the IO to connect to the SSI Clock output line.
1028 //! - \ref IOID_0
1029 //! - ...
1030 //! - \ref IOID_31
1031 //! - \ref IOID_UNUSED
1032 //!
1033 //! \return None
1034 //
1035 //*****************************************************************************
1036 extern void IOCPinTypeSsiMaster(uint32_t ui32Base, uint32_t ui32Rx,
1037 uint32_t ui32Tx, uint32_t ui32Fss,
1038 uint32_t ui32Clk);
1039
1040 //*****************************************************************************
1041 //
1042 //! \brief Configure a set of IOs for standard SSI peripheral slave control.
1043 //!
1044 //! \param ui32Base is the base address of the SSI module to connect to the IOs
1045 //! \param ui32Rx is the IO to connect to the SSI MOSI line.
1046 //! - \ref IOID_0
1047 //! - ...
1048 //! - \ref IOID_31
1049 //! - \ref IOID_UNUSED
1050 //! \param ui32Tx is the IO to connect to the SSI MISO line.
1051 //! - \ref IOID_0
1052 //! - ...
1053 //! - \ref IOID_31
1054 //! - \ref IOID_UNUSED
1055 //! \param ui32Fss is the IO to connect to the SSI FSS line.
1056 //! - \ref IOID_0
1057 //! - ...
1058 //! - \ref IOID_31
1059 //! - \ref IOID_UNUSED
1060 //! \param ui32Clk is the IO to connect to the SSI Clock input line.
1061 //!
1062 //! \return None
1063 //
1064 //*****************************************************************************
1065 extern void IOCPinTypeSsiSlave(uint32_t ui32Base, uint32_t ui32Rx,
1066 uint32_t ui32Tx, uint32_t ui32Fss,
1067 uint32_t ui32Clk);
1068
1069 //*****************************************************************************
1070 //
1071 //! \brief Configure a set of IOs for standard I2C peripheral control.
1072 //!
1073 //! \param ui32Base is the base address of the I2C module to connect to the IOs
1074 //! \param ui32Data is the I2C data line
1075 //! - \ref IOID_0
1076 //! - ...
1077 //! - \ref IOID_31
1078 //! - \ref IOID_UNUSED
1079 //! \param ui32Clk is the I2C input clock
1080 //! - \ref IOID_0
1081 //! - ...
1082 //! - \ref IOID_31
1083 //! - \ref IOID_UNUSED
1084 //!
1085 //! \return None
1086 //
1087 //*****************************************************************************
1088 extern void IOCPinTypeI2c(uint32_t ui32Base, uint32_t ui32Data,
1089 uint32_t ui32Clk);
1090
1091
1092 //*****************************************************************************
1093 //
1094 //! \brief Configure an IO for AUX control.
1095 //!
1096 //! Use this function to enable AUX to control a specific IO. Please note, that
1097 //! when using AUX to control the IO, the input/output control in the IOC is
1098 //! bypassed and completely controlled by AUX, so enabling or disabling input
1099 //! in the IOC has no effect.
1100 //!
1101 //! \note The IOs available for AUX control can vary from device to device.
1102 //!
1103 //! \param ui32IOId is the IO to setup for AUX usage.
1104 //! - \ref IOID_0
1105 //! - ...
1106 //! - \ref IOID_31
1107 //! - \ref IOID_UNUSED
1108 //!
1109 //! \return None
1110 //
1111 //*****************************************************************************
1112 extern void IOCPinTypeAux(uint32_t ui32IOId);
1113
1114 //*****************************************************************************
1115 //
1116 // Support for DriverLib in ROM:
1117 // Redirect to implementation in ROM when available.
1118 //
1119 //*****************************************************************************
1120 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
1121 #include "../driverlib/rom.h"
1122 #ifdef ROM_IOCPortConfigureSet
1123 #undef IOCPortConfigureSet
1124 #define IOCPortConfigureSet ROM_IOCPortConfigureSet
1125 #endif
1126 #ifdef ROM_IOCPortConfigureGet
1127 #undef IOCPortConfigureGet
1128 #define IOCPortConfigureGet ROM_IOCPortConfigureGet
1129 #endif
1130 #ifdef ROM_IOCIOShutdownSet
1131 #undef IOCIOShutdownSet
1132 #define IOCIOShutdownSet ROM_IOCIOShutdownSet
1133 #endif
1134 #ifdef ROM_IOCIOModeSet
1135 #undef IOCIOModeSet
1136 #define IOCIOModeSet ROM_IOCIOModeSet
1137 #endif
1138 #ifdef ROM_IOCIOIntSet
1139 #undef IOCIOIntSet
1140 #define IOCIOIntSet ROM_IOCIOIntSet
1141 #endif
1142 #ifdef ROM_IOCIOEvtSet
1143 #undef IOCIOEvtSet
1144 #define IOCIOEvtSet ROM_IOCIOEvtSet
1145 #endif
1146 #ifdef ROM_IOCIOPortPullSet
1147 #undef IOCIOPortPullSet
1148 #define IOCIOPortPullSet ROM_IOCIOPortPullSet
1149 #endif
1150 #ifdef ROM_IOCIOHystSet
1151 #undef IOCIOHystSet
1152 #define IOCIOHystSet ROM_IOCIOHystSet
1153 #endif
1154 #ifdef ROM_IOCIOInputSet
1155 #undef IOCIOInputSet
1156 #define IOCIOInputSet ROM_IOCIOInputSet
1157 #endif
1158 #ifdef ROM_IOCIOSlewCtrlSet
1159 #undef IOCIOSlewCtrlSet
1160 #define IOCIOSlewCtrlSet ROM_IOCIOSlewCtrlSet
1161 #endif
1162 #ifdef ROM_IOCIODrvStrengthSet
1163 #undef IOCIODrvStrengthSet
1164 #define IOCIODrvStrengthSet ROM_IOCIODrvStrengthSet
1165 #endif
1166 #ifdef ROM_IOCIOPortIdSet
1167 #undef IOCIOPortIdSet
1168 #define IOCIOPortIdSet ROM_IOCIOPortIdSet
1169 #endif
1170 #ifdef ROM_IOCIntEnable
1171 #undef IOCIntEnable
1172 #define IOCIntEnable ROM_IOCIntEnable
1173 #endif
1174 #ifdef ROM_IOCIntDisable
1175 #undef IOCIntDisable
1176 #define IOCIntDisable ROM_IOCIntDisable
1177 #endif
1178 #ifdef ROM_IOCPinTypeGpioInput
1179 #undef IOCPinTypeGpioInput
1180 #define IOCPinTypeGpioInput ROM_IOCPinTypeGpioInput
1181 #endif
1182 #ifdef ROM_IOCPinTypeGpioOutput
1183 #undef IOCPinTypeGpioOutput
1184 #define IOCPinTypeGpioOutput ROM_IOCPinTypeGpioOutput
1185 #endif
1186 #ifdef ROM_IOCPinTypeUart
1187 #undef IOCPinTypeUart
1188 #define IOCPinTypeUart ROM_IOCPinTypeUart
1189 #endif
1190 #ifdef ROM_IOCPinTypeSsiMaster
1191 #undef IOCPinTypeSsiMaster
1192 #define IOCPinTypeSsiMaster ROM_IOCPinTypeSsiMaster
1193 #endif
1194 #ifdef ROM_IOCPinTypeSsiSlave
1195 #undef IOCPinTypeSsiSlave
1196 #define IOCPinTypeSsiSlave ROM_IOCPinTypeSsiSlave
1197 #endif
1198 #ifdef ROM_IOCPinTypeI2c
1199 #undef IOCPinTypeI2c
1200 #define IOCPinTypeI2c ROM_IOCPinTypeI2c
1201 #endif
1202 #ifdef ROM_IOCPinTypeAux
1203 #undef IOCPinTypeAux
1204 #define IOCPinTypeAux ROM_IOCPinTypeAux
1205 #endif
1206 #endif
1207
1208 //*****************************************************************************
1209 //
1210 // Mark the end of the C bindings section for C++ compilers.
1211 //
1212 //*****************************************************************************
1213 #ifdef __cplusplus
1214 }
1215 #endif
1216
1217 #endif // __IOC_H__
1218
1219 //*****************************************************************************
1220 //
1221 //! Close the Doxygen group.
1222 //! @}
1223 //! @}
1224 //
1225 //*****************************************************************************
1226