Skip to content

Commit 5224d13

Browse files
authored
Teensyduino 1.52 Compatibility (#17)
* Teensyduino 1.52 Compatibility * Update Travis software versions * Update Teensyduino version in README (1.52)
1 parent a0960b3 commit 5224d13

File tree

10 files changed

+588
-237
lines changed

10 files changed

+588
-237
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: C
22
env:
33
global:
44
- IDE_VERSION=1.8.12
5-
- TEENSY_VERSION=151
5+
- TEENSY_VERSION=152
66
- IDE_LOCATION=/usr/local/share/arduino
77
- BOARDS_DESTINATION=$IDE_LOCATION/hardware
88

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is meant to be used in conjunction with the [ArduinoXInput library](https:/
66

77
## Installation
88

9-
You must have both [Arduino](https://www.arduino.cc/en/main/software) and [Teensyduino](https://www.pjrc.com/teensy/td_download.html) installed before proceeding. Double-check that your installed Teensyduino version matches the files provided in this repository. This repository is currently using version [**1.51**](https://www.pjrc.com/teensy/td_151). If you don't know your Teensyduino version, compile a blank sketch with a Teensy board selected and the Teensy Loader will open. In the Teensy Loader window select `Help -> About` and it will tell you the version number. If your version does not match you will have to reinstall or update the Teensyduino software.
9+
You must have both [Arduino](https://www.arduino.cc/en/main/software) and [Teensyduino](https://www.pjrc.com/teensy/td_download.html) installed before proceeding. Double-check that your installed Teensyduino version matches the files provided in this repository. This repository is currently using version [**1.52**](https://www.pjrc.com/teensy/td_152). If you don't know your Teensyduino version, compile a blank sketch with a Teensy board selected and the Teensy Loader will open. In the Teensy Loader window select `Help -> About` and it will tell you the version number. If your version does not match you will have to reinstall or update the Teensyduino software.
1010

1111
Navigate to your Arduino installation directory and open up the 'hardware' folder. It is recommended that you make a backup of this folder before proceeding in case something goes wrong or if you want to revert the installation.
1212

teensy/avr/boards.txt

Lines changed: 233 additions & 209 deletions
Large diffs are not rendered by default.

teensy/avr/cores/teensy3/WProgram.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
#include "avr_emulation.h"
5454
#include "usb_serial.h"
55+
#include "usb_serial2.h"
56+
#include "usb_serial3.h"
5557
#include "usb_seremu.h"
5658
#include "usb_keyboard.h"
5759
#include "usb_mouse.h"

teensy/avr/cores/teensy3/usb_desc.c

Lines changed: 170 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ static uint8_t multitouch_report_desc[] = {
394394
0x95, 0x01, // Report Count (1)
395395
0x09, 0x56, // Usage (Scan Time)
396396
0x81, 0x02, // Input (variable,absolute)
397+
0x09, 0x54, // USAGE (Contact count)
398+
0x25, 0x7f, // LOGICAL_MAXIMUM (127)
399+
0x95, 0x01, // REPORT_COUNT (1)
400+
0x75, 0x08, // REPORT_SIZE (8)
401+
0x81, 0x02, // INPUT (Data,Var,Abs)
397402
0x05, 0x0D, // Usage Page (Digitizers)
398403
0x09, 0x55, // Usage (Contact Count Maximum)
399404
0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)
@@ -484,7 +489,21 @@ static uint8_t flightsim_report_desc[] = {
484489
#define CDC_DATA_INTERFACE_DESC_SIZE 0
485490
#endif
486491

487-
#define MIDI_INTERFACE_DESC_POS CDC_DATA_INTERFACE_DESC_POS+CDC_DATA_INTERFACE_DESC_SIZE
492+
#define CDC2_DATA_INTERFACE_DESC_POS CDC_DATA_INTERFACE_DESC_POS+CDC_DATA_INTERFACE_DESC_SIZE
493+
#ifdef CDC2_DATA_INTERFACE
494+
#define CDC2_DATA_INTERFACE_DESC_SIZE 8 + 9+5+5+4+5+7+9+7+7
495+
#else
496+
#define CDC2_DATA_INTERFACE_DESC_SIZE 0
497+
#endif
498+
499+
#define CDC3_DATA_INTERFACE_DESC_POS CDC2_DATA_INTERFACE_DESC_POS+CDC2_DATA_INTERFACE_DESC_SIZE
500+
#ifdef CDC3_DATA_INTERFACE
501+
#define CDC3_DATA_INTERFACE_DESC_SIZE 8 + 9+5+5+4+5+7+9+7+7
502+
#else
503+
#define CDC3_DATA_INTERFACE_DESC_SIZE 0
504+
#endif
505+
506+
#define MIDI_INTERFACE_DESC_POS CDC3_DATA_INTERFACE_DESC_POS+CDC3_DATA_INTERFACE_DESC_SIZE
488507
#ifdef MIDI_INTERFACE
489508
#if !defined(MIDI_NUM_CABLES) || MIDI_NUM_CABLES < 1 || MIDI_NUM_CABLES > 16
490509
#error "MIDI_NUM_CABLES must be defined between 1 to 16"
@@ -683,6 +702,156 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
683702
0, // bInterval
684703
#endif // CDC_DATA_INTERFACE
685704

705+
#ifdef CDC2_DATA_INTERFACE
706+
// interface association descriptor, USB ECN, Table 9-Z
707+
8, // bLength
708+
11, // bDescriptorType
709+
CDC2_STATUS_INTERFACE, // bFirstInterface
710+
2, // bInterfaceCount
711+
0x02, // bFunctionClass
712+
0x02, // bFunctionSubClass
713+
0x01, // bFunctionProtocol
714+
0, // iFunction
715+
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
716+
9, // bLength
717+
4, // bDescriptorType
718+
CDC2_STATUS_INTERFACE, // bInterfaceNumber
719+
0, // bAlternateSetting
720+
1, // bNumEndpoints
721+
0x02, // bInterfaceClass
722+
0x02, // bInterfaceSubClass
723+
0x01, // bInterfaceProtocol
724+
0, // iInterface
725+
// CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
726+
5, // bFunctionLength
727+
0x24, // bDescriptorType
728+
0x00, // bDescriptorSubtype
729+
0x10, 0x01, // bcdCDC
730+
// Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
731+
5, // bFunctionLength
732+
0x24, // bDescriptorType
733+
0x01, // bDescriptorSubtype
734+
0x01, // bmCapabilities
735+
1, // bDataInterface
736+
// Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
737+
4, // bFunctionLength
738+
0x24, // bDescriptorType
739+
0x02, // bDescriptorSubtype
740+
0x06, // bmCapabilities
741+
// Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
742+
5, // bFunctionLength
743+
0x24, // bDescriptorType
744+
0x06, // bDescriptorSubtype
745+
CDC2_STATUS_INTERFACE, // bMasterInterface
746+
CDC2_DATA_INTERFACE, // bSlaveInterface0
747+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
748+
7, // bLength
749+
5, // bDescriptorType
750+
CDC2_ACM_ENDPOINT | 0x80, // bEndpointAddress
751+
0x03, // bmAttributes (0x03=intr)
752+
CDC2_ACM_SIZE, 0, // wMaxPacketSize
753+
64, // bInterval
754+
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
755+
9, // bLength
756+
4, // bDescriptorType
757+
CDC2_DATA_INTERFACE, // bInterfaceNumber
758+
0, // bAlternateSetting
759+
2, // bNumEndpoints
760+
0x0A, // bInterfaceClass
761+
0x00, // bInterfaceSubClass
762+
0x00, // bInterfaceProtocol
763+
0, // iInterface
764+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
765+
7, // bLength
766+
5, // bDescriptorType
767+
CDC2_RX_ENDPOINT, // bEndpointAddress
768+
0x02, // bmAttributes (0x02=bulk)
769+
CDC2_RX_SIZE, 0, // wMaxPacketSize
770+
0, // bInterval
771+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
772+
7, // bLength
773+
5, // bDescriptorType
774+
CDC2_TX_ENDPOINT | 0x80, // bEndpointAddress
775+
0x02, // bmAttributes (0x02=bulk)
776+
CDC2_TX_SIZE, 0, // wMaxPacketSize
777+
0, // bInterval
778+
#endif // CDC2_DATA_INTERFACE
779+
780+
#ifdef CDC3_DATA_INTERFACE
781+
// interface association descriptor, USB ECN, Table 9-Z
782+
8, // bLength
783+
11, // bDescriptorType
784+
CDC3_STATUS_INTERFACE, // bFirstInterface
785+
2, // bInterfaceCount
786+
0x02, // bFunctionClass
787+
0x02, // bFunctionSubClass
788+
0x01, // bFunctionProtocol
789+
0, // iFunction
790+
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
791+
9, // bLength
792+
4, // bDescriptorType
793+
CDC3_STATUS_INTERFACE, // bInterfaceNumber
794+
0, // bAlternateSetting
795+
1, // bNumEndpoints
796+
0x02, // bInterfaceClass
797+
0x02, // bInterfaceSubClass
798+
0x01, // bInterfaceProtocol
799+
0, // iInterface
800+
// CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
801+
5, // bFunctionLength
802+
0x24, // bDescriptorType
803+
0x00, // bDescriptorSubtype
804+
0x10, 0x01, // bcdCDC
805+
// Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
806+
5, // bFunctionLength
807+
0x24, // bDescriptorType
808+
0x01, // bDescriptorSubtype
809+
0x01, // bmCapabilities
810+
1, // bDataInterface
811+
// Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
812+
4, // bFunctionLength
813+
0x24, // bDescriptorType
814+
0x02, // bDescriptorSubtype
815+
0x06, // bmCapabilities
816+
// Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
817+
5, // bFunctionLength
818+
0x24, // bDescriptorType
819+
0x06, // bDescriptorSubtype
820+
CDC3_STATUS_INTERFACE, // bMasterInterface
821+
CDC3_DATA_INTERFACE, // bSlaveInterface0
822+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
823+
7, // bLength
824+
5, // bDescriptorType
825+
CDC3_ACM_ENDPOINT | 0x80, // bEndpointAddress
826+
0x03, // bmAttributes (0x03=intr)
827+
CDC3_ACM_SIZE, 0, // wMaxPacketSize
828+
64, // bInterval
829+
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
830+
9, // bLength
831+
4, // bDescriptorType
832+
CDC3_DATA_INTERFACE, // bInterfaceNumber
833+
0, // bAlternateSetting
834+
2, // bNumEndpoints
835+
0x0A, // bInterfaceClass
836+
0x00, // bInterfaceSubClass
837+
0x00, // bInterfaceProtocol
838+
0, // iInterface
839+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
840+
7, // bLength
841+
5, // bDescriptorType
842+
CDC3_RX_ENDPOINT, // bEndpointAddress
843+
0x02, // bmAttributes (0x02=bulk)
844+
CDC3_RX_SIZE, 0, // wMaxPacketSize
845+
0, // bInterval
846+
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
847+
7, // bLength
848+
5, // bDescriptorType
849+
CDC3_TX_ENDPOINT | 0x80, // bEndpointAddress
850+
0x02, // bmAttributes (0x02=bulk)
851+
CDC3_TX_SIZE, 0, // wMaxPacketSize
852+
0, // bInterval
853+
#endif // CDC3_DATA_INTERFACE
854+
686855
#ifdef MIDI_INTERFACE
687856
// Standard MS Interface Descriptor,
688857
9, // bLength

teensy/avr/cores/teensy3/usb_desc.h

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,87 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
140140
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
141141
#define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
142142

143+
#elif defined(USB_DUAL_SERIAL)
144+
#define VENDOR_ID 0x16C0
145+
#define PRODUCT_ID 0x048B
146+
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
147+
#define MANUFACTURER_NAME_LEN 11
148+
#define PRODUCT_NAME {'D','u','a','l',' ','S','e','r','i','a','l'}
149+
#define PRODUCT_NAME_LEN 11
150+
#define EP0_SIZE 64
151+
#define NUM_ENDPOINTS 7
152+
#define NUM_USB_BUFFERS 22
153+
#define NUM_INTERFACE 4
154+
#define CDC_IAD_DESCRIPTOR 1 // Serial
155+
#define CDC_STATUS_INTERFACE 0
156+
#define CDC_DATA_INTERFACE 1
157+
#define CDC_ACM_ENDPOINT 2
158+
#define CDC_RX_ENDPOINT 3
159+
#define CDC_TX_ENDPOINT 4
160+
#define CDC_ACM_SIZE 16
161+
#define CDC_RX_SIZE 64
162+
#define CDC_TX_SIZE 64
163+
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1
164+
#define CDC2_DATA_INTERFACE 3
165+
#define CDC2_ACM_ENDPOINT 5
166+
#define CDC2_RX_ENDPOINT 6
167+
#define CDC2_TX_ENDPOINT 7
168+
#define CDC2_ACM_SIZE 16
169+
#define CDC2_RX_SIZE 64
170+
#define CDC2_TX_SIZE 64
171+
#define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
172+
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
173+
#define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
174+
#define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
175+
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ONLY
176+
#define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
177+
178+
#elif defined(USB_TRIPLE_SERIAL)
179+
#define VENDOR_ID 0x16C0
180+
#define PRODUCT_ID 0x048C
181+
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
182+
#define MANUFACTURER_NAME_LEN 11
183+
#define PRODUCT_NAME {'T','r','i','p','l','e',' ','S','e','r','i','a','l'}
184+
#define PRODUCT_NAME_LEN 13
185+
#define EP0_SIZE 64
186+
#define NUM_ENDPOINTS 10
187+
#define NUM_USB_BUFFERS 32
188+
#define NUM_INTERFACE 6
189+
#define CDC_IAD_DESCRIPTOR 1 // Serial
190+
#define CDC_STATUS_INTERFACE 0
191+
#define CDC_DATA_INTERFACE 1
192+
#define CDC_ACM_ENDPOINT 2
193+
#define CDC_RX_ENDPOINT 3
194+
#define CDC_TX_ENDPOINT 4
195+
#define CDC_ACM_SIZE 16
196+
#define CDC_RX_SIZE 64
197+
#define CDC_TX_SIZE 64
198+
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1
199+
#define CDC2_DATA_INTERFACE 3
200+
#define CDC2_ACM_ENDPOINT 5
201+
#define CDC2_RX_ENDPOINT 6
202+
#define CDC2_TX_ENDPOINT 7
203+
#define CDC2_ACM_SIZE 16
204+
#define CDC2_RX_SIZE 64
205+
#define CDC2_TX_SIZE 64
206+
#define CDC3_STATUS_INTERFACE 4 // SerialUSB2
207+
#define CDC3_DATA_INTERFACE 5
208+
#define CDC3_ACM_ENDPOINT 8
209+
#define CDC3_RX_ENDPOINT 9
210+
#define CDC3_TX_ENDPOINT 10
211+
#define CDC3_ACM_SIZE 16
212+
#define CDC3_RX_SIZE 64
213+
#define CDC3_TX_SIZE 64
214+
#define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
215+
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
216+
#define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
217+
#define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
218+
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ONLY
219+
#define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
220+
#define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ONLY
221+
#define ENDPOINT9_CONFIG ENDPOINT_RECEIVE_ONLY
222+
#define ENDPOINT10_CONFIG ENDPOINT_TRANSMIT_ONLY
223+
143224
#elif defined(USB_KEYBOARDONLY)
144225
#define VENDOR_ID 0x16C0
145226
#define PRODUCT_ID 0x04D0
@@ -289,7 +370,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
289370
#define KEYMEDIA_INTERVAL 4
290371
#define MULTITOUCH_INTERFACE 3 // Touchscreen
291372
#define MULTITOUCH_ENDPOINT 5
292-
#define MULTITOUCH_SIZE 8
373+
#define MULTITOUCH_SIZE 16
293374
#define MULTITOUCH_FINGERS 10
294375
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
295376
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
@@ -329,7 +410,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
329410
#define MOUSE_INTERVAL 2
330411
#define MULTITOUCH_INTERFACE 4 // Touchscreen
331412
#define MULTITOUCH_ENDPOINT 5
332-
#define MULTITOUCH_SIZE 8
413+
#define MULTITOUCH_SIZE 16
333414
#define MULTITOUCH_FINGERS 10
334415
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
335416
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
@@ -653,6 +734,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
653734
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
654735
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
655736
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
737+
// TODO: Should ENDPOINT4_CONFIG be ENDPOINT_TRANSMIT_ONLY ???
656738
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
657739

658740
#elif defined(USB_AUDIO)

0 commit comments

Comments
 (0)