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