Teensy 4.0 USB Host Custom Class

martinchatgpt

New member
Hi ,
I want to communicate with USB device with Vendor Class by Teensy 4.0 , This device have 5 Endpoint include 4 Bulk and one Interrupt.
the description of the device is here. what is approach?

Device Descriptors:

Connection Status Device connected
Current Configuration 1
Speed High
Device Address 12
Number Of Open Pipes 5

Device Descriptor DTV Modulator
Offset Field Size Value Description
0 bLength 1 12h
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h
6 bDeviceProtocol 1 00h
7 bMaxPacketSize0 1 40h 64 bytes
8 idVendor 2 048Dh Integrated Technology.
10 idProduct 2 95XXh
12 bcdDevice 2 0100h 1.00
14 iManufacturer 1 01h "IXX Tech., Inc."
15 iProduct 1 02h "DX Modulator"
16 iSerialNumber 1 03h "AF0102020700001"
17 bNumConfigurations 1 01h

Device Qualifier Descriptor
Offset Field Size Value Description
0 bLength 1 0Ah
1 bDescriptorType 1 06h Device Qualifier
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h
6 bDeviceProtocol 1 00h
7 bMaxPacketSize0 1 40h 64 bytes
8 bNumConfigurations 1 01h
9 bReserved 1 00h

Configuration Descriptor 1 Bus Powered, 500 mA
Offset Field Size Value Description
0 bLength 1 09h
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0035h
4 bNumInterfaces 1 01h
5 bConfigurationValue 1 01h
6 iConfiguration 1 00h
7 bmAttributes 1 80h Bus Powered
4..0: Reserved ...00000
5: Remote Wakeup ..0..... No
6: Self Powered .0...... No, Bus Powered
7: Reserved (set to one)
(bus-powered for 1.0) 1.......
8 bMaxPower 1 FAh 500 mA

Interface Descriptor 0/0 Vendor-Specific, 5 Endpoints
Offset Field Size Value Description
0 bLength 1 09h
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h
3 bAlternateSetting 1 00h
4 bNumEndpoints 1 05h
5 bInterfaceClass 1 FFh Vendor-Specific
6 bInterfaceSubClass 1 00h
7 bInterfaceProtocol 1 00h
8 iInterface 1 00h

Endpoint Descriptor 81 1 In, Bulk, 512 bytes
Offset Field Size Value Description
0 bLength 1 07h
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 02h Bulk
1..0: Transfer Type ......10 Bulk
7..2: Reserved 000000..
4 wMaxPacketSize 2 0200h 512 bytes
6 bInterval 1 00h

Endpoint Descriptor 02 2 Out, Bulk, 512 bytes
Offset Field Size Value Description
0 bLength 1 07h
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 02h 2 Out
3 bmAttributes 1 02h Bulk
1..0: Transfer Type ......10 Bulk
7..2: Reserved 000000..
4 wMaxPacketSize 2 0200h 512 bytes
6 bInterval 1 00h

Endpoint Descriptor 84 4 In, Interrupt
Offset Field Size Value Description
0 bLength 1 07h
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 84h 4 In
3 bmAttributes 1 03h Interrupt
1..0: Transfer Type ......11 Interrupt
7..2: Reserved 000000..
4 wMaxPacketSize 2 0100h 256 bytes
6 bInterval 1 00h

Endpoint Descriptor 85 5 In, Bulk, 512 bytes
Offset Field Size Value Description
0 bLength 1 07h
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 85h 5 In
3 bmAttributes 1 02h Bulk
1..0: Transfer Type ......10 Bulk
7..2: Reserved 000000..
4 wMaxPacketSize 2 0200h 512 bytes
6 bInterval 1 00h

Endpoint Descriptor 06 6 Out, Bulk, 512 bytes
Offset Field Size Value Description
0 bLength 1 07h
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 06h 6 Out
3 bmAttributes 1 02h Bulk
1..0: Transfer Type ......10 Bulk
7..2: Reserved 000000..
4 wMaxPacketSize 2 0200h 512 bytes
6 bInterval 1 00h
 
Sorry, probably not much help.

Since the Interface is Vendor specific, it makes it more of a challenge.

But what I would typically try to do is to somehow capture the USB traffic going into and out of this device and then try to decipherer it and then mimic some of the startup stuff to see If I could figure out what its protocol is.

I would also try to find any else has done so and/or there is source code to some driver for this device. For example, look for a linux driver, and then study the code to figure out what it is doing.

good luck
 
Thanks.
I have API for communicate with this device, I Have its protocol and all other things, just want to port this API to teensy 4.0. this API work on linux by libusb1.0 and all things are ok, but I want to implement it to teensy 4.0. is there any example for use "bulk_transfer" function like "libusb_bulk_transfer" in libusb?
 
Thanks.
I have API for communicate with this device, I Have its protocol and all other things, just want to port this API to teensy 4.0. this API work on linux by libusb1.0 and all things are ok, but I want to implement it to teensy 4.0. is there any example for use "bulk_transfer" function like "libusb_bulk_transfer" in libusb?

I did something similar for a SourceAudio BASS Synth pedal here: https://github.com/MichaelMCE/TeensyC4Synth
For reference. the PC desktop variant is here: https://github.com/MichaelMCE/Sa-C4
 
Back
Top