firmware/usbconfig.h

Go to the documentation of this file.
00001 
00016 #ifndef __usbconfig_h_included__
00017 #define __usbconfig_h_included__
00018 
00019 /* ---------------------------- Hardware Config ---------------------------- */
00020 
00024 #define USB_CFG_IOPORTNAME      D
00025 
00028 #define USB_CFG_DMINUS_BIT      0
00029 
00033 #define USB_CFG_DPLUS_BIT       2
00034 
00035 /* ----------------------- Optional Hardware Config ------------------------ */
00036 
00037 /* If you connect the 1.5k pullup resistor from D- to a port pin instead of
00038  * V+, you can connect and disconnect the device from firmware by calling
00039  * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
00040  * This constant defines the port on which the pullup resistor is connected.
00041  */
00042 /* #define USB_CFG_PULLUP_IOPORTNAME   D */
00043 /* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
00044  * above) where the 1.5k pullup resistor is connected. See description
00045  * above for details.
00046  */
00047 /* #define USB_CFG_PULLUP_BIT          4 */
00048 
00049 /* --------------------------- Functional Range ---------------------------- */
00050 
00054 #define USB_CFG_HAVE_INTRIN_ENDPOINT    1
00055 
00059 #define USB_CFG_HAVE_INTRIN_ENDPOINT3   0
00060 
00065 #define USB_CFG_IMPLEMENT_HALT          0
00066 
00070 #define USB_CFG_INTR_POLL_INTERVAL      10
00071 
00074 #define USB_CFG_IS_SELF_POWERED         0
00075 
00079 #define USB_CFG_MAX_BUS_POWER           100
00080 
00084 #define USB_CFG_IMPLEMENT_FN_WRITE      1
00085 
00090 #define USB_CFG_IMPLEMENT_FN_READ       0
00091 
00095 #define USB_CFG_IMPLEMENT_FN_WRITEOUT   0
00096 
00100 #define USB_CFG_HAVE_FLOWCONTROL        0
00101 
00102 /* -------------------------- Device Description --------------------------- */
00103 
00115 #define  USB_CFG_VENDOR_ID       0x42, 0x42
00116 
00122 #define  USB_CFG_DEVICE_ID       0x31, 0xe1
00123 
00125 #define USB_CFG_DEVICE_VERSION  0x00, 0x01
00126 
00134 #define USB_CFG_VENDOR_NAME     'w', 'w', 'w', '.', 's', 'c', 'h', 'a', 't', 'e', 'n', 's', 'e', 'i', 't', 'e', '.', 'd', 'e'
00135 
00137 #define USB_CFG_VENDOR_NAME_LEN 19
00138 
00141 #define USB_CFG_DEVICE_NAME     'D', 'u', 'l', 'c', 'i', 'm', 'e', 'r'
00142 
00144 #define USB_CFG_DEVICE_NAME_LEN 8
00145 
00148 #define USB_CFG_DEVICE_CLASS    0
00149 
00151 #define USB_CFG_DEVICE_SUBCLASS 0
00152 
00155 #define USB_CFG_INTERFACE_CLASS     0x03
00156 
00159 #define USB_CFG_INTERFACE_SUBCLASS  0x01
00160 
00163 #define USB_CFG_INTERFACE_PROTOCOL  0x01
00164 
00167 #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    63
00168 
00169 /* ------------------- Fine Control over USB Descriptors ------------------- */
00170 /* If you don't want to use the driver's default USB descriptors, you can
00171  * provide our own. These can be provided as (1) fixed length static data in
00172  * flash memory, (2) fixed length static data in RAM or (3) dynamically at
00173  * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
00174  * information about this function.
00175  * Descriptor handling is configured through the descriptor's properties. If
00176  * no properties are defined or if they are 0, the default descriptor is used.
00177  * Possible properties are:
00178  *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
00179  *     at runtime via usbFunctionDescriptor().
00180  *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
00181  *     in static memory is in RAM, not in flash memory.
00182  *   + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
00183  *     the driver must know the descriptor's length. The descriptor itself is
00184  *     found at the address of a well known identifier (see below).
00185  * List of static descriptor names (must be declared PROGMEM if in flash):
00186  *   char usbDescriptorDevice[];
00187  *   char usbDescriptorConfiguration[];
00188  *   char usbDescriptorHidReport[];
00189  *   char usbDescriptorString0[];
00190  *   int usbDescriptorStringVendor[];
00191  *   int usbDescriptorStringDevice[];
00192  *   int usbDescriptorStringSerialNumber[];
00193  * Other descriptors can't be provided statically, they must be provided
00194  * dynamically at runtime.
00195  *
00196  * Descriptor properties are or-ed or added together, e.g.:
00197  * #define USB_CFG_DESCR_PROPS_DEVICE   (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
00198  *
00199  * The following descriptors are defined:
00200  *   USB_CFG_DESCR_PROPS_DEVICE
00201  *   USB_CFG_DESCR_PROPS_CONFIGURATION
00202  *   USB_CFG_DESCR_PROPS_STRINGS
00203  *   USB_CFG_DESCR_PROPS_STRING_0
00204  *   USB_CFG_DESCR_PROPS_STRING_VENDOR
00205  *   USB_CFG_DESCR_PROPS_STRING_PRODUCT
00206  *   USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
00207  *   USB_CFG_DESCR_PROPS_HID
00208  *   USB_CFG_DESCR_PROPS_HID_REPORT
00209  *   USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
00210  *
00211  */
00212 
00213 #define USB_CFG_DESCR_PROPS_DEVICE                  0
00214 #define USB_CFG_DESCR_PROPS_CONFIGURATION           0
00215 #define USB_CFG_DESCR_PROPS_STRINGS                 0
00216 #define USB_CFG_DESCR_PROPS_STRING_0                0
00217 #define USB_CFG_DESCR_PROPS_STRING_VENDOR           0
00218 #define USB_CFG_DESCR_PROPS_STRING_PRODUCT          0
00219 #define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER    0
00220 #define USB_CFG_DESCR_PROPS_HID                     0
00221 #define USB_CFG_DESCR_PROPS_HID_REPORT              0
00222 #define USB_CFG_DESCR_PROPS_UNKNOWN                 0
00223 
00224 #endif /* __usbconfig_h_included__ */

Generated on Sat Jul 12 22:27:15 2008 for Dulcimer by  doxygen 1.5.4