]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - share/man/man4/uftdi.4
MFC r294949,r294952,r294953,r294957,r294965,r294967,r294968,r295017,r295026,
[FreeBSD/stable/9.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 November 22, 2006
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 uftdi"
45 .Ed
46 .Pp
47 Alternatively, to load the driver as a
48 module at boot time, place the following line in
49 .Xr loader.conf 5 :
50 .Bd -literal -offset indent
51 uftdi_load="YES"
52 .Ed
53 .Sh DESCRIPTION
54 The
55 .Nm
56 driver provides support for various serial adapters based on the
57 following FTDI chips:
58 .Pp
59 .Bl -bullet -compact
60 .It
61 FT8U100AX
62 .It
63 FT8U232AM
64 .It
65 FT8U232BM
66 .It
67 FT232R
68 .It
69 FT2232C
70 .It
71 FT2232D
72 .It
73 FT2232H
74 .It
75 FT4232H
76 .It
77 FT230X
78 .El
79 .Pp
80 The device is accessed through the
81 .Xr ucom 4
82 driver which makes it behave like a
83 .Xr tty 4 .
84 .Pp
85 Many of the supported chips provide additional functionality
86 such as bitbang mode and the MPSSE engine for serial bus emulation.
87 The
88 .Nm
89 driver provides access to that functionality with the following
90 .Xr ioctl 2
91 calls, defined in
92 .In dev/usb/uftdiio.h :
93 .Bl -tag -width indent
94 .It Dv UFTDIIOC_RESET_IO Pq Vt int
95 Reset the channel to its default configuration, flush RX and TX FIFOs.
96 .It Dv UFTDIIOC_RESET_RX Pq Vt int
97 Flush the RX FIFO.
98 .It Dv UFTDIIOC_RESET_TX Pq Vt int
99 Flush the TX FIFO.
100 .It Dv UFTDIIOC_SET_BITMODE Pq Vt "struct uftdi_bitmode"
101 Put the channel into the operating mode specified in
102 .Va mode ,
103 and set the pins indicated by ones in
104 .Va iomask
105 to output mode.
106 The
107 .Va mode
108 must be one of the
109 .Va uftdi_bitmodes
110 values.
111 .Bd -literal
112 enum uftdi_bitmodes
113 {
114         UFTDI_BITMODE_ASYNC = 0,
115         UFTDI_BITMODE_MPSSE = 1,
116         UFTDI_BITMODE_SYNC = 2,
117         UFTDI_BITMODE_CPU_EMUL = 3,
118         UFTDI_BITMODE_FAST_SERIAL = 4,
119         UFTDI_BITMODE_CBUS = 5,
120         UFTDI_BITMODE_NONE = 0xff,
121 };
122
123 struct uftdi_bitmode
124 {
125         uint8_t mode;
126         uint8_t iomask;
127 };
128 .Ed
129 .Pp
130 Manuals and application notes published by FTDI describe these
131 modes in detail.
132 To use most of these modes, you first put the channel into
133 the desired mode, then you
134 .Xr read 2
135 and
136 .Xr write 2
137 data which either reflects pin state or is interpreted 
138 as MPSSE commands and parameters, depending on the mode.
139 .It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode"
140 Return the state of the bitbang pins at the time of the call in the
141 .Va iomask
142 member.
143 The
144 .Va mode
145 member is unused.
146 .It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int
147 Set the character which is inserted into the buffer to mark
148 the point of an error such as FIFO overflow.
149 .It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int
150 Set the character which causes a partial FIFO full of data 
151 to be returned immediately even if the FIFO is not full.
152 .It Dv UFTDIIOC_SET_LATENCY Pq Vt int
153 Set the amount of time to wait for a full FIFO,
154 in milliseconds.
155 If more than this much time elapses without receiving a new
156 character, any characters in the FIFO are returned.
157 .It Dv UFTDIIOC_GET_LATENCY Pq Vt int
158 Get the current value of the latency timer.
159 .It Dv UFTDIIOC_GET_HWREV Pq Vt int
160 Get the hardware revision number.
161 This is the
162 .Va bcdDevice
163 value from the
164 .Va usb_device_descriptor .
165 .Sh HARDWARE
166 The
167 .Nm
168 driver supports the following adapters:
169 .Pp
170 .Bl -bullet -compact
171 .It
172 B&B Electronics USB->RS422/485 adapter
173 .It
174 Elexol USB MOD1 and USB MOD3
175 .It
176 HP USB-Serial adapter shipped with some HP laptops
177 .It
178 Inland UAS111
179 .It
180 QVS USC-1000
181 .It
182 Buffalo PC-OP-RS / Kurouto-shikou KURO-RS universal remote
183 .It
184 Prologix GPIB-USB Controller
185 .El
186 .Sh SEE ALSO
187 .Xr tty 4 ,
188 .Xr ucom 4 ,
189 .Xr usb 4
190 .Sh HISTORY
191 The
192 .Nm
193 driver
194 appeared in
195 .Fx 4.8
196 from
197 .Nx 1.5 .