00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "config.h"
00022 #include "conf_usb.h"
00023
00024 #include "lib_mcu\usb\usb_drv.h"
00025 #include "usb_descriptors.h"
00026 #include "modules\usb\device_chap9\usb_standard_request.h"
00027 #include "usb_specific_request.h"
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 code S_usb_device_descriptor usb_dev_desc =
00039 {
00040 sizeof(usb_dev_desc)
00041 , DEVICE_DESCRIPTOR
00042 , Usb_write_word_enum_struc(USB_SPECIFICATION)
00043 , DEVICE_CLASS
00044 , DEVICE_SUB_CLASS
00045 , DEVICE_PROTOCOL
00046 , EP_CONTROL_LENGTH
00047 , Usb_write_word_enum_struc(VENDOR_ID)
00048 , Usb_write_word_enum_struc(PRODUCT_ID)
00049 , Usb_write_word_enum_struc(RELEASE_NUMBER)
00050 , MAN_INDEX
00051 , PROD_INDEX
00052 , SN_INDEX
00053 , NB_CONFIGURATION
00054 };
00055
00056
00057 code S_usb_user_configuration_descriptor usb_conf_desc = {
00058 { sizeof(S_usb_configuration_descriptor)
00059 , CONFIGURATION_DESCRIPTOR
00060
00061 , 0x0043
00062 , NB_INTERFACE
00063 , CONF_NB
00064 , CONF_INDEX
00065 , CONF_ATTRIBUTES
00066 , MAX_POWER
00067 }
00068 ,
00069 { sizeof(S_usb_interface_descriptor)
00070 , INTERFACE_DESCRIPTOR
00071 , INTERFACE0_NB
00072 , ALTERNATE0
00073 , NB_ENDPOINT0
00074 , INTERFACE0_CLASS
00075 , INTERFACE0_SUB_CLASS
00076 , INTERFACE0_PROTOCOL
00077 , INTERFACE0_INDEX
00078 }
00079 ,
00080 { 0x05, 0x24, 0x00, 0x10, 0x01, 0x05, 0x24, 0x01, 0x03, 0x01, 0x04, 0x24, 0x02, 0x06,0x05, 0x24, 0x06, 0x00, 0x01 }
00081 ,
00082 { sizeof(S_usb_endpoint_descriptor)
00083 , ENDPOINT_DESCRIPTOR
00084 , ENDPOINT_NB_3
00085 , EP_ATTRIBUTES_3
00086 , Usb_write_word_enum_struc(EP_SIZE_3)
00087 , EP_INTERVAL_3
00088 }
00089 ,
00090 { sizeof(S_usb_interface_descriptor)
00091 , INTERFACE_DESCRIPTOR
00092 , INTERFACE1_NB
00093 , ALTERNATE1
00094 , NB_ENDPOINT1
00095 , INTERFACE1_CLASS
00096 , INTERFACE1_SUB_CLASS
00097 , INTERFACE1_PROTOCOL
00098 , INTERFACE1_INDEX
00099 }
00100 ,
00101 { sizeof(S_usb_endpoint_descriptor)
00102 , ENDPOINT_DESCRIPTOR
00103 , ENDPOINT_NB_1
00104 , EP_ATTRIBUTES_1
00105 , Usb_write_word_enum_struc(EP_SIZE_1)
00106 , EP_INTERVAL_1
00107 }
00108 ,
00109 { sizeof(S_usb_endpoint_descriptor)
00110 , ENDPOINT_DESCRIPTOR
00111 , ENDPOINT_NB_2
00112 , EP_ATTRIBUTES_2
00113 , Usb_write_word_enum_struc(EP_SIZE_2)
00114 , EP_INTERVAL_2
00115 }
00116
00117
00118 };
00119
00120
00121
00122
00123 code S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor = {
00124 sizeof(usb_user_manufacturer_string_descriptor)
00125 , STRING_DESCRIPTOR
00126 , USB_MANUFACTURER_NAME
00127 };
00128
00129
00130
00131
00132 code S_usb_product_string_descriptor usb_user_product_string_descriptor = {
00133 sizeof(usb_user_product_string_descriptor)
00134 , STRING_DESCRIPTOR
00135 , USB_PRODUCT_NAME
00136 };
00137
00138
00139
00140
00141 code S_usb_serial_number usb_user_serial_number = {
00142 sizeof(usb_user_serial_number)
00143 , STRING_DESCRIPTOR
00144 , USB_SERIAL_NUMBER
00145 };
00146
00147
00148
00149
00150 code S_usb_language_id usb_user_language_id = {
00151 sizeof(usb_user_language_id)
00152 , STRING_DESCRIPTOR
00153 , Usb_write_word_enum_struc(LANGUAGE_ID)
00154 };
00155
00156
00157