several changes..
1 /*********************************************************************
3 * Microchip USB C18 Firmware Version 1.0
5 *********************************************************************
6 * FileName: usbdefs_std_dsc.h
7 * Dependencies: See INCLUDES section below
9 * Compiler: C18 2.30.01+
10 * Company: Microchip Technology, Inc.
12 * Software License Agreement
14 * The software supplied herewith by Microchip Technology Incorporated
15 * (the “Company”) for its PICmicro® Microcontroller is intended and
16 * supplied to you, the Company’s customer, for use solely and
17 * exclusively on Microchip PICmicro Microcontroller products. The
18 * software is owned by the Company and/or its supplier, and is
19 * protected under applicable copyright laws. All rights are reserved.
20 * Any use in violation of the foregoing restrictions may subject the
21 * user to criminal sanctions under applicable laws, as well as to
22 * civil liability for the breach of the terms and conditions of this
25 * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
26 * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
27 * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
28 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
29 * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
30 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
33 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 * Rawin Rojvanit 11/19/04 Original.
35 ********************************************************************/
37 /******************************************************************************
38 * USB Definitions: Standard Descriptors
39 *****************************************************************************/
40 #ifndef USBDEFS_STD_DSC_H
41 #define USBDEFS_STD_DSC_H
43 /** I N C L U D E S **********************************************************/
46 /** D E F I N I T I O N S ****************************************************/
48 /* Descriptor Types */
55 /******************************************************************************
56 * USB Endpoint Definitions
57 * USB Standard EP Address Format: DIR:X:X:X:EP3:EP2:EP1:EP0
58 * This is used in the descriptors. See autofiles\usbdsc.c
60 * NOTE: Do not use these values for checking against USTAT.
61 * To check against USTAT, use values defined in "system\usb\usbdrv\usbdrv.h"
62 *****************************************************************************/
63 #define _EP01_OUT 0x01
65 #define _EP02_OUT 0x02
67 #define _EP03_OUT 0x03
69 #define _EP04_OUT 0x04
71 #define _EP05_OUT 0x05
73 #define _EP06_OUT 0x06
75 #define _EP07_OUT 0x07
77 #define _EP08_OUT 0x08
79 #define _EP09_OUT 0x09
81 #define _EP10_OUT 0x0A
83 #define _EP11_OUT 0x0B
85 #define _EP12_OUT 0x0C
87 #define _EP13_OUT 0x0D
89 #define _EP14_OUT 0x0E
91 #define _EP15_OUT 0x0F
94 /* Configuration Attributes */
95 #define _DEFAULT 0x01<<7 //Default Value (Bit 7 is set)
96 #define _SELF 0x01<<6 //Self-powered (Supports if set)
97 #define _RWU 0x01<<5 //Remote Wakeup (Supports if set)
99 /* Endpoint Transfer Type */
100 #define _CTRL 0x00 //Control Transfer
101 #define _ISO 0x01 //Isochronous Transfer
102 #define _BULK 0x02 //Bulk Transfer
103 #define _INT 0x03 //Interrupt Transfer
105 /* Isochronous Endpoint Synchronization Type */
106 #define _NS 0x00<<2 //No Synchronization
107 #define _AS 0x01<<2 //Asynchronous
108 #define _AD 0x02<<2 //Adaptive
109 #define _SY 0x03<<2 //Synchronous
111 /* Isochronous Endpoint Usage Type */
112 #define _DE 0x00<<4 //Data endpoint
113 #define _FE 0x01<<4 //Feedback endpoint
114 #define _IE 0x02<<4 //Implicit feedback Data endpoint
117 /** S T R U C T U R E ********************************************************/
119 /******************************************************************************
120 * USB Device Descriptor Structure
121 *****************************************************************************/
122 typedef struct _USB_DEV_DSC
124 byte bLength; byte bDscType; word bcdUSB;
125 byte bDevCls; byte bDevSubCls; byte bDevProtocol;
126 byte bMaxPktSize0; word idVendor; word idProduct;
127 word bcdDevice; byte iMFR; byte iProduct;
128 byte iSerialNum; byte bNumCfg;
131 /******************************************************************************
132 * USB Configuration Descriptor Structure
133 *****************************************************************************/
134 typedef struct _USB_CFG_DSC
136 byte bLength; byte bDscType; word wTotalLength;
137 byte bNumIntf; byte bCfgValue; byte iCfg;
138 byte bmAttributes; byte bMaxPower;
141 /******************************************************************************
142 * USB Interface Descriptor Structure
143 *****************************************************************************/
144 typedef struct _USB_INTF_DSC
146 byte bLength; byte bDscType; byte bIntfNum;
147 byte bAltSetting; byte bNumEPs; byte bIntfCls;
148 byte bIntfSubCls; byte bIntfProtocol; byte iIntf;
151 /******************************************************************************
152 * USB Endpoint Descriptor Structure
153 *****************************************************************************/
154 typedef struct _USB_EP_DSC
156 byte bLength; byte bDscType; byte bEPAdr;
157 byte bmAttributes; word wMaxPktSize; byte bInterval;
160 #endif //USBDEFS_STD_DSC_H