Xmega Application Note


usb_standard_request.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00054 #ifndef _USB_ENUM_H_
00055 #define _USB_ENUM_H_
00056 
00057 #include "usb_descriptors.h"
00058 
00059 /****************************** DEFINES ***************************************/
00060 
00061 /* USB device standard  requests decoding module */
00062 #define GET_STATUS                     0x00
00063 #define GET_DEVICE                     0x01
00064 #define CLEAR_FEATURE                  0x01           
00065 #define GET_STRING                     0x03
00066 #define SET_FEATURE                    0x03           
00067 #define SET_ADDRESS                    0x05
00068 #define GET_DESCRIPTOR                 0x06
00069 #define SET_DESCRIPTOR                 0x07
00070 #define GET_CONFIGURATION              0x08
00071 #define SET_CONFIGURATION              0x09
00072 #define GET_INTERFACE                  0x0A
00073 #define SET_INTERFACE                  0x0B
00074 #define SYNCH_FRAME                    0x0C
00075 
00076 #define GET_DEVICE_DESCRIPTOR             1
00077 #define GET_CONFIGURATION_DESCRIPTOR      4
00078 
00079 #define REQUEST_DEVICE_STATUS          0x80
00080 #define REQUEST_INTERFACE_STATUS       0x81
00081 #define REQUEST_ENDPOINT_STATUS        0x82
00082 #define ZERO_TYPE                      0x00
00083 #define INTERFACE_TYPE                 0x01
00084 #define ENDPOINT_TYPE                  0x02
00085 
00086 /* Descriptor Types */
00087 #define DEVICE_DESCRIPTOR                     0x01
00088 #define CONFIGURATION_DESCRIPTOR              0x02
00089 #define STRING_DESCRIPTOR                     0x03
00090 #define INTERFACE_DESCRIPTOR                  0x04
00091 #define ENDPOINT_DESCRIPTOR                   0x05
00092 #define DEVICE_QUALIFIER_DESCRIPTOR           0x06
00093 #define OTHER_SPEED_CONFIGURATION_DESCRIPTOR  0x07
00094 #define INTERFACE_ASSOCIATION_DESCRIPTOR      0x0B
00095 
00096 
00097 /* Standard Features */
00098 #define FEATURE_DEVICE_REMOTE_WAKEUP   0x01
00099 #define FEATURE_ENDPOINT_HALT          0x00
00100 
00101 #define TEST_J                         0x01
00102 #define TEST_K                         0x02
00103 #define TEST_SEO_NAK                   0x03
00104 #define TEST_PACKET                    0x04
00105 #define TEST_FORCE_ENABLE              0x05
00106 
00107 /* Endpoint Features */
00108 #define EP_ATTR_CONTROL                0x00
00109 #define EP_ATTR_ISOCHRON               0x01
00110 #define EP_ATTR_BULK                   0x02
00111 #define EP_ATTR_INTERUPT               0x03
00112 #define EP_DIR_OUT                     0x00
00113 #define EP_DIR_IN                      0x80
00114 
00115 /* Device Status */
00116 #define BUS_POWERED                       0
00117 #define SELF_POWERED                      1
00118 
00119 /* Device State */
00120 #define ATTACHED                          0
00121 #define POWERED                           1
00122 #define DEFAULT                           2
00123 #define ADDRESSED                         3
00124 #define CONFIGURED                        4
00125 #define SUSPENDED                         5
00126 
00127 /* Device Power */
00128 #define USB_CONFIG_ATTRIBUTES_RESERVED    0x80
00129 #define USB_CONFIG_BUSPOWERED            (USB_CONFIG_ATTRIBUTES_RESERVED | 0x00)
00130 #define USB_CONFIG_SELFPOWERED           (USB_CONFIG_ATTRIBUTES_RESERVED | 0x40)
00131 #define USB_CONFIG_REMOTEWAKEUP          (USB_CONFIG_ATTRIBUTES_RESERVED | 0x20)
00132 
00133 
00134 /****************************** MACROS ****************************************/
00135 
00137 #define Is_device_enumerated()            ((usb_configuration_nb!=0)   ? true : false)
00138 
00140 #define Is_device_not_enumerated()        ((usb_configuration_nb!=0)   ? false : true)
00141 
00142 
00143 /************************* PROTOTYPES (GLOBAL) ********************************/
00144 
00145 void usb_var_init(void);
00146 void usb_process_request( void);
00147 extern uint8_t usb_configuration_nb;
00148 
00149 #endif  /* _USB_ENUM_H_ */
00150 
@DOC_TITLE@
Generated on Mon Jan 18 09:26:08 2010 for AVR1907 Xplain USB Gateway by doxygen 1.5.5