|
87 | 87 | #endif
|
88 | 88 | #endif
|
89 | 89 |
|
| 90 | +#if (BULK_ENDPOINT) |
| 91 | +/* SAM3UC only has 7 endpoints, and as a consequence BULK_ENDPOINT cannot |
| 92 | + * be enabled at the same time as CDC_ENDPOINT and MSC_ENDPOINT. |
| 93 | + */ |
| 94 | +#if (CDC_ENDPOINT && MSC_ENDPOINT) |
| 95 | +#error "SAM3U2C does not have enough endpoints to support this configuration" |
| 96 | +#endif |
| 97 | +#if (CDC_ENDPOINT) |
| 98 | +#define USBD_HID_EP_INTOUT 0 |
| 99 | +#define USBD_BULK_EP_BULKIN 1 |
| 100 | +#define USBD_BULK_EP_BULKOUT 2 |
| 101 | +#define USBD_HID_EP_INTIN 3 |
| 102 | +#define USBD_CDC_ACM_EP_INTIN 4 |
| 103 | +#define USBD_CDC_ACM_EP_BULKOUT 5 |
| 104 | +#define USBD_CDC_ACM_EP_BULKIN 6 |
| 105 | +#define USBD_MSC_EP_BULKIN 7 /* Unused */ |
| 106 | +#define USBD_MSC_EP_BULKOUT 7 /* Unused */ |
| 107 | +#else // !(CDC_ENDPOINT) |
| 108 | +#define USBD_MSC_EP_BULKIN 1 |
| 109 | +#define USBD_MSC_EP_BULKOUT 2 |
| 110 | +#define USBD_HID_EP_INTIN 3 |
| 111 | +#define USBD_HID_EP_INTOUT 4 |
| 112 | +#define USBD_BULK_EP_BULKOUT 5 |
| 113 | +#define USBD_BULK_EP_BULKIN 6 |
| 114 | +#define USBD_CDC_ACM_EP_INTIN 7 /* Unused */ |
| 115 | +#define USBD_CDC_ACM_EP_BULKIN 7 /* Unused */ |
| 116 | +#define USBD_CDC_ACM_EP_BULKOUT 7 /* Unused */ |
| 117 | +#endif |
| 118 | +#else // !(BULK_ENDPOINT) |
| 119 | +#define USBD_HID_EP_INTOUT 0 |
| 120 | +#define USBD_MSC_EP_BULKIN 1 |
| 121 | +#define USBD_MSC_EP_BULKOUT 2 |
| 122 | +#define USBD_HID_EP_INTIN 3 |
| 123 | +#define USBD_CDC_ACM_EP_INTIN 4 |
| 124 | +#define USBD_CDC_ACM_EP_BULKOUT 5 |
| 125 | +#define USBD_CDC_ACM_EP_BULKIN 6 |
| 126 | +#define USBD_BULK_EP_BULKIN 7 /* Unused */ |
| 127 | +#define USBD_BULK_EP_BULKOUT 7 /* Unused */ |
| 128 | +#endif |
| 129 | + |
90 | 130 | // <e> USB Device
|
91 | 131 | // <i> Enable the USB Device functionality
|
92 | 132 | #define USBD_ENABLE 1
|
|
209 | 249 | // </e>
|
210 | 250 |
|
211 | 251 | #define USBD_HID_ENABLE HID_ENDPOINT
|
212 |
| -#define USBD_HID_EP_INTIN 3 |
213 | 252 | #define USBD_HID_EP_INTIN_STACK 0
|
214 |
| -#define USBD_HID_EP_INTOUT 0 |
215 | 253 | #define USBD_HID_EP_INTOUT_STACK 0
|
216 | 254 | #define USBD_HID_WMAXPACKETSIZE 64
|
217 | 255 | #define USBD_HID_BINTERVAL 1
|
|
258 | 296 | // </e>
|
259 | 297 |
|
260 | 298 | #define USBD_MSC_ENABLE MSC_ENDPOINT
|
261 |
| -#define USBD_MSC_EP_BULKIN 1 |
262 | 299 | #define USBD_MSC_EP_BULKIN_STACK 0
|
263 |
| -#define USBD_MSC_EP_BULKOUT 2 |
264 | 300 | #define USBD_MSC_EP_BULKOUT_STACK 0
|
265 | 301 | #define USBD_MSC_WMAXPACKETSIZE 64
|
266 | 302 | #define USBD_MSC_HS_ENABLE 1
|
|
374 | 410 | // </e>
|
375 | 411 |
|
376 | 412 | #define USBD_CDC_ACM_ENABLE CDC_ENDPOINT
|
377 |
| -#define USBD_CDC_ACM_EP_INTIN 4 |
378 | 413 | #define USBD_CDC_ACM_EP_INTIN_STACK 0
|
379 | 414 | #define USBD_CDC_ACM_WMAXPACKETSIZE 16
|
380 | 415 | #define USBD_CDC_ACM_BINTERVAL 32
|
381 | 416 | #define USBD_CDC_ACM_HS_ENABLE 1
|
382 | 417 | #define USBD_CDC_ACM_HS_WMAXPACKETSIZE 64
|
383 | 418 | #define USBD_CDC_ACM_HS_BINTERVAL 2
|
384 |
| -#define USBD_CDC_ACM_EP_BULKIN 6 |
385 | 419 | #define USBD_CDC_ACM_EP_BULKIN_STACK 0
|
386 |
| -#define USBD_CDC_ACM_EP_BULKOUT 5 |
387 | 420 | #define USBD_CDC_ACM_EP_BULKOUT_STACK 0
|
388 | 421 | #define USBD_CDC_ACM_WMAXPACKETSIZE1 64
|
389 | 422 | #define USBD_CDC_ACM_HS_ENABLE1 1
|
|
431 | 464 | // </e>
|
432 | 465 |
|
433 | 466 | #define USBD_BULK_ENABLE BULK_ENDPOINT
|
434 |
| -// We don't have enough endpoints for BULK unless MSC or CDC are disabled. |
435 |
| -// MSC is the best choice, since this is only useful in the fixed target IF config and we can still upload firmware via DAP. |
436 |
| -// We'll still want MSC for the BL though, but in that case BULK isn't useful anyway. |
437 |
| -#if USBD_MSC_ENABLE == 0 |
438 |
| -#define USBD_BULK_EP_BULKIN 1 // Use the MSC endpoints for BULK |
439 |
| -#define USBD_BULK_EP_BULKOUT 2 |
440 |
| -#elif USBD_CDC_ACM_ENABLE == 0 |
441 |
| -#define USBD_BULK_EP_BULKIN 5 // Use the CDC endpoints for BULK |
442 |
| -#define USBD_BULK_EP_BULKOUT 6 |
443 |
| -#else |
444 |
| -#define USBD_BULK_EP_BULKIN 7 // Use non-existent endpoints to force an error |
445 |
| -#define USBD_BULK_EP_BULKOUT 8 // if BULK is enabled but MSC + CDC are still enabled |
446 |
| -#endif |
447 |
| - |
448 | 467 | #define USBD_BULK_WMAXPACKETSIZE 64
|
449 | 468 | #define USBD_BULK_HS_ENABLE 1
|
450 | 469 | #define USBD_BULK_HS_WMAXPACKETSIZE 512
|
|
0 commit comments