spresense: Fix USB CDC and MSC
This commit is contained in:
parent
c2ebe555f3
commit
da248d1594
@ -37,7 +37,7 @@
|
|||||||
// so define these before #include'ing that file.
|
// so define these before #include'ing that file.
|
||||||
#define USB_CDC_EP_NUM_NOTIFICATION (3)
|
#define USB_CDC_EP_NUM_NOTIFICATION (3)
|
||||||
#define USB_CDC_EP_NUM_DATA_OUT (2)
|
#define USB_CDC_EP_NUM_DATA_OUT (2)
|
||||||
#define USB_CDC_EP_NUM_DATA_IN (2)
|
#define USB_CDC_EP_NUM_DATA_IN (1)
|
||||||
#define USB_MSC_EP_NUM_OUT (5)
|
#define USB_MSC_EP_NUM_OUT (5)
|
||||||
#define USB_MSC_EP_NUM_IN (4)
|
#define USB_MSC_EP_NUM_IN (4)
|
||||||
|
|
||||||
|
@ -63,7 +63,11 @@ static const uint8_t usb_msc_descriptor_template[] = {
|
|||||||
0xFF, // 11 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
|
0xFF, // 11 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
|
||||||
#define MSC_IN_ENDPOINT_INDEX (11)
|
#define MSC_IN_ENDPOINT_INDEX (11)
|
||||||
0x02, // 12 bmAttributes (Bulk)
|
0x02, // 12 bmAttributes (Bulk)
|
||||||
|
#if USB_HIGHSPEED
|
||||||
|
0x00, 0x02, // 13,14 wMaxPacketSize 512
|
||||||
|
#else
|
||||||
0x40, 0x00, // 13,14 wMaxPacketSize 64
|
0x40, 0x00, // 13,14 wMaxPacketSize 64
|
||||||
|
#endif
|
||||||
0x00, // 15 bInterval 0 (unit depends on device speed)
|
0x00, // 15 bInterval 0 (unit depends on device speed)
|
||||||
|
|
||||||
// MSC Endpoint OUT Descriptor
|
// MSC Endpoint OUT Descriptor
|
||||||
@ -72,7 +76,11 @@ static const uint8_t usb_msc_descriptor_template[] = {
|
|||||||
0xFF, // 18 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
|
0xFF, // 18 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
|
||||||
#define MSC_OUT_ENDPOINT_INDEX (18)
|
#define MSC_OUT_ENDPOINT_INDEX (18)
|
||||||
0x02, // 19 bmAttributes (Bulk)
|
0x02, // 19 bmAttributes (Bulk)
|
||||||
|
#if USB_HIGHSPEED
|
||||||
|
0x00, 0x02, // 20,21 wMaxPacketSize 512
|
||||||
|
#else
|
||||||
0x40, 0x00, // 20,21 wMaxPacketSize 64
|
0x40, 0x00, // 20,21 wMaxPacketSize 64
|
||||||
|
#endif
|
||||||
0x00, // 22 bInterval 0 (unit depends on device speed)
|
0x00, // 22 bInterval 0 (unit depends on device speed)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,7 +121,11 @@ static const uint8_t usb_cdc_descriptor_template[] = {
|
|||||||
0xFF, // 54 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
|
0xFF, // 54 bEndpointAddress (OUT/H2D) [SET AT RUNTIME]
|
||||||
#define CDC_DATA_OUT_ENDPOINT_INDEX 54
|
#define CDC_DATA_OUT_ENDPOINT_INDEX 54
|
||||||
0x02, // 55 bmAttributes (Bulk)
|
0x02, // 55 bmAttributes (Bulk)
|
||||||
|
#if USB_HIGHSPEED
|
||||||
|
0x00, 0x02, // 56,57 wMaxPacketSize 512
|
||||||
|
#else
|
||||||
0x40, 0x00, // 56,57 wMaxPacketSize 64
|
0x40, 0x00, // 56,57 wMaxPacketSize 64
|
||||||
|
#endif
|
||||||
0x00, // 58 bInterval 0 (unit depends on device speed)
|
0x00, // 58 bInterval 0 (unit depends on device speed)
|
||||||
|
|
||||||
// CDC Data IN Endpoint Descriptor
|
// CDC Data IN Endpoint Descriptor
|
||||||
@ -130,7 +134,11 @@ static const uint8_t usb_cdc_descriptor_template[] = {
|
|||||||
0xFF, // 61 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
|
0xFF, // 61 bEndpointAddress (IN/D2H) [SET AT RUNTIME: 0x80 | number]
|
||||||
#define CDC_DATA_IN_ENDPOINT_INDEX 61
|
#define CDC_DATA_IN_ENDPOINT_INDEX 61
|
||||||
0x02, // 62 bmAttributes (Bulk)
|
0x02, // 62 bmAttributes (Bulk)
|
||||||
|
#if USB_HIGHSPEED
|
||||||
|
0x00, 0x02, // 63,64 wMaxPacketSize 512
|
||||||
|
#else
|
||||||
0x40, 0x00, // 63,64 wMaxPacketSize 64
|
0x40, 0x00, // 63,64 wMaxPacketSize 64
|
||||||
|
#endif
|
||||||
0x00, // 65 bInterval 0 (unit depends on device speed)
|
0x00, // 65 bInterval 0 (unit depends on device speed)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user