1 |
786 |
skrzyp |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# usbs_serial.cdl
|
4 |
|
|
#
|
5 |
|
|
# USB slave-side serial package.
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on this file might be covered by the GNU General Public License.
|
37 |
|
|
## -------------------------------------------
|
38 |
|
|
## ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
# ====================================================================
|
40 |
|
|
######DESCRIPTIONBEGIN####
|
41 |
|
|
#
|
42 |
|
|
# Author(s): Frank M. Pagliughi (fmp), SoRo Systems, Inc.
|
43 |
|
|
# Contributors: jld
|
44 |
|
|
# Date: 2008-06-04
|
45 |
|
|
#
|
46 |
|
|
#####DESCRIPTIONEND####
|
47 |
|
|
# ====================================================================
|
48 |
|
|
|
49 |
|
|
cdl_package CYGPKG_IO_USB_SLAVE_SERIAL {
|
50 |
|
|
display "USB slave serial support"
|
51 |
|
|
include_dir "cyg/io/usb"
|
52 |
|
|
parent CYGPKG_IO_USB_SLAVE
|
53 |
|
|
requires { CYGHWR_IO_USB_SLAVE_OUT_ENDPOINTS >= 1 }
|
54 |
|
|
requires { CYGHWR_IO_USB_SLAVE_IN_ENDPOINTS >= 1 }
|
55 |
|
|
compile usbs_serial.c
|
56 |
|
|
implements CYGINT_IO_USB_SLAVE_CLIENTS
|
57 |
|
|
# doc ref/io-usb-slave-eth.html
|
58 |
|
|
|
59 |
|
|
description "
|
60 |
|
|
The USB slave serial package supports the development of USB
|
61 |
|
|
peripherals which mimic a serial connection to the host
|
62 |
|
|
machine. Such a device creates a relatively simple upgrade to
|
63 |
|
|
USB from a legacy serial connection, especially from the
|
64 |
|
|
perspective of the host software and device drivers."
|
65 |
|
|
|
66 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_CLASS_TYPE {
|
67 |
|
|
display "Serial USB Class"
|
68 |
|
|
flavor data
|
69 |
|
|
default_value { "ACM" }
|
70 |
|
|
legal_values { "ACM" "generic" }
|
71 |
|
|
description "
|
72 |
|
|
The USB serial module can enumerate as either a generic
|
73 |
|
|
(vendor-specific) usb device or a communications class ACM
|
74 |
|
|
device. The generic device requires a pair of Bulk
|
75 |
|
|
endpoints, while the ACM device also requires an Interrupt
|
76 |
|
|
IN endpoint. For a Windows host, the ACM configuration is
|
77 |
|
|
required to use the standard 'usbser.sys' device driver,
|
78 |
|
|
but for a Linux host, the generic configuration works, and
|
79 |
|
|
saves the additional endpoint."
|
80 |
|
|
}
|
81 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_EP0 {
|
82 |
|
|
display "Name of EP0 structure"
|
83 |
|
|
flavor data
|
84 |
|
|
default_value { "usbs_at91_ep0" }
|
85 |
|
|
description "
|
86 |
|
|
The name of the variable that contains the endpoint 0
|
87 |
|
|
structure. This should be set to the EP0 structure for
|
88 |
|
|
the desired USB device driver such as usbs_at91_ep0,
|
89 |
|
|
usbs_sa11x0_ep0, etc"
|
90 |
|
|
}
|
91 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_EP0_MAX_PACKET_SIZE {
|
92 |
|
|
display "The size of EP0"
|
93 |
|
|
flavor data
|
94 |
|
|
default_value 8
|
95 |
|
|
legal_values { 8 16 64 }
|
96 |
|
|
description "
|
97 |
|
|
The size of the EP0 hardware buffer on the specific USB
|
98 |
|
|
chip used."
|
99 |
|
|
}
|
100 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_TX_EP_NUM {
|
101 |
|
|
display "Tx (USB IN) endpoint number"
|
102 |
|
|
flavor data
|
103 |
|
|
default_value 1
|
104 |
|
|
description "
|
105 |
|
|
The endpoint that should be used for the device-side
|
106 |
|
|
transmitter, which is the USB IN direction."
|
107 |
|
|
}
|
108 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_RX_EP_NUM {
|
109 |
|
|
display "Rx (USB OUT) endpoint number"
|
110 |
|
|
flavor data
|
111 |
|
|
default_value 2
|
112 |
|
|
description "
|
113 |
|
|
The endpoint that should be used for the device-side
|
114 |
|
|
receiver, which is the USB OUT direction."
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
cdl_component CYGPKG_IO_USB_SLAVE_SERIAL_STATIC_EP {
|
118 |
|
|
display "Use static I/O endpoint structures"
|
119 |
|
|
flavor bool
|
120 |
|
|
default_value 1
|
121 |
|
|
description "
|
122 |
|
|
Enables the use of static I/O endpoint structures. Some
|
123 |
|
|
USB slave device drivers implement dynamic endpoint
|
124 |
|
|
configuration and therefore require this component to be
|
125 |
|
|
disabled."
|
126 |
|
|
|
127 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_TX_EP {
|
128 |
|
|
display "The Tx (USB IN) endpoint structure"
|
129 |
|
|
flavor data
|
130 |
|
|
default_value { "usbs_at91_ep1" }
|
131 |
|
|
description "
|
132 |
|
|
The endpoint structure that corresponds to the selected
|
133 |
|
|
Tx endpoint number. This is dependent on the USBS device
|
134 |
|
|
driver selected, and could be usbs_at91_ep1,
|
135 |
|
|
usbs_sa11x0_ep1, etc"
|
136 |
|
|
}
|
137 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_RX_EP {
|
138 |
|
|
display "The Rx (USB OUT) endpoint structure"
|
139 |
|
|
flavor data
|
140 |
|
|
default_value { "usbs_at91_ep2" }
|
141 |
|
|
description "
|
142 |
|
|
The endpoint structure that corresponds to the selected
|
143 |
|
|
Rx endpoint number. This is dependent on the USBS device
|
144 |
|
|
driver selected, and could be usbs_at91_ep2,
|
145 |
|
|
usbs_sa11x0_ep2, etc"
|
146 |
|
|
}
|
147 |
|
|
}
|
148 |
|
|
|
149 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_INTR_EP_NUM {
|
150 |
|
|
display "Interrupt IN endpoint number"
|
151 |
|
|
flavor data
|
152 |
|
|
default_value 3
|
153 |
|
|
active_if { CYGDAT_IO_USB_SLAVE_CLASS_TYPE == "ACM" }
|
154 |
|
|
description "
|
155 |
|
|
The endpoint that should be used for the ACM Interrupt IN"
|
156 |
|
|
}
|
157 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_INTR_EP {
|
158 |
|
|
display "Interrupt IN endpoint structure"
|
159 |
|
|
flavor data
|
160 |
|
|
default_value { "usbs_at91_ep3" }
|
161 |
|
|
active_if { CYGDAT_IO_USB_SLAVE_CLASS_TYPE == "ACM" }
|
162 |
|
|
description "
|
163 |
|
|
The endpoint structure that corresponds to the selected ACM
|
164 |
|
|
Interrupt IN endpoint."
|
165 |
|
|
}
|
166 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_VENDOR_ID {
|
167 |
|
|
display "USB Forum Vendor ID"
|
168 |
|
|
flavor data
|
169 |
|
|
default_value 0xFFFF
|
170 |
|
|
legal_values 1 to 0xFFFF
|
171 |
|
|
description "
|
172 |
|
|
Each USB vendor has an Vendor ID allocated to it by the
|
173 |
|
|
USB-IF organization. Any arbitrary value can be selected
|
174 |
|
|
for testing provided that it doesn't conflict with devices
|
175 |
|
|
on the development host, but a device should NEVER be
|
176 |
|
|
released publicly without a valid Vendor ID"
|
177 |
|
|
|
178 |
|
|
}
|
179 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_PRODUCT_ID {
|
180 |
|
|
display "USB product ID"
|
181 |
|
|
flavor data
|
182 |
|
|
default_value 1
|
183 |
|
|
legal_values 1 to 0xFFFF
|
184 |
|
|
description "
|
185 |
|
|
You are free to select an arbitrary 16-bit Product ID for
|
186 |
|
|
a device. The combination of Vendor ID and Product ID
|
187 |
|
|
uniquely identified a USB device."
|
188 |
|
|
}
|
189 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_MFG_STR {
|
190 |
|
|
display "The Device Vendor's Name (Manufacturer String)"
|
191 |
|
|
flavor data
|
192 |
|
|
default_value { "\"eCos\"" }
|
193 |
|
|
description "
|
194 |
|
|
The standard USB enumeration allows for a
|
195 |
|
|
manufacturer's name which is normally reported to the
|
196 |
|
|
user when the device is first plugged into the host."
|
197 |
|
|
}
|
198 |
|
|
cdl_option CYGDAT_IO_USB_SLAVE_SERIAL_PRODUCT_STR {
|
199 |
|
|
display "The Device Product Name"
|
200 |
|
|
flavor data
|
201 |
|
|
default_value { "\"eCos USB Serial Device\"" }
|
202 |
|
|
description "
|
203 |
|
|
The standard USB enumeration allows for a product name
|
204 |
|
|
which is normally reported to the user when the device
|
205 |
|
|
is first plugged into the host."
|
206 |
|
|
}
|
207 |
|
|
|
208 |
|
|
cdl_option CYGOPT_IO_USB_SLAVE_SERIAL_BUSPOWERED {
|
209 |
|
|
display "The Device is bus powered"
|
210 |
|
|
default_value 0
|
211 |
|
|
flavor bool
|
212 |
|
|
description "
|
213 |
|
|
Tells the host whether the Device is a bus powered
|
214 |
|
|
device or a self powered device."
|
215 |
|
|
}
|
216 |
|
|
cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_CURRENTDRAW {
|
217 |
|
|
display "Maximum current (in mA) drawn from USB bus"
|
218 |
|
|
flavor data
|
219 |
|
|
default_value 100
|
220 |
|
|
legal_values 1 to 500
|
221 |
|
|
requires { (CYGNUM_IO_USB_SLAVE_SERIAL_CURRENTDRAW > 100)
|
222 |
|
|
implies CYGOPT_IO_USB_SLAVE_SERIAL_BUSPOWERED }
|
223 |
|
|
description "
|
224 |
|
|
The maximum current drawn by the Device from the USB bus.
|
225 |
|
|
It should report the peak value. A self powered device
|
226 |
|
|
can draw up to 100mA, a bus powered device can draw up to
|
227 |
|
|
500mA. (If it is sometimes below 100mA and sometimes over,
|
228 |
|
|
then a tranition could be done at runtime between self and
|
229 |
|
|
bus powered modes, but that would be complicated and the
|
230 |
|
|
device would have to return from configured to addressed
|
231 |
|
|
state. For details, see the USB specification.)"
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
cdl_option CYGBLD_IO_USB_SLAVE_SERIAL_DEBUG {
|
235 |
|
|
display "Enable debug output from the driver"
|
236 |
|
|
default_value 0
|
237 |
|
|
flavor bool
|
238 |
|
|
description "
|
239 |
|
|
The driver may produce debug output which can be
|
240 |
|
|
useful to work out why it is not working as expected."
|
241 |
|
|
}
|
242 |
|
|
|
243 |
|
|
cdl_component CYGPKG_IO_USB_SLAVE_SERIAL_OPTIONS {
|
244 |
|
|
display "Build options"
|
245 |
|
|
flavor none
|
246 |
|
|
|
247 |
|
|
description "
|
248 |
|
|
Package-specific build options including control over compiler
|
249 |
|
|
flags used only in building this package."
|
250 |
|
|
|
251 |
|
|
cdl_option CYGPKG_IO_USB_SLAVE_SERIAL_CFLAGS_ADD {
|
252 |
|
|
display "Additional compiler flags"
|
253 |
|
|
flavor data
|
254 |
|
|
no_define
|
255 |
|
|
default_value { "" }
|
256 |
|
|
description "
|
257 |
|
|
This option modifies the set of compiler flags for
|
258 |
|
|
building this package. These flags are used in addition
|
259 |
|
|
to the set of global flags."
|
260 |
|
|
}
|
261 |
|
|
|
262 |
|
|
cdl_option CYGPKG_IO_USB_SLAVE_SERIAL_CFLAGS_REMOVE {
|
263 |
|
|
display "Suppressed compiler flags"
|
264 |
|
|
flavor data
|
265 |
|
|
no_define
|
266 |
|
|
default_value { "" }
|
267 |
|
|
description "
|
268 |
|
|
This option modifies the set of compiler flags for
|
269 |
|
|
building this package. These flags are removed from
|
270 |
|
|
the set of global flags if present."
|
271 |
|
|
}
|
272 |
|
|
|
273 |
|
|
|
274 |
|
|
cdl_component CYGBLD_IO_USB_SLAVE_SERIAL_EXAMPLES {
|
275 |
|
|
display "Build example programs"
|
276 |
|
|
no_define
|
277 |
|
|
requires { CYGPKG_IO_FILEIO }
|
278 |
|
|
requires { CYGPKG_IO_SERIAL_DEVICES }
|
279 |
|
|
description "
|
280 |
|
|
Enabling this option will cause the example programs
|
281 |
|
|
to be built using the normal test case infrastructure.
|
282 |
|
|
They are however not test cases and should not be used
|
283 |
|
|
with any automatic test farm running all the
|
284 |
|
|
tests. Hence this option is disabled by default."
|
285 |
|
|
|
286 |
|
|
cdl_option CYGPKG_IO_USB_SLAVE_SERIAL_TESTS {
|
287 |
|
|
display "USBS serial example/test programs"
|
288 |
|
|
no_define
|
289 |
|
|
flavor data
|
290 |
|
|
calculated { "tests/usbserial_echo tests/usb2serial" }
|
291 |
|
|
description "
|
292 |
|
|
usbserial_echo will echo charactors received
|
293 |
|
|
over the usb serial port back to the sender.
|
294 |
|
|
usb2serial acts as a bridge between a USB serial
|
295 |
|
|
slave and a real serial port. It is hard coded to use
|
296 |
|
|
/dev/ser0."
|
297 |
|
|
}
|
298 |
|
|
}
|
299 |
|
|
}
|
300 |
|
|
}
|