Browse Source

Update MTP descriptors for Teensy 4

teensy4-core
PaulStoffregen 4 years ago
parent
commit
9dff33654f
3 changed files with 18 additions and 14 deletions
  1. +1
    -0
      teensy3/usb_desc.h
  2. +6
    -6
      teensy4/usb_desc.c
  3. +11
    -8
      teensy4/usb_desc.h

+ 1
- 0
teensy3/usb_desc.h View File

@@ -734,6 +734,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
// TODO: Should ENDPOINT4_CONFIG be ENDPOINT_TRANSMIT_ONLY ???
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY

#elif defined(USB_AUDIO)

+ 6
- 6
teensy4/usb_desc.c View File

@@ -1307,14 +1307,14 @@ PROGMEM const uint8_t usb_config_descriptor_480[CONFIG_DESC_SIZE] = {
5, // bDescriptorType
MTP_TX_ENDPOINT | 0x80, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_TX_SIZE, 0, // wMaxPacketSize
LSB(MTP_TX_SIZE_480),MSB(MTP_TX_SIZE_480), // wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MTP_RX_ENDPOINT, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_RX_SIZE, 0, // wMaxPacketSize
LSB(MTP_RX_SIZE_480),MSB(MTP_RX_SIZE_480), // wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
@@ -1322,7 +1322,7 @@ PROGMEM const uint8_t usb_config_descriptor_480[CONFIG_DESC_SIZE] = {
MTP_EVENT_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
MTP_EVENT_SIZE, 0, // wMaxPacketSize
MTP_EVENT_INTERVAL, // bInterval
MTP_EVENT_INTERVAL_480, // bInterval
#endif // MTP_INTERFACE

#ifdef KEYMEDIA_INTERFACE
@@ -2293,14 +2293,14 @@ PROGMEM const uint8_t usb_config_descriptor_12[CONFIG_DESC_SIZE] = {
5, // bDescriptorType
MTP_TX_ENDPOINT | 0x80, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_TX_SIZE, 0, // wMaxPacketSize
LSB(MTP_TX_SIZE_12),MSB(MTP_TX_SIZE_12),// wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MTP_RX_ENDPOINT, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_RX_SIZE, 0, // wMaxPacketSize
LSB(MTP_RX_SIZE_12),MSB(MTP_RX_SIZE_12),// wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
@@ -2308,7 +2308,7 @@ PROGMEM const uint8_t usb_config_descriptor_12[CONFIG_DESC_SIZE] = {
MTP_EVENT_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
MTP_EVENT_SIZE, 0, // wMaxPacketSize
MTP_EVENT_INTERVAL, // bInterval
MTP_EVENT_INTERVAL_12, // bInterval
#endif // MTP_INTERFACE

#ifdef KEYMEDIA_INTERFACE

+ 11
- 8
teensy4/usb_desc.h View File

@@ -685,23 +685,26 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define NUM_INTERFACE 2
#define MTP_INTERFACE 0 // MTP Disk
#define MTP_TX_ENDPOINT 3
#define MTP_TX_SIZE 64
#define MTP_TX_SIZE_12 64
#define MTP_TX_SIZE_480 512
#define MTP_RX_ENDPOINT 3
#define MTP_RX_SIZE 64
#define MTP_RX_SIZE_12 64
#define MTP_RX_SIZE_480 512
#define MTP_EVENT_ENDPOINT 4
#define MTP_EVENT_SIZE 16
#define MTP_EVENT_INTERVAL 10
#define MTP_EVENT_INTERVAL_12 10 // 10 = 10 ms
#define MTP_EVENT_INTERVAL_480 7 // 7 = 8 ms
#define SEREMU_INTERFACE 1 // Serial emulation
#define SEREMU_TX_ENDPOINT 1
#define SEREMU_TX_ENDPOINT 2
#define SEREMU_TX_SIZE 64
#define SEREMU_TX_INTERVAL 1
#define SEREMU_RX_ENDPOINT 2
#define SEREMU_RX_SIZE 32
#define SEREMU_RX_INTERVAL 2
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
// TODO: Should ENDPOINT4_CONFIG be ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT ???
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_UNUSED

#elif defined(USB_AUDIO)
#define VENDOR_ID 0x16C0

Loading…
Cancel
Save