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