Hideharu Tsunemoto / Mbed 2 deprecated SmallDoseMeter_Single_AE_LPC11U35

Dependencies:   mbed

Dependents:   SmallDoseMeter_SingleCH_AE_lpc11u35_V1_00

Committer:
H_Tsunemoto
Date:
Mon Feb 19 09:09:52 2018 +0000
Revision:
1:b1a3be5f48ab
Parent:
0:871ab6846b18
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
H_Tsunemoto 0:871ab6846b18 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
H_Tsunemoto 0:871ab6846b18 2 *
H_Tsunemoto 0:871ab6846b18 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
H_Tsunemoto 0:871ab6846b18 4 * and associated documentation files (the "Software"), to deal in the Software without
H_Tsunemoto 0:871ab6846b18 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
H_Tsunemoto 0:871ab6846b18 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
H_Tsunemoto 0:871ab6846b18 7 * Software is furnished to do so, subject to the following conditions:
H_Tsunemoto 0:871ab6846b18 8 *
H_Tsunemoto 0:871ab6846b18 9 * The above copyright notice and this permission notice shall be included in all copies or
H_Tsunemoto 0:871ab6846b18 10 * substantial portions of the Software.
H_Tsunemoto 0:871ab6846b18 11 *
H_Tsunemoto 0:871ab6846b18 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
H_Tsunemoto 0:871ab6846b18 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
H_Tsunemoto 0:871ab6846b18 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
H_Tsunemoto 0:871ab6846b18 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
H_Tsunemoto 0:871ab6846b18 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
H_Tsunemoto 0:871ab6846b18 17 */
H_Tsunemoto 0:871ab6846b18 18
H_Tsunemoto 0:871ab6846b18 19 #include "stdint.h"
H_Tsunemoto 0:871ab6846b18 20 #include "USBCDC.h"
H_Tsunemoto 0:871ab6846b18 21
H_Tsunemoto 0:871ab6846b18 22 static uint8_t cdc_line_coding[7]= {0x80, 0x25, 0x00, 0x00, 0x00, 0x00, 0x08};
H_Tsunemoto 0:871ab6846b18 23
H_Tsunemoto 0:871ab6846b18 24 #define DEFAULT_CONFIGURATION (1)
H_Tsunemoto 0:871ab6846b18 25
H_Tsunemoto 0:871ab6846b18 26 #define CDC_SET_LINE_CODING 0x20
H_Tsunemoto 0:871ab6846b18 27 #define CDC_GET_LINE_CODING 0x21
H_Tsunemoto 0:871ab6846b18 28 #define CDC_SET_CONTROL_LINE_STATE 0x22
H_Tsunemoto 0:871ab6846b18 29
H_Tsunemoto 0:871ab6846b18 30 #define MAX_CDC_REPORT_SIZE MAX_PACKET_SIZE_EPBULK
H_Tsunemoto 0:871ab6846b18 31
H_Tsunemoto 0:871ab6846b18 32 USBCDC::USBCDC(uint16_t vendor_id, uint16_t product_id, uint16_t product_release, bool connect_blocking): USBDevice(vendor_id, product_id, product_release) {
H_Tsunemoto 0:871ab6846b18 33 terminal_connected = false;
H_Tsunemoto 0:871ab6846b18 34 USBDevice::connect(connect_blocking);
H_Tsunemoto 0:871ab6846b18 35 }
H_Tsunemoto 0:871ab6846b18 36
H_Tsunemoto 0:871ab6846b18 37 bool USBCDC::USBCallback_request(void) {
H_Tsunemoto 0:871ab6846b18 38 /* Called in ISR context */
H_Tsunemoto 0:871ab6846b18 39
H_Tsunemoto 0:871ab6846b18 40 bool success = false;
H_Tsunemoto 0:871ab6846b18 41 CONTROL_TRANSFER * transfer = getTransferPtr();
H_Tsunemoto 0:871ab6846b18 42
H_Tsunemoto 0:871ab6846b18 43 /* Process class-specific requests */
H_Tsunemoto 0:871ab6846b18 44
H_Tsunemoto 0:871ab6846b18 45 if (transfer->setup.bmRequestType.Type == CLASS_TYPE) {
H_Tsunemoto 0:871ab6846b18 46 switch (transfer->setup.bRequest) {
H_Tsunemoto 0:871ab6846b18 47 case CDC_GET_LINE_CODING:
H_Tsunemoto 0:871ab6846b18 48 transfer->remaining = 7;
H_Tsunemoto 0:871ab6846b18 49 transfer->ptr = cdc_line_coding;
H_Tsunemoto 0:871ab6846b18 50 transfer->direction = DEVICE_TO_HOST;
H_Tsunemoto 0:871ab6846b18 51 success = true;
H_Tsunemoto 0:871ab6846b18 52 break;
H_Tsunemoto 0:871ab6846b18 53 case CDC_SET_LINE_CODING:
H_Tsunemoto 0:871ab6846b18 54 transfer->remaining = 7;
H_Tsunemoto 0:871ab6846b18 55 transfer->notify = true;
H_Tsunemoto 0:871ab6846b18 56 success = true;
H_Tsunemoto 0:871ab6846b18 57 terminal_connected = true;
H_Tsunemoto 0:871ab6846b18 58 break;
H_Tsunemoto 0:871ab6846b18 59 case CDC_SET_CONTROL_LINE_STATE:
H_Tsunemoto 0:871ab6846b18 60 terminal_connected = false;
H_Tsunemoto 0:871ab6846b18 61 success = true;
H_Tsunemoto 0:871ab6846b18 62 break;
H_Tsunemoto 0:871ab6846b18 63 default:
H_Tsunemoto 0:871ab6846b18 64 break;
H_Tsunemoto 0:871ab6846b18 65 }
H_Tsunemoto 0:871ab6846b18 66 }
H_Tsunemoto 0:871ab6846b18 67
H_Tsunemoto 0:871ab6846b18 68 return success;
H_Tsunemoto 0:871ab6846b18 69 }
H_Tsunemoto 0:871ab6846b18 70
H_Tsunemoto 0:871ab6846b18 71 void USBCDC::USBCallback_requestCompleted(uint8_t *buf, uint32_t length) {
H_Tsunemoto 0:871ab6846b18 72 // Request of setting line coding has 7 bytes
H_Tsunemoto 0:871ab6846b18 73 if (length != 7) {
H_Tsunemoto 0:871ab6846b18 74 return;
H_Tsunemoto 0:871ab6846b18 75 }
H_Tsunemoto 0:871ab6846b18 76
H_Tsunemoto 0:871ab6846b18 77 CONTROL_TRANSFER * transfer = getTransferPtr();
H_Tsunemoto 0:871ab6846b18 78
H_Tsunemoto 0:871ab6846b18 79 /* Process class-specific requests */
H_Tsunemoto 0:871ab6846b18 80 if (transfer->setup.bmRequestType.Type == CLASS_TYPE) {
H_Tsunemoto 0:871ab6846b18 81 if (transfer->setup.bRequest == CDC_SET_LINE_CODING) {
H_Tsunemoto 0:871ab6846b18 82 if (memcmp(cdc_line_coding, buf, 7)) {
H_Tsunemoto 0:871ab6846b18 83 memcpy(cdc_line_coding, buf, 7);
H_Tsunemoto 0:871ab6846b18 84
H_Tsunemoto 0:871ab6846b18 85 int baud = buf[0] + (buf[1] << 8)
H_Tsunemoto 0:871ab6846b18 86 + (buf[2] << 16) + (buf[3] << 24);
H_Tsunemoto 0:871ab6846b18 87 int stop = buf[4];
H_Tsunemoto 0:871ab6846b18 88 int bits = buf[6];
H_Tsunemoto 0:871ab6846b18 89 int parity = buf[5];
H_Tsunemoto 0:871ab6846b18 90
H_Tsunemoto 0:871ab6846b18 91 lineCodingChanged(baud, bits, parity, stop);
H_Tsunemoto 0:871ab6846b18 92 }
H_Tsunemoto 0:871ab6846b18 93 }
H_Tsunemoto 0:871ab6846b18 94 }
H_Tsunemoto 0:871ab6846b18 95 }
H_Tsunemoto 0:871ab6846b18 96
H_Tsunemoto 0:871ab6846b18 97 // Called in ISR context
H_Tsunemoto 0:871ab6846b18 98 // Set configuration. Return false if the
H_Tsunemoto 0:871ab6846b18 99 // configuration is not supported.
H_Tsunemoto 0:871ab6846b18 100 bool USBCDC::USBCallback_setConfiguration(uint8_t configuration) {
H_Tsunemoto 0:871ab6846b18 101 if (configuration != DEFAULT_CONFIGURATION) {
H_Tsunemoto 0:871ab6846b18 102 return false;
H_Tsunemoto 0:871ab6846b18 103 }
H_Tsunemoto 0:871ab6846b18 104
H_Tsunemoto 0:871ab6846b18 105 // Configure endpoints > 0
H_Tsunemoto 0:871ab6846b18 106 addEndpoint(EPINT_IN, MAX_PACKET_SIZE_EPINT);
H_Tsunemoto 0:871ab6846b18 107 addEndpoint(EPBULK_IN, MAX_PACKET_SIZE_EPBULK);
H_Tsunemoto 0:871ab6846b18 108 addEndpoint(EPBULK_OUT, MAX_PACKET_SIZE_EPBULK);
H_Tsunemoto 0:871ab6846b18 109
H_Tsunemoto 0:871ab6846b18 110 // We activate the endpoint to be able to recceive data
H_Tsunemoto 0:871ab6846b18 111 readStart(EPBULK_OUT, MAX_PACKET_SIZE_EPBULK);
H_Tsunemoto 0:871ab6846b18 112 return true;
H_Tsunemoto 0:871ab6846b18 113 }
H_Tsunemoto 0:871ab6846b18 114
H_Tsunemoto 0:871ab6846b18 115 bool USBCDC::send(uint8_t * buffer, uint32_t size) {
H_Tsunemoto 0:871ab6846b18 116 return USBDevice::write(EPBULK_IN, buffer, size, MAX_CDC_REPORT_SIZE);
H_Tsunemoto 0:871ab6846b18 117 }
H_Tsunemoto 0:871ab6846b18 118
H_Tsunemoto 0:871ab6846b18 119 bool USBCDC::readEP(uint8_t * buffer, uint32_t * size) {
H_Tsunemoto 0:871ab6846b18 120 if (!USBDevice::readEP(EPBULK_OUT, buffer, size, MAX_CDC_REPORT_SIZE))
H_Tsunemoto 0:871ab6846b18 121 return false;
H_Tsunemoto 0:871ab6846b18 122 if (!readStart(EPBULK_OUT, MAX_CDC_REPORT_SIZE))
H_Tsunemoto 0:871ab6846b18 123 return false;
H_Tsunemoto 0:871ab6846b18 124 return true;
H_Tsunemoto 0:871ab6846b18 125 }
H_Tsunemoto 0:871ab6846b18 126
H_Tsunemoto 0:871ab6846b18 127 bool USBCDC::readEP_NB(uint8_t * buffer, uint32_t * size) {
H_Tsunemoto 0:871ab6846b18 128 if (!USBDevice::readEP_NB(EPBULK_OUT, buffer, size, MAX_CDC_REPORT_SIZE))
H_Tsunemoto 0:871ab6846b18 129 return false;
H_Tsunemoto 0:871ab6846b18 130 if (!readStart(EPBULK_OUT, MAX_CDC_REPORT_SIZE))
H_Tsunemoto 0:871ab6846b18 131 return false;
H_Tsunemoto 0:871ab6846b18 132 return true;
H_Tsunemoto 0:871ab6846b18 133 }
H_Tsunemoto 0:871ab6846b18 134
H_Tsunemoto 0:871ab6846b18 135
H_Tsunemoto 0:871ab6846b18 136 uint8_t * USBCDC::deviceDesc() {
H_Tsunemoto 0:871ab6846b18 137 static uint8_t deviceDescriptor[] = {
H_Tsunemoto 0:871ab6846b18 138 18, // bLength
H_Tsunemoto 0:871ab6846b18 139 1, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 140 0x10, 0x01, // bcdUSB
H_Tsunemoto 0:871ab6846b18 141 2, // bDeviceClass
H_Tsunemoto 0:871ab6846b18 142 0, // bDeviceSubClass
H_Tsunemoto 0:871ab6846b18 143 0, // bDeviceProtocol
H_Tsunemoto 0:871ab6846b18 144 MAX_PACKET_SIZE_EP0, // bMaxPacketSize0
H_Tsunemoto 0:871ab6846b18 145 (uint8_t)(LSB(VENDOR_ID)), (uint8_t)(MSB(VENDOR_ID)), // idVendor
H_Tsunemoto 0:871ab6846b18 146 (uint8_t)(LSB(PRODUCT_ID)), (uint8_t)(MSB(PRODUCT_ID)),// idProduct
H_Tsunemoto 0:871ab6846b18 147 0x00, 0x01, // bcdDevice
H_Tsunemoto 0:871ab6846b18 148 1, // iManufacturer
H_Tsunemoto 0:871ab6846b18 149 2, // iProduct
H_Tsunemoto 0:871ab6846b18 150 3, // iSerialNumber
H_Tsunemoto 0:871ab6846b18 151 1 // bNumConfigurations
H_Tsunemoto 0:871ab6846b18 152 };
H_Tsunemoto 0:871ab6846b18 153 return deviceDescriptor;
H_Tsunemoto 0:871ab6846b18 154 }
H_Tsunemoto 0:871ab6846b18 155
H_Tsunemoto 0:871ab6846b18 156 uint8_t * USBCDC::stringIinterfaceDesc() {
H_Tsunemoto 0:871ab6846b18 157 static uint8_t stringIinterfaceDescriptor[] = {
H_Tsunemoto 0:871ab6846b18 158 0x08,
H_Tsunemoto 0:871ab6846b18 159 STRING_DESCRIPTOR,
H_Tsunemoto 0:871ab6846b18 160 'C',0,'D',0,'C',0,
H_Tsunemoto 0:871ab6846b18 161 };
H_Tsunemoto 0:871ab6846b18 162 return stringIinterfaceDescriptor;
H_Tsunemoto 0:871ab6846b18 163 }
H_Tsunemoto 0:871ab6846b18 164
H_Tsunemoto 0:871ab6846b18 165 uint8_t * USBCDC::stringIproductDesc() {
H_Tsunemoto 0:871ab6846b18 166 static uint8_t stringIproductDescriptor[] = {
H_Tsunemoto 0:871ab6846b18 167 0x16,
H_Tsunemoto 0:871ab6846b18 168 STRING_DESCRIPTOR,
H_Tsunemoto 0:871ab6846b18 169 'C',0,'D',0,'C',0,' ',0,'D',0,'E',0,'V',0,'I',0,'C',0,'E',0
H_Tsunemoto 0:871ab6846b18 170 };
H_Tsunemoto 0:871ab6846b18 171 return stringIproductDescriptor;
H_Tsunemoto 0:871ab6846b18 172 }
H_Tsunemoto 0:871ab6846b18 173
H_Tsunemoto 0:871ab6846b18 174
H_Tsunemoto 0:871ab6846b18 175 #define CONFIG1_DESC_SIZE (9+8+9+5+5+4+5+7+9+7+7)
H_Tsunemoto 0:871ab6846b18 176
H_Tsunemoto 0:871ab6846b18 177 uint8_t * USBCDC::configurationDesc() {
H_Tsunemoto 0:871ab6846b18 178 static uint8_t configDescriptor[] = {
H_Tsunemoto 0:871ab6846b18 179 // configuration descriptor
H_Tsunemoto 0:871ab6846b18 180 9, // bLength
H_Tsunemoto 0:871ab6846b18 181 2, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 182 LSB(CONFIG1_DESC_SIZE), // wTotalLength
H_Tsunemoto 0:871ab6846b18 183 MSB(CONFIG1_DESC_SIZE),
H_Tsunemoto 0:871ab6846b18 184 2, // bNumInterfaces
H_Tsunemoto 0:871ab6846b18 185 1, // bConfigurationValue
H_Tsunemoto 0:871ab6846b18 186 0, // iConfiguration
H_Tsunemoto 0:871ab6846b18 187 0x80, // bmAttributes
H_Tsunemoto 0:871ab6846b18 188 50, // bMaxPower
H_Tsunemoto 0:871ab6846b18 189
H_Tsunemoto 0:871ab6846b18 190 // IAD to associate the two CDC interfaces
H_Tsunemoto 0:871ab6846b18 191 0x08, // bLength
H_Tsunemoto 0:871ab6846b18 192 0x0b, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 193 0x00, // bFirstInterface
H_Tsunemoto 0:871ab6846b18 194 0x02, // bInterfaceCount
H_Tsunemoto 0:871ab6846b18 195 0x02, // bFunctionClass
H_Tsunemoto 0:871ab6846b18 196 0x02, // bFunctionSubClass
H_Tsunemoto 0:871ab6846b18 197 0, // bFunctionProtocol
H_Tsunemoto 0:871ab6846b18 198 0, // iFunction
H_Tsunemoto 0:871ab6846b18 199
H_Tsunemoto 0:871ab6846b18 200 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
H_Tsunemoto 0:871ab6846b18 201 9, // bLength
H_Tsunemoto 0:871ab6846b18 202 4, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 203 0, // bInterfaceNumber
H_Tsunemoto 0:871ab6846b18 204 0, // bAlternateSetting
H_Tsunemoto 0:871ab6846b18 205 1, // bNumEndpoints
H_Tsunemoto 0:871ab6846b18 206 0x02, // bInterfaceClass
H_Tsunemoto 0:871ab6846b18 207 0x02, // bInterfaceSubClass
H_Tsunemoto 0:871ab6846b18 208 0x01, // bInterfaceProtocol
H_Tsunemoto 0:871ab6846b18 209 0, // iInterface
H_Tsunemoto 0:871ab6846b18 210
H_Tsunemoto 0:871ab6846b18 211 // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
H_Tsunemoto 0:871ab6846b18 212 5, // bFunctionLength
H_Tsunemoto 0:871ab6846b18 213 0x24, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 214 0x00, // bDescriptorSubtype
H_Tsunemoto 0:871ab6846b18 215 0x10, 0x01, // bcdCDC
H_Tsunemoto 0:871ab6846b18 216
H_Tsunemoto 0:871ab6846b18 217 // Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
H_Tsunemoto 0:871ab6846b18 218 5, // bFunctionLength
H_Tsunemoto 0:871ab6846b18 219 0x24, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 220 0x01, // bDescriptorSubtype
H_Tsunemoto 0:871ab6846b18 221 0x03, // bmCapabilities
H_Tsunemoto 0:871ab6846b18 222 1, // bDataInterface
H_Tsunemoto 0:871ab6846b18 223
H_Tsunemoto 0:871ab6846b18 224 // Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
H_Tsunemoto 0:871ab6846b18 225 4, // bFunctionLength
H_Tsunemoto 0:871ab6846b18 226 0x24, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 227 0x02, // bDescriptorSubtype
H_Tsunemoto 0:871ab6846b18 228 0x06, // bmCapabilities
H_Tsunemoto 0:871ab6846b18 229
H_Tsunemoto 0:871ab6846b18 230 // Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
H_Tsunemoto 0:871ab6846b18 231 5, // bFunctionLength
H_Tsunemoto 0:871ab6846b18 232 0x24, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 233 0x06, // bDescriptorSubtype
H_Tsunemoto 0:871ab6846b18 234 0, // bMasterInterface
H_Tsunemoto 0:871ab6846b18 235 1, // bSlaveInterface0
H_Tsunemoto 0:871ab6846b18 236
H_Tsunemoto 0:871ab6846b18 237 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
H_Tsunemoto 0:871ab6846b18 238 ENDPOINT_DESCRIPTOR_LENGTH, // bLength
H_Tsunemoto 0:871ab6846b18 239 ENDPOINT_DESCRIPTOR, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 240 PHY_TO_DESC(EPINT_IN), // bEndpointAddress
H_Tsunemoto 0:871ab6846b18 241 E_INTERRUPT, // bmAttributes (0x03=intr)
H_Tsunemoto 0:871ab6846b18 242 LSB(MAX_PACKET_SIZE_EPINT), // wMaxPacketSize (LSB)
H_Tsunemoto 0:871ab6846b18 243 MSB(MAX_PACKET_SIZE_EPINT), // wMaxPacketSize (MSB)
H_Tsunemoto 0:871ab6846b18 244 16, // bInterval
H_Tsunemoto 0:871ab6846b18 245
H_Tsunemoto 0:871ab6846b18 246
H_Tsunemoto 0:871ab6846b18 247
H_Tsunemoto 0:871ab6846b18 248
H_Tsunemoto 0:871ab6846b18 249 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
H_Tsunemoto 0:871ab6846b18 250 9, // bLength
H_Tsunemoto 0:871ab6846b18 251 4, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 252 1, // bInterfaceNumber
H_Tsunemoto 0:871ab6846b18 253 0, // bAlternateSetting
H_Tsunemoto 0:871ab6846b18 254 2, // bNumEndpoints
H_Tsunemoto 0:871ab6846b18 255 0x0A, // bInterfaceClass
H_Tsunemoto 0:871ab6846b18 256 0x00, // bInterfaceSubClass
H_Tsunemoto 0:871ab6846b18 257 0x00, // bInterfaceProtocol
H_Tsunemoto 0:871ab6846b18 258 0, // iInterface
H_Tsunemoto 0:871ab6846b18 259
H_Tsunemoto 0:871ab6846b18 260 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
H_Tsunemoto 0:871ab6846b18 261 ENDPOINT_DESCRIPTOR_LENGTH, // bLength
H_Tsunemoto 0:871ab6846b18 262 ENDPOINT_DESCRIPTOR, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 263 PHY_TO_DESC(EPBULK_IN), // bEndpointAddress
H_Tsunemoto 0:871ab6846b18 264 E_BULK, // bmAttributes (0x02=bulk)
H_Tsunemoto 0:871ab6846b18 265 LSB(MAX_PACKET_SIZE_EPBULK),// wMaxPacketSize (LSB)
H_Tsunemoto 0:871ab6846b18 266 MSB(MAX_PACKET_SIZE_EPBULK),// wMaxPacketSize (MSB)
H_Tsunemoto 0:871ab6846b18 267 0, // bInterval
H_Tsunemoto 0:871ab6846b18 268
H_Tsunemoto 0:871ab6846b18 269 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
H_Tsunemoto 0:871ab6846b18 270 ENDPOINT_DESCRIPTOR_LENGTH, // bLength
H_Tsunemoto 0:871ab6846b18 271 ENDPOINT_DESCRIPTOR, // bDescriptorType
H_Tsunemoto 0:871ab6846b18 272 PHY_TO_DESC(EPBULK_OUT), // bEndpointAddress
H_Tsunemoto 0:871ab6846b18 273 E_BULK, // bmAttributes (0x02=bulk)
H_Tsunemoto 0:871ab6846b18 274 LSB(MAX_PACKET_SIZE_EPBULK),// wMaxPacketSize (LSB)
H_Tsunemoto 0:871ab6846b18 275 MSB(MAX_PACKET_SIZE_EPBULK),// wMaxPacketSize (MSB)
H_Tsunemoto 0:871ab6846b18 276 0 // bInterval
H_Tsunemoto 0:871ab6846b18 277 };
H_Tsunemoto 0:871ab6846b18 278 return configDescriptor;
H_Tsunemoto 0:871ab6846b18 279 }