00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _USB_ENUM_H_
00024 #define _USB_ENUM_H_
00025
00026
00027
00028 #include "usb_descriptors.h"
00029
00030
00031
00032
00033
00036
00039 #define GET_STATUS 0x00
00040 #define GET_DEVICE 0x01
00041 #define CLEAR_FEATURE 0x01
00042 #define GET_STRING 0x03
00043 #define SET_FEATURE 0x03
00044 #define SET_ADDRESS 0x05
00045 #define GET_DESCRIPTOR 0x06
00046 #define SET_DESCRIPTOR 0x07
00047 #define GET_CONFIGURATION 0x08
00048 #define SET_CONFIGURATION 0x09
00049 #define GET_INTERFACE 0x0A
00050 #define SET_INTERFACE 0x0B
00051 #define SYNCH_FRAME 0x0C
00052
00053 #define GET_DEVICE_DESCRIPTOR 1
00054 #define GET_CONFIGURATION_DESCRIPTOR 4
00055
00056 #define REQUEST_DEVICE_STATUS 0x80
00057 #define REQUEST_INTERFACE_STATUS 0x81
00058 #define REQUEST_ENDPOINT_STATUS 0x82
00059 #define ZERO_TYPE 0x00
00060 #define INTERFACE_TYPE 0x01
00061 #define ENDPOINT_TYPE 0x02
00062
00063
00064 #define DEVICE_DESCRIPTOR 0x01
00065 #define CONFIGURATION_DESCRIPTOR 0x02
00066 #define STRING_DESCRIPTOR 0x03
00067 #define INTERFACE_DESCRIPTOR 0x04
00068 #define ENDPOINT_DESCRIPTOR 0x05
00069 #define DEVICE_QUALIFIER_DESCRIPTOR 0x06
00070 #define OTHER_SPEED_CONFIGURATION_DESCRIPTOR 0x07
00071
00072
00073
00074
00075 #define FEATURE_DEVICE_REMOTE_WAKEUP 0x01
00076 #define FEATURE_ENDPOINT_HALT 0x00
00077
00078 #define TEST_J 0x01
00079 #define TEST_K 0x02
00080 #define TEST_SEO_NAK 0x03
00081 #define TEST_PACKET 0x04
00082 #define TEST_FORCE_ENABLE 0x05
00083
00084
00085
00086 #define BUS_POWERED 0
00087 #define SELF_POWERED 1
00088
00090
00091
00092 #define ATTACHED 0
00093 #define POWERED 1
00094 #define DEFAULT 2
00095 #define ADDRESSED 3
00096 #define CONFIGURED 4
00097 #define SUSPENDED 5
00098
00099 #define USB_CONFIG_ATTRIBUTES_RESERVED 0x80
00100 #define USB_CONFIG_BUSPOWERED (USB_CONFIG_ATTRIBUTES_RESERVED | 0x00)
00101 #define USB_CONFIG_SELFPOWERED (USB_CONFIG_ATTRIBUTES_RESERVED | 0x40)
00102 #define USB_CONFIG_REMOTEWAKEUP (USB_CONFIG_ATTRIBUTES_RESERVED | 0x20)
00103
00104
00105
00108 #define Is_device_enumerated() ((usb_configuration_nb!=0) ? TRUE : FALSE)
00109 #define Is_device_not_enumerated() ((usb_configuration_nb!=0) ? FALSE : TRUE)
00110
00111
00112 void usb_var_init( void);
00113
00133 void usb_process_request( void);
00134
00135 extern U8 usb_configuration_nb;
00136
00138
00139 #endif // _USB_ENUM_H_
00140