]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/man/man4/uftdi.4
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / share / man / man4 / uftdi.4
1 .\" $NetBSD: uftdi.4,v 1.5 2002/02/07 03:15:08 ross Exp $
2 .\"
3 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Lennart Augustsson.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .\" $FreeBSD$
31 .\"
32 .Dd March 31, 2014
33 .Dt UFTDI 4
34 .Os
35 .Sh NAME
36 .Nm uftdi
37 .Nd USB support for serial adapters based on the FTDI family of USB
38 serial adapter chips.
39 .Sh SYNOPSIS
40 To compile this driver into the kernel,
41 place the following lines in your
42 kernel configuration file:
43 .Bd -ragged -offset indent
44 .Cd "device usb"
45 .Cd "device ucom"
46 .Cd "device uftdi"
47 .Ed
48 .Pp
49 Alternatively, to load the driver as a
50 module at boot time, place the following line in
51 .Xr loader.conf 5 :
52 .Bd -literal -offset indent
53 uftdi_load="YES"
54 .Ed
55 .Sh DESCRIPTION
56 The
57 .Nm
58 driver provides support for various serial adapters based on the
59 following FTDI chips:
60 .Pp
61 .Bl -bullet -compact
62 .It
63 FT8U100AX
64 .It
65 FT8U232AM
66 .It
67 FT8U232BM
68 .It
69 FT232R
70 .It
71 FT2232C
72 .It
73 FT2232D
74 .It
75 FT2232H
76 .It
77 FT4232H
78 .It
79 FT230X
80 .El
81 .Pp
82 The device is accessed through the
83 .Xr ucom 4
84 driver which makes it behave like a
85 .Xr tty 4 .
86 .Pp
87 Many of the supported chips provide additional functionality
88 such as bitbang mode and the MPSSE engine for serial bus emulation.
89 The
90 .Nm
91 driver provides access to that functionality with the following
92 .Xr ioctl 2
93 calls, defined in
94 .In dev/usb/uftdiio.h :
95 .Bl -tag -width indent
96 .It Dv UFTDIIOC_RESET_IO Pq Vt int
97 Reset the channel to its default configuration, flush RX and TX FIFOs.
98 .It Dv UFTDIIOC_RESET_RX Pq Vt int
99 Flush the RX FIFO.
100 .It Dv UFTDIIOC_RESET_TX Pq Vt int
101 Flush the TX FIFO.
102 .It Dv UFTDIIOC_SET_BITMODE Pq Vt "struct uftdi_bitmode"
103 Put the channel into the operating mode specified in
104 .Va mode ,
105 and set the pins indicated by ones in
106 .Va iomask
107 to output mode.
108 The
109 .Va mode
110 must be one of the
111 .Va uftdi_bitmodes
112 values.
113 .Bd -literal
114 enum uftdi_bitmodes
115 {
116         UFTDI_BITMODE_ASYNC = 0,
117         UFTDI_BITMODE_MPSSE = 1,
118         UFTDI_BITMODE_SYNC = 2,
119         UFTDI_BITMODE_CPU_EMUL = 3,
120         UFTDI_BITMODE_FAST_SERIAL = 4,
121         UFTDI_BITMODE_CBUS = 5,
122         UFTDI_BITMODE_NONE = 0xff,
123 };
124
125 struct uftdi_bitmode
126 {
127         uint8_t mode;
128         uint8_t iomask;
129 };
130 .Ed
131 .Pp
132 Manuals and application notes published by FTDI describe these
133 modes in detail.
134 To use most of these modes, you first put the channel into
135 the desired mode, then you
136 .Xr read 2
137 and
138 .Xr write 2
139 data which either reflects pin state or is interpreted 
140 as MPSSE commands and parameters, depending on the mode.
141 .It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode"
142 Return the state of the bitbang pins at the time of the call in the
143 .Va iomask
144 member.
145 The
146 .Va mode
147 member is unused.
148 .It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int
149 Set the character which is inserted into the buffer to mark
150 the point of an error such as FIFO overflow.
151 .It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int
152 Set the character which causes a partial FIFO full of data 
153 to be returned immediately even if the FIFO is not full.
154 .It Dv UFTDIIOC_SET_LATENCY Pq Vt int
155 Set the amount of time to wait for a full FIFO,
156 in milliseconds.
157 If more than this much time elapses without receiving a new
158 character, any characters in the FIFO are returned.
159 .It Dv UFTDIIOC_GET_LATENCY Pq Vt int
160 Get the current value of the latency timer.
161 .It Dv UFTDIIOC_GET_HWREV Pq Vt int
162 Get the hardware revision number.
163 This is the
164 .Va bcdDevice
165 value from the
166 .Va usb_device_descriptor .
167 .Sh HARDWARE
168 The
169 .Nm
170 driver supports the following adapters:
171 .Pp
172 .Bl -bullet -compact
173 .It
174 B&B Electronics USB->RS422/485 adapter
175 .It
176 Elexol USB MOD1 and USB MOD3
177 .It
178 HP USB-Serial adapter shipped with some HP laptops
179 .It
180 Inland UAS111
181 .It
182 QVS USC-1000
183 .It
184 Buffalo PC-OP-RS / Kurouto-shikou KURO-RS universal remote
185 .It
186 Prologix GPIB-USB Controller
187 .El
188 .Sh SEE ALSO
189 .Xr tty 4 ,
190 .Xr ucom 4 ,
191 .Xr usb 4
192 .Sh HISTORY
193 The
194 .Nm
195 driver
196 appeared in
197 .Fx 4.8
198 from
199 .Nx 1.5 .