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 code S_usb_device_descriptor usb_dev_desc =
00066 {
00067 sizeof(usb_dev_desc)
00068 , DESCRIPTOR_DEVICE
00069 , Usb_write_word_enum_struc(USB_SPECIFICATION)
00070 , DEVICE_CLASS
00071 , DEVICE_SUB_CLASS
00072 , DEVICE_PROTOCOL
00073 , EP_CONTROL_LENGTH
00074 , Usb_write_word_enum_struc(VENDOR_ID)
00075 , Usb_write_word_enum_struc(PRODUCT_ID)
00076 , Usb_write_word_enum_struc(RELEASE_NUMBER)
00077 , MAN_INDEX
00078 , PROD_INDEX
00079 , SN_INDEX
00080 , NB_CONFIGURATION
00081 };
00082
00083
00084
00085 code S_usb_user_configuration_descriptor usb_conf_desc = {
00086 { sizeof(S_usb_configuration_descriptor)
00087 , DESCRIPTOR_CONFIGURATION
00088 , Usb_write_word_enum_struc(sizeof(S_usb_configuration_descriptor)\
00089 +sizeof(S_usb_interface_descriptor) \
00090 +sizeof(S_usb_endpoint_descriptor) \
00091 +sizeof(S_usb_endpoint_descriptor))
00092 , NB_INTERFACE
00093 , CONF_NB
00094 , CONF_INDEX
00095 , CONF_ATTRIBUTES
00096 , MAX_POWER
00097 }
00098 ,
00099 { sizeof(S_usb_interface_descriptor)
00100 , DESCRIPTOR_INTERFACE
00101 , INTERFACE_NB
00102 , ALTERNATE
00103 , NB_ENDPOINT
00104 , INTERFACE_CLASS
00105 , INTERFACE_SUB_CLASS
00106 , INTERFACE_PROTOCOL
00107 , INTERFACE_INDEX
00108 }
00109 ,
00110 { sizeof(S_usb_endpoint_descriptor)
00111 , DESCRIPTOR_ENDPOINT
00112 , ENDPOINT_NB_1
00113 , EP_ATTRIBUTES_1
00114 , Usb_write_word_enum_struc(EP_SIZE_1)
00115 , EP_INTERVAL_1
00116 }
00117 ,
00118 { sizeof(S_usb_endpoint_descriptor)
00119 , DESCRIPTOR_ENDPOINT
00120 , ENDPOINT_NB_2
00121 , EP_ATTRIBUTES_2
00122 , Usb_write_word_enum_struc(EP_SIZE_2)
00123 , EP_INTERVAL_2
00124 }
00125 };
00126
00127
00128
00129
00130 code S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor = {
00131 sizeof(usb_user_manufacturer_string_descriptor)
00132 , DESCRIPTOR_STRING
00133 , USB_MANUFACTURER_NAME
00134 };
00135
00136
00137
00138
00139 code S_usb_product_string_descriptor usb_user_product_string_descriptor = {
00140 sizeof(usb_user_product_string_descriptor)
00141 , DESCRIPTOR_STRING
00142 , USB_PRODUCT_NAME
00143 };
00144
00145
00146
00147 #if (USB_DEVICE_SN_USE==ENABLE)
00148 code S_usb_serial_number usb_user_serial_number = {
00149 #if (USE_DEVICE_SN_UNIQUE==ENABLE)
00150 sizeof(usb_user_serial_number)+4*SN_LENGTH
00151 , DESCRIPTOR_STRING
00152 #else
00153 sizeof(usb_user_serial_number)
00154 , DESCRIPTOR_STRING
00155 , USB_SERIAL_NUMBER
00156 #endif
00157 };
00158 #endif
00159
00160
00161
00162 code S_usb_language_id usb_user_language_id = {
00163 sizeof(usb_user_language_id)
00164 , DESCRIPTOR_STRING
00165 , Usb_write_word_enum_struc(LANGUAGE_ID)
00166 };
00167