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