29
29
#define IDX_TO_EP (idx ) (((idx) >> 1 )|((idx) & 1 ) << 7 )
30
30
31
31
/* endpoint defines */
32
- #define NUM_ENDPOINTS 4
32
+
33
+ #if (MBED_CONF_TARGET_USB_SPEED == USE_USB_OTG_HS)
34
+
35
+ #define NUM_ENDPOINTS 6
36
+ #define MAX_PACKET_SIZE_NON_ISO 512
37
+ #define MAX_PACKET_SIZE_ISO 1023
38
+
39
+ #else
40
+
41
+ #define NUM_ENDPOINTS 4
33
42
#define MAX_PACKET_SIZE_NON_ISO 64
34
43
#define MAX_PACKET_SIZE_ISO (256 + 128 ) // Spec can go up to 1023, only ram for this though
35
44
45
+ #endif
46
+
36
47
static const uint32_t tx_ep_sizes[NUM_ENDPOINTS] = {
37
48
MAX_PACKET_SIZE_NON_ISO,
38
49
MAX_PACKET_SIZE_NON_ISO,
39
50
MAX_PACKET_SIZE_NON_ISO,
51
+ #if (MBED_CONF_TARGET_USB_SPEED == USE_USB_OTG_HS)
52
+ MAX_PACKET_SIZE_NON_ISO,
53
+ MAX_PACKET_SIZE_NON_ISO,
54
+ #endif
40
55
MAX_PACKET_SIZE_ISO
41
56
};
42
57
@@ -333,8 +348,11 @@ void USBPhyHw::init(USBPhyEvents *events)
333
348
total_bytes += fifo_size;
334
349
}
335
350
351
+ #if (MBED_CONF_TARGET_USB_SPEED != USE_USB_OTG_HS)
336
352
/* 1.25 kbytes */
337
353
MBED_ASSERT (total_bytes <= 1280 );
354
+ #endif
355
+
338
356
#endif
339
357
340
358
// Configure interrupt vector
@@ -424,11 +442,18 @@ void USBPhyHw::remote_wakeup()
424
442
const usb_ep_table_t *USBPhyHw::endpoint_table ()
425
443
{
426
444
static const usb_ep_table_t table = {
445
+ #if (MBED_CONF_TARGET_USB_SPEED != USE_USB_OTG_HS)
427
446
1280 , // 1.25K for endpoint buffers but space is allocated up front
447
+ #else
448
+ 4096 ,
449
+ #endif
428
450
{
429
451
{USB_EP_ATTR_ALLOW_CTRL | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
430
452
{USB_EP_ATTR_ALLOW_BULK | USB_EP_ATTR_ALLOW_INT | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 }, // NON ISO
431
453
{USB_EP_ATTR_ALLOW_BULK | USB_EP_ATTR_ALLOW_INT | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 }, // NON ISO
454
+ #if (MBED_CONF_TARGET_USB_SPEED == USE_USB_OTG_HS)
455
+ {USB_EP_ATTR_ALLOW_ALL | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
456
+ #endif
432
457
{USB_EP_ATTR_ALLOW_ALL | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
433
458
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
434
459
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
@@ -441,7 +466,9 @@ const usb_ep_table_t *USBPhyHw::endpoint_table()
441
466
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
442
467
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
443
468
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 },
469
+ #if (MBED_CONF_TARGET_USB_SPEED != USE_USB_OTG_HS)
444
470
{0 | USB_EP_ATTR_DIR_IN_AND_OUT, 0 , 0 }
471
+ #endif
445
472
}
446
473
};
447
474
return &table;
0 commit comments