Skip to content

Commit 32817be

Browse files
committed
add Adafruit_TinyUSB_Arduino as submodules
1 parent 8335f15 commit 32817be

File tree

4 files changed

+98
-6
lines changed

4 files changed

+98
-6
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "libraries/Mouse"]
2323
path = libraries/Mouse
2424
url = https://github.com/earlephilhower/Mouse
25+
[submodule "libraries/Adafruit_TinyUSB_Arduino"]
26+
path = libraries/Adafruit_TinyUSB_Arduino
27+
url = https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git

boards.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ rpipico.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
109109
rpipico.menu.usbstack.picosdk=Built-in
110110
rpipico.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
111111
rpipico.menu.usbstack.tinyusb=TinyUSB
112-
rpipico.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
112+
rpipico.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
113113

114114
rpipicopicoprobe.name=Raspberry Pi Pico (Picoprobe)
115115
rpipicopicoprobe.vid.0=0x2e8a
@@ -214,7 +214,7 @@ rpipicopicoprobe.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
214214
rpipicopicoprobe.menu.usbstack.picosdk=Built-in
215215
rpipicopicoprobe.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
216216
rpipicopicoprobe.menu.usbstack.tinyusb=TinyUSB
217-
rpipicopicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
217+
rpipicopicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
218218

219219
adafruitfeather.name=Adafruit Feather RP2040
220220
adafruitfeather.vid.0=0x2e8a
@@ -355,7 +355,7 @@ adafruitfeather.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
355355
adafruitfeather.menu.usbstack.picosdk=Built-in
356356
adafruitfeather.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
357357
adafruitfeather.menu.usbstack.tinyusb=TinyUSB
358-
adafruitfeather.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
358+
adafruitfeather.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
359359

360360
adafruitfeatherpicoprobe.name=Adafruit Feather RP2040 (Picoprobe)
361361
adafruitfeatherpicoprobe.vid.0=0x2e8a
@@ -496,7 +496,7 @@ adafruitfeatherpicoprobe.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
496496
adafruitfeatherpicoprobe.menu.usbstack.picosdk=Built-in
497497
adafruitfeatherpicoprobe.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
498498
adafruitfeatherpicoprobe.menu.usbstack.tinyusb=TinyUSB
499-
adafruitfeatherpicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
499+
adafruitfeatherpicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
500500

501501
generic.name=Generic RP2040
502502
generic.vid.0=0x2e8a
@@ -629,7 +629,7 @@ generic.menu.boot2.boot2_w25x10cl_4_padded_checksum.build.boot2=boot2_w25x10cl_4
629629
generic.menu.usbstack.picosdk=Built-in
630630
generic.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
631631
generic.menu.usbstack.tinyusb=TinyUSB
632-
generic.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
632+
generic.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
633633

634634
genericpicoprobe.name=Generic RP2040 (Picoprobe)
635635
genericpicoprobe.vid.0=0x2e8a
@@ -762,4 +762,4 @@ genericpicoprobe.menu.boot2.boot2_w25x10cl_4_padded_checksum.build.boot2=boot2_w
762762
genericpicoprobe.menu.usbstack.picosdk=Built-in
763763
genericpicoprobe.menu.usbstack.picosdk.build.flags.usbstack="-I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/"
764764
genericpicoprobe.menu.usbstack.tinyusb=TinyUSB
765-
genericpicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB"
765+
genericpicoprobe.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB "-I{build.core.path}/TinyUSB" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"

cores/rp2040/TinyUSB/tusb_config.h

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2018, hathach for Adafruit
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef _TUSB_CONFIG_H_
26+
#define _TUSB_CONFIG_H_
27+
28+
#ifdef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
//--------------------------------------------------------------------
33+
// COMMON CONFIGURATION
34+
//--------------------------------------------------------------------
35+
#ifdef USE_TINYUSB
36+
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
37+
#else
38+
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE
39+
#endif
40+
41+
// #define CFG_TUSB_MCU OPT_MCU_RP2040
42+
#define CFG_TUSB_OS OPT_OS_PICO
43+
44+
#define CFG_TUSB_DEBUG 0
45+
#if CFG_TUSB_DEBUG
46+
#define tu_printf serial1_printf
47+
extern int serial1_printf(const char *__restrict __format, ...);
48+
#endif
49+
50+
#define CFG_TUSB_MEM_SECTION
51+
#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
52+
53+
//--------------------------------------------------------------------
54+
// DEVICE CONFIGURATION
55+
//--------------------------------------------------------------------
56+
57+
#define CFG_TUD_ENDOINT0_SIZE 64
58+
59+
//------------- CLASS -------------//
60+
#define CFG_TUD_CDC 1
61+
#define CFG_TUD_MSC 1
62+
#define CFG_TUD_HID 1
63+
#define CFG_TUD_MIDI 1
64+
#define CFG_TUD_VENDOR 1
65+
66+
// CDC FIFO size of TX and RX
67+
#define CFG_TUD_CDC_RX_BUFSIZE 256
68+
#define CFG_TUD_CDC_TX_BUFSIZE 256
69+
70+
// MSC Buffer size of Device Mass storage
71+
#define CFG_TUD_MSC_BUFSIZE 512
72+
73+
// HID buffer size Should be sufficient to hold ID (if any) + Data
74+
#define CFG_TUD_HID_BUFSIZE 64
75+
76+
// MIDI FIFO size of TX and RX
77+
#define CFG_TUD_MIDI_RX_BUFSIZE 128
78+
#define CFG_TUD_MIDI_TX_BUFSIZE 128
79+
80+
// Vendor FIFO size of TX and RX
81+
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
82+
#define CFG_TUD_VENDOR_TX_BUFSIZE 64
83+
84+
#ifdef __cplusplus
85+
}
86+
#endif
87+
88+
#endif /* _TUSB_CONFIG_H_ */

libraries/Adafruit_TinyUSB_Arduino

0 commit comments

Comments
 (0)