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