source: avrstuff/V-USB_Dev/firmwares/herePic/usbconfig.h@ 3587f7f

main
Last change on this file since 3587f7f was 3587f7f, checked in by Adrien Destugues <pulkomandy@…>, 12 years ago

Add first version of herePic, an AVR based PIc programmer using ICSP protocol.
Untested, no host software written yet.

git-svn-id: svn://pulkomandy.tk/avrstuff@64 c6672c3c-f6b6-47f9-9001-1fd6b12fecbe

  • Property mode set to 100644
File size: 9.5 KB
Line 
1/**
2 * \file firmware/usbconfig.h
3 * \brief Configuration options for the USB-driver.
4 *
5 * This file is almost identical to the original usbconfig.h by Christian
6 * Starkjohann, in structure and content.
7 *
8 * It contains parts of the USB driver which can be configured and can or must
9 * be adapted to your hardware.
10 * \author Ronald Schaten <ronald@schatenseite.de>
11 * \version $Id: usbconfig.h,v 1.1 2008-07-09 20:47:12 rschaten Exp $
12 *
13 * License: GNU GPL v2 (see License.txt)
14 */
15
16#ifndef __usbconfig_h_included__
17#define __usbconfig_h_included__
18
19/* ---------------------------- Hardware Config ---------------------------- */
20
21/** This is the port where the USB bus is connected. When you configure it to
22 * "B", the registers PORTB, PINB and DDRB will be used.
23 */
24#define USB_CFG_IOPORTNAME D
25/** This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
26 * This may be any bit in the port.
27 */
28#define USB_CFG_DMINUS_BIT 5
29/** This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
30 * This may be any bit in the port. Please note that D+ must also be connected
31 * to interrupt pin INT0!
32 */
33#define USB_CFG_DPLUS_BIT 2
34
35/* ----------------------- Optional Hardware Config ------------------------ */
36
37/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
38 * V+, you can connect and disconnect the device from firmware by calling
39 * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
40 * This constant defines the port on which the pullup resistor is connected.
41 */
42/* #define USB_CFG_PULLUP_IOPORTNAME D */
43/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
44 * above) where the 1.5k pullup resistor is connected. See description
45 * above for details.
46 */
47/* #define USB_CFG_PULLUP_BIT 4 */
48
49/* --------------------------- Functional Range ---------------------------- */
50
51/** Define this to 1 if you want to compile a version with two endpoints: The
52 * default control endpoint 0 and an interrupt-in endpoint 1.
53 */
54#define USB_CFG_HAVE_INTRIN_ENDPOINT 0
55/** Define this to 1 if you want to compile a version with three endpoints: The
56 * default control endpoint 0, an interrupt-in endpoint 1 and an interrupt-in
57 * endpoint 3. You must also enable endpoint 1 above.
58 */
59#define USB_CFG_HAVE_INTRIN_ENDPOINT3 0
60/** Define this to 1 if you also want to implement the ENDPOINT_HALT feature
61 * for endpoint 1 (interrupt endpoint). Although you may not need this feature,
62 * it is required by the standard. We have made it a config option because it
63 * bloats the code considerably.
64 */
65#define USB_CFG_IMPLEMENT_HALT 0
66/** If you compile a version with endpoint 1 (interrupt-in), this is the poll
67 * interval. The value is in milliseconds and must not be less than 10 ms for
68 * low speed devices.
69 */
70#define USB_CFG_INTR_POLL_INTERVAL 20
71/** Define this to 1 if the device has its own power supply. Set it to 0 if the
72 * device is powered from the USB bus.
73 */
74#define USB_CFG_IS_SELF_POWERED 1
75/** Set this variable to the maximum USB bus power consumption of your device.
76 * The value is in milliamperes. [It will be divided by two since USB
77 * communicates power requirements in units of 2 mA.]
78 */
79#define USB_CFG_MAX_BUS_POWER 20
80/** Set this to 1 if you want usbFunctionWrite() to be called for control-out
81 * transfers. Set it to 0 if you don't need it and want to save a couple of
82 * bytes.
83 */
84#define USB_CFG_IMPLEMENT_FN_WRITE 0
85/** Set this to 1 if you need to send control replies which are generated
86 * "on the fly" when usbFunctionRead() is called. If you only want to send
87 * data from a static buffer, set it to 0 and return the data from
88 * usbFunctionSetup(). This saves a couple of bytes.
89 */
90#define USB_CFG_IMPLEMENT_FN_READ 0
91/** Define this to 1 if you want to use interrupt-out (or bulk out) endpoint 1.
92 * You must implement the function usbFunctionWriteOut() which receives all
93 * interrupt/bulk data sent to endpoint 1.
94 */
95#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
96/** Define this to 1 if you want flowcontrol over USB data. See the definition
97 * of the macros usbDisableAllRequests() and usbEnableAllRequests() in
98 * usbdrv.h.
99 */
100#define USB_CFG_HAVE_FLOWCONTROL 0
101
102/* -------------------------- Device Description --------------------------- */
103
104/*
105 * USB vendor ID for the device, low byte first. If you have registered your
106 * own Vendor ID, define it here. Otherwise you use obdev's free shared
107 * VID/PID pair. Be sure to read USBID-License.txt for rules!
108 */
109#define USB_CFG_VENDOR_ID 0xC0, 0x16
110/** This is the ID of the product, low byte first. It is interpreted in the
111 * scope of the vendor ID. If you have registered your own VID with usb.org
112 * or if you have licensed a PID from somebody else, define it here. Otherwise
113 * you use obdev's free shared VID/PID pair. Be sure to read the rules in
114 * USBID-License.txt!
115 */
116#define USB_CFG_DEVICE_ID 0xDC, 0x05
117/** Version number of the device: Minor number first, then major number.
118 */
119#define USB_CFG_DEVICE_VERSION 0x00, 0x01
120/** These two values define the vendor name returned by the USB device. The name
121 * must be given as a list of characters under single quotes. The characters
122 * are interpreted as Unicode (UTF-16) entities.
123 * If you don't want a vendor name string, undefine these macros.
124 * ALWAYS define a vendor name containing your Internet domain name if you use
125 * obdev's free shared VID/PID pair. See the file USBID-License.txt for
126 * details.
127 */
128#define USB_CFG_VENDOR_NAME 'p','u','l','k','o','m','a','n','d','y','.','t','k'
129/** Length of USB_CFG_DEVICE_VERSION
130 */
131#define USB_CFG_VENDOR_NAME_LEN 13
132/** Same as above for the device name. If you don't want a device name, undefine
133 * the macros. See the file USBID-License.txt before you assign a name.
134 */
135#define USB_CFG_DEVICE_NAME 'H','e','r','e','P','i','c'
136/** Length of USB_CFG_DEVICE_NAME
137 */
138#define USB_CFG_DEVICE_NAME_LEN 7
139/** See USB specification if you want to conform to an existing device class.
140 * This setting means to specify the class at the interface level.
141 */
142#define USB_CFG_DEVICE_CLASS 0xFF
143/** See USB specification if you want to conform to an existing device subclass.
144 */
145#define USB_CFG_DEVICE_SUBCLASS 0
146/** See USB specification if you want to conform to an existing device class or
147 * protocol. This is HID class.
148 */
149#define USB_CFG_INTERFACE_CLASS 0x0
150/** See USB specification if you want to conform to an existing device class or
151 * protocol. This is not a boot device.
152 */
153#define USB_CFG_INTERFACE_SUBCLASS 0x00
154/** See USB specification if you want to conform to an existing device class or
155 * protocol.
156 */
157#define USB_CFG_INTERFACE_PROTOCOL 0x00
158/** Define this to the length of the HID report descriptor, if you implement
159 * an HID device. Otherwise don't define it or define it to 0.
160 */
161#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
162
163/* ------------------- Fine Control over USB Descriptors ------------------- */
164/* If you don't want to use the driver's default USB descriptors, you can
165 * provide our own. These can be provided as (1) fixed length static data in
166 * flash memory, (2) fixed length static data in RAM or (3) dynamically at
167 * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
168 * information about this function.
169 * Descriptor handling is configured through the descriptor's properties. If
170 * no properties are defined or if they are 0, the default descriptor is used.
171 * Possible properties are:
172 * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
173 * at runtime via usbFunctionDescriptor().
174 * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
175 * in static memory is in RAM, not in flash memory.
176 * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
177 * the driver must know the descriptor's length. The descriptor itself is
178 * found at the address of a well known identifier (see below).
179 * List of static descriptor names (must be declared PROGMEM if in flash):
180 * char usbDescriptorDevice[];
181 * char usbDescriptorConfiguration[];
182 * char usbDescriptorHidReport[];
183 * char usbDescriptorString0[];
184 * int usbDescriptorStringVendor[];
185 * int usbDescriptorStringDevice[];
186 * int usbDescriptorStringSerialNumber[];
187 * Other descriptors can't be provided statically, they must be provided
188 * dynamically at runtime.
189 *
190 * Descriptor properties are or-ed or added together, e.g.:
191 * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
192 *
193 * The following descriptors are defined:
194 * USB_CFG_DESCR_PROPS_DEVICE
195 * USB_CFG_DESCR_PROPS_CONFIGURATION
196 * USB_CFG_DESCR_PROPS_STRINGS
197 * USB_CFG_DESCR_PROPS_STRING_0
198 * USB_CFG_DESCR_PROPS_STRING_VENDOR
199 * USB_CFG_DESCR_PROPS_STRING_PRODUCT
200 * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
201 * USB_CFG_DESCR_PROPS_HID
202 * USB_CFG_DESCR_PROPS_HID_REPORT
203 * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
204 *
205 */
206
207#define USB_CFG_DESCR_PROPS_DEVICE 0
208#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
209#define USB_CFG_DESCR_PROPS_STRINGS 0
210#define USB_CFG_DESCR_PROPS_STRING_0 0
211#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
212#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
213#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
214#define USB_CFG_DESCR_PROPS_HID 0
215#define USB_CFG_DESCR_PROPS_HID_REPORT 0
216#define USB_CFG_DESCR_PROPS_UNKNOWN 0
217
218#endif /* __usbconfig_h_included__ */
Note: See TracBrowser for help on using the repository browser.