Hardware Reference
In-Depth Information
Table 9-6. UART0 Pins
Function
GPIO
P1/P5
ALT
Direction
Description
TXD
14
P1-08
0
Out
DTE transmitted data
RXD
15
P1-10
0
In
DTE received data
RTS
17
P1-11
3
Out
Request to send
CTS
30
P5-05
3
In
Clear to send
RTS/CTS Access
Hardware flow controls CTS and RTS are available on GPIO 30 and 17, respectively, when
configured. By default these are GPIO inputs, but this can be changed. To gain access
to the UART's CTS and RTS signals, configure GPIO 30 and 17 to alternate function 3.
Table 9-6 summarizes the connections that are used by the UART.
The following short C program shows how to gain access to these signals. The listing
for the included source file gpio_io.c is given in the “Direct Register Access” section of
Chapter 10.
1 /*****************************************************************
2 * rtscts.c Configure GPIO 17 & 30 for RTS & CTS
3 ****************************************************************/
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <fcntl.h>
8 #include <unistd.h>
9 #include <errno.h>
10 #include <setjmp.h>
11 #include <sys/mman.h>
12 #include <signal.h>
13
14 #include "gpio_io.c" /* GPIO routines */
15
16 static inline void
17 gpio_setalt(intgpio, unsigned alt) {
18 INP_GPIO(gpio);
19 SET_GPIO_ALT(gpio, alt);
20 }
21
22 int
 
 
Search WWH ::




Custom Search