00001
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #include "conf_usb.h"
00052
00053
00054 #if USB_DEVICE_FEATURE == ENABLED
00055
00056 #include "usb_drv.h"
00057 #include "usb_descriptors.h"
00058 #include "usb_standard_request.h"
00059 #include "usb_specific_request.h"
00060
00061
00062
00063
00064
00065
00066
00067
00068 const S_usb_device_descriptor usb_dev_desc =
00069 {
00070 sizeof(S_usb_device_descriptor),
00071 DEVICE_DESCRIPTOR,
00072 Usb_format_mcu_to_usb_data(16, USB_SPECIFICATION),
00073 DEVICE_CLASS,
00074 DEVICE_SUB_CLASS,
00075 DEVICE_PROTOCOL,
00076 EP_CONTROL_LENGTH,
00077 Usb_format_mcu_to_usb_data(16, VENDOR_ID),
00078 Usb_format_mcu_to_usb_data(16, PRODUCT_ID),
00079 Usb_format_mcu_to_usb_data(16, RELEASE_NUMBER),
00080 MAN_INDEX,
00081 PROD_INDEX,
00082 SN_INDEX,
00083 NB_CONFIGURATION
00084 };
00085
00086
00087
00088 const S_usb_user_configuration_descriptor usb_conf_desc_fs =
00089 {
00090 { sizeof(S_usb_configuration_descriptor)
00091 , CONFIGURATION_DESCRIPTOR
00092 , Usb_format_mcu_to_usb_data(16, sizeof(S_usb_user_configuration_descriptor))
00093 , NB_INTERFACE
00094 , CONF_NB
00095 , CONF_INDEX
00096 , CONF_ATTRIBUTES
00097 , MAX_POWER
00098 }
00099 , { sizeof(S_usb_interface_descriptor)
00100 , INTERFACE_DESCRIPTOR
00101 , INTERFACE_NB_0
00102 , ALTERNATE_0
00103 , NB_ENDPOINT_0
00104 , INTERFACE_CLASS_0
00105 , INTERFACE_SUB_CLASS_0
00106 , INTERFACE_PROTOCOL_0
00107 , INTERFACE_INDEX_0
00108 }
00109 , { 0x05,
00110
00111 0x24,
00112 0x00,
00113 0x10, 0x01,
00114
00115
00116 0x05,
00117
00118 0x24,
00119 0x01,
00120 0x03,
00121
00122
00123 0x01,
00124
00125 0x04,
00126
00127 0x24,
00128 0x02,
00129 0x06,
00130
00131
00132 0x05,
00133
00134 0x24,
00135 0x06,
00136 0x00,
00137
00138 0x01
00139 }
00140 , { sizeof(S_usb_endpoint_descriptor)
00141 , ENDPOINT_DESCRIPTOR
00142 , ENDPOINT_NB_3
00143 , EP_ATTRIBUTES_3
00144 , Usb_format_mcu_to_usb_data(16, EP_SIZE_3)
00145 , EP_INTERVAL_3
00146 }
00147 , { sizeof(S_usb_interface_descriptor)
00148 , INTERFACE_DESCRIPTOR
00149 , INTERFACE_NB_1
00150 , ALTERNATE_1
00151 , NB_ENDPOINT_1
00152 , INTERFACE_CLASS_1
00153 , INTERFACE_SUB_CLASS_1
00154 , INTERFACE_PROTOCOL_1
00155 , INTERFACE_INDEX_1
00156 }
00157 , { sizeof(S_usb_endpoint_descriptor)
00158 , ENDPOINT_DESCRIPTOR
00159 , ENDPOINT_NB_1
00160 , EP_ATTRIBUTES_1
00161 , Usb_format_mcu_to_usb_data(16, EP_SIZE_1_FS)
00162 , EP_INTERVAL_1
00163 }
00164 , { sizeof(S_usb_endpoint_descriptor)
00165 , ENDPOINT_DESCRIPTOR
00166 , ENDPOINT_NB_2
00167 , EP_ATTRIBUTES_2
00168 , Usb_format_mcu_to_usb_data(16, EP_SIZE_2_FS)
00169 , EP_INTERVAL_2
00170 }
00171 };
00172
00173
00174 #if (USB_HIGH_SPEED_SUPPORT==ENABLED)
00175
00176
00177
00178
00179 const S_usb_user_configuration_descriptor usb_conf_desc_hs =
00180 {
00181 { sizeof(S_usb_configuration_descriptor)
00182 , CONFIGURATION_DESCRIPTOR
00183 , Usb_format_mcu_to_usb_data(16, sizeof(S_usb_user_configuration_descriptor))
00184 , NB_INTERFACE
00185 , CONF_NB
00186 , CONF_INDEX
00187 , CONF_ATTRIBUTES
00188 , MAX_POWER
00189 }
00190 , { sizeof(S_usb_interface_descriptor)
00191 , INTERFACE_DESCRIPTOR
00192 , INTERFACE_NB_0
00193 , ALTERNATE_0
00194 , NB_ENDPOINT_0
00195 , INTERFACE_CLASS_0
00196 , INTERFACE_SUB_CLASS_0
00197 , INTERFACE_PROTOCOL_0
00198 , INTERFACE_INDEX_0
00199 }
00200 , { 0x05,
00201
00202 0x24,
00203 0x00,
00204 0x10, 0x01,
00205
00206
00207 0x05,
00208
00209 0x24,
00210 0x01,
00211 0x03,
00212
00213
00214 0x01,
00215
00216 0x04,
00217
00218 0x24,
00219 0x02,
00220 0x06,
00221
00222
00223 0x05,
00224
00225 0x24,
00226 0x06,
00227 0x00,
00228
00229 0x01
00230 }
00231 , { sizeof(S_usb_endpoint_descriptor)
00232 , ENDPOINT_DESCRIPTOR
00233 , ENDPOINT_NB_3
00234 , EP_ATTRIBUTES_3
00235 , Usb_format_mcu_to_usb_data(16, EP_SIZE_3)
00236 , EP_INTERVAL_3
00237 }
00238 , { sizeof(S_usb_interface_descriptor)
00239 , INTERFACE_DESCRIPTOR
00240 , INTERFACE_NB_1
00241 , ALTERNATE_1
00242 , NB_ENDPOINT_1
00243 , INTERFACE_CLASS_1
00244 , INTERFACE_SUB_CLASS_1
00245 , INTERFACE_PROTOCOL_1
00246 , INTERFACE_INDEX_1
00247 }
00248 , { sizeof(S_usb_endpoint_descriptor)
00249 , ENDPOINT_DESCRIPTOR
00250 , ENDPOINT_NB_1
00251 , EP_ATTRIBUTES_1
00252 , Usb_format_mcu_to_usb_data(16, EP_SIZE_1_HS)
00253 , EP_INTERVAL_1
00254 }
00255 , { sizeof(S_usb_endpoint_descriptor)
00256 , ENDPOINT_DESCRIPTOR
00257 , ENDPOINT_NB_2
00258 , EP_ATTRIBUTES_2
00259 , Usb_format_mcu_to_usb_data(16, EP_SIZE_2_HS)
00260 , EP_INTERVAL_2
00261 }
00262 };
00263
00264
00265
00266 const S_usb_device_qualifier_descriptor usb_qualifier_desc =
00267 {
00268 sizeof(S_usb_device_qualifier_descriptor),
00269 DEVICE_QUALIFIER_DESCRIPTOR,
00270 Usb_format_mcu_to_usb_data(16, USB_SPECIFICATION),
00271 DEVICE_CLASS,
00272 DEVICE_SUB_CLASS,
00273 DEVICE_PROTOCOL,
00274 EP_CONTROL_LENGTH,
00275 NB_CONFIGURATION,
00276 0
00277 };
00278 #endif
00279
00280
00281
00282 const S_usb_language_id usb_user_language_id =
00283 {
00284 sizeof(S_usb_language_id),
00285 STRING_DESCRIPTOR,
00286 Usb_format_mcu_to_usb_data(16, LANGUAGE_ID)
00287 };
00288
00289
00290
00291 const S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor =
00292 {
00293 sizeof(S_usb_manufacturer_string_descriptor),
00294 STRING_DESCRIPTOR,
00295 USB_MANUFACTURER_NAME
00296 };
00297
00298
00299
00300 const S_usb_product_string_descriptor usb_user_product_string_descriptor =
00301 {
00302 sizeof(S_usb_product_string_descriptor),
00303 STRING_DESCRIPTOR,
00304 USB_PRODUCT_NAME
00305 };
00306
00307
00308
00309 const S_usb_serial_number usb_user_serial_number =
00310 {
00311 sizeof(S_usb_serial_number),
00312 STRING_DESCRIPTOR,
00313 USB_SERIAL_NUMBER
00314 };
00315
00316
00317 #endif // USB_DEVICE_FEATURE == ENABLED