00001
00016
00017
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 #include "config.h"
00051 #include "conf_usb.h"
00052
00053 #include "lib_mcu/usb/usb_drv.h"
00054 #include "usb_descriptors.h"
00055 #include "modules/usb/device_chap9/usb_standard_request.h"
00056 #include "usb_specific_request.h"
00057 #if ((USB_DEVICE_SN_USE==ENABLE) && (USE_DEVICE_SN_UNIQUE==ENABLE))
00058 #include "lib_mcu/flash/flash_drv.h"
00059 #endif
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 code S_usb_device_descriptor usb_dev_desc =
00070 {
00071 sizeof(usb_dev_desc)
00072 , DESCRIPTOR_DEVICE
00073 , Usb_write_word_enum_struc(USB_SPECIFICATION)
00074 , DEVICE_CLASS
00075 , DEVICE_SUB_CLASS
00076 , DEVICE_PROTOCOL
00077 , EP_CONTROL_LENGTH
00078 , Usb_write_word_enum_struc(VENDOR_ID)
00079 , Usb_write_word_enum_struc(PRODUCT_ID)
00080 , Usb_write_word_enum_struc(RELEASE_NUMBER)
00081 , MAN_INDEX
00082 , PROD_INDEX
00083 , SN_INDEX
00084 , NB_CONFIGURATION
00085 };
00086
00087
00088 code S_usb_user_configuration_descriptor usb_conf_desc = {
00089 { sizeof(S_usb_configuration_descriptor)
00090 , DESCRIPTOR_CONFIGURATION
00091
00092 , 0x0043
00093 , NB_INTERFACE
00094 , CONF_NB
00095 , CONF_INDEX
00096 , CONF_ATTRIBUTES
00097 , MAX_POWER
00098 }
00099 ,
00100 { sizeof(S_usb_interface_descriptor)
00101 , DESCRIPTOR_INTERFACE
00102 , INTERFACE0_NB
00103 , ALTERNATE0
00104 , NB_ENDPOINT0
00105 , INTERFACE0_CLASS
00106 , INTERFACE0_SUB_CLASS
00107 , INTERFACE0_PROTOCOL
00108 , INTERFACE0_INDEX
00109 }
00110 ,
00111 { 0x05, 0x24, 0x00, 0x10, 0x01, 0x05, 0x24, 0x01, 0x03, 0x01, 0x04, 0x24, 0x02, 0x06,0x05, 0x24, 0x06, 0x00, 0x01 }
00112 ,
00113 { sizeof(S_usb_endpoint_descriptor)
00114 , DESCRIPTOR_ENDPOINT
00115 , ENDPOINT_NB_3
00116 , EP_ATTRIBUTES_3
00117 , Usb_write_word_enum_struc(EP_SIZE_3)
00118 , EP_INTERVAL_3
00119 }
00120 ,
00121 { sizeof(S_usb_interface_descriptor)
00122 , DESCRIPTOR_INTERFACE
00123 , INTERFACE1_NB
00124 , ALTERNATE1
00125 , NB_ENDPOINT1
00126 , INTERFACE1_CLASS
00127 , INTERFACE1_SUB_CLASS
00128 , INTERFACE1_PROTOCOL
00129 , INTERFACE1_INDEX
00130 }
00131 ,
00132 { sizeof(S_usb_endpoint_descriptor)
00133 , DESCRIPTOR_ENDPOINT
00134 , ENDPOINT_NB_1
00135 , EP_ATTRIBUTES_1
00136 , Usb_write_word_enum_struc(EP_SIZE_1)
00137 , EP_INTERVAL_1
00138 }
00139 ,
00140 { sizeof(S_usb_endpoint_descriptor)
00141 , DESCRIPTOR_ENDPOINT
00142 , ENDPOINT_NB_2
00143 , EP_ATTRIBUTES_2
00144 , Usb_write_word_enum_struc(EP_SIZE_2)
00145 , EP_INTERVAL_2
00146 }
00147
00148
00149 };
00150
00151
00152
00153
00154 code S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor = {
00155 sizeof(usb_user_manufacturer_string_descriptor)
00156 , DESCRIPTOR_STRING
00157 , USB_MANUFACTURER_NAME
00158 };
00159
00160
00161
00162
00163 code S_usb_product_string_descriptor usb_user_product_string_descriptor = {
00164 sizeof(usb_user_product_string_descriptor)
00165 , DESCRIPTOR_STRING
00166 , USB_PRODUCT_NAME
00167 };
00168
00169
00170
00171 #if (USB_DEVICE_SN_USE==ENABLE)
00172 code S_usb_serial_number usb_user_serial_number = {
00173 #if (USE_DEVICE_SN_UNIQUE==ENABLE)
00174 sizeof(usb_user_serial_number)+4*SN_LENGTH
00175 , DESCRIPTOR_STRING
00176 #else
00177 sizeof(usb_user_serial_number)
00178 , DESCRIPTOR_STRING
00179 , USB_SERIAL_NUMBER
00180 #endif
00181 };
00182 #endif
00183
00184
00185
00186 code S_usb_language_id usb_user_language_id = {
00187 sizeof(usb_user_language_id)
00188 , DESCRIPTOR_STRING
00189 , Usb_write_word_enum_struc(LANGUAGE_ID)
00190 };
00191
00192
00193