]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/uart
Import sources from 2011-03-30 iso image - sys/man
[plan9front.git] / sys / man / 3 / uart
1 .TH UART 3 
2 .SH NAME
3 uart, eia \- serial communication control
4 .SH SYNOPSIS
5 .nf
6 .B bind -a #t /dev
7
8 .B /dev/eia0
9 .B /dev/eia0ctl
10 .B /dev/eia0status
11 .B /dev/eia1
12 .B /dev/eia1ctl
13 .B /dev/eia1status
14 \&...
15 .fi
16 .SH DESCRIPTION
17 .PP
18 The serial line devices serve a one-level directory,
19 giving access to the serial ports.
20 Device
21 .I n
22 is accessed through
23 .BI eia n
24 (the data file),
25 .BI eia n ctl
26 (the control file), and
27 .BI eia n status
28 (the read-only status file).
29 Reads of the data file will block until at least one byte is available.
30 The
31 control file
32 configures the port.
33 It accepts the following commands:
34 .TP
35 .BI b n
36 Set the baud rate to
37 .IR n .
38 .TP
39 .BI c n
40 Set hangup on DCD if
41 .I n
42 is non-zero; else clear it.
43 .TP
44 .BI d n
45 Set DTR if
46 .I n
47 is non-zero;
48 else clear it.
49 .TP
50 .BI e n
51 Set hangup on DSR if
52 .I n
53 is non-zero; else clear it.
54 .TP
55 .B f
56 Flush output queue.
57 .TP
58 .B h
59 Close input and output queues.
60 .TP
61 .BI i n
62 Enable/disable the FIFOs.
63 If
64 .I n
65 is zero the FIFOs are disabled;
66 otherwise
67 .I n
68 is taken as a trigger level for the FIFOs.
69 The trigger levels supported are device dependant,
70 but usually include 1, 4 and 8.
71 An unrecognised,
72 but non-zero,
73 value of
74 .I n
75 causes the maximum-supported trigger level to be set.
76 .TP
77 .BI k n
78 Send a break lasting
79 .I n
80 milliseconds.
81 .TP
82 .BI l n
83 Set number of bits per byte to
84 .IR n .
85 Legal values are 5, 6, 7, or 8.
86 .TP
87 .BI m n
88 Obey modem CTS signal if
89 .I n
90 is non-zero;
91 else clear it.
92 .TP
93 .B n
94 Make writes non-blocking.
95 .TP
96 .BI p c
97 Set parity to odd if
98 .I c
99 is
100 .BR o ,
101 to even if
102 .I c
103 is
104 .BR e ;
105 else set no parity.
106 .TP
107 .BI q n
108 Set input and output queue limits to
109 .IR n .
110 .TP
111 .BI r n
112 Set RTS if
113 .I n
114 is non-zero;
115 else clear it.
116 .TP
117 .BI s n
118 Set number of stop bits to
119 .IR n .
120 Legal values are 1 or 2.
121 .TP
122 .BI w n
123 Set the uart clock timer to
124 n times 100us.
125 .IP
126 .PP
127 The status
128 files contain a textual representation of the status of the line, in the format of the
129 commands used on the
130 control
131 file.
132 .SH SOURCE
133 .B /sys/src/9/port/devuart.c
134 .br
135 .B /sys/src/9/*/uart*.c