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