Skip to content

Commit 76b4aa9

Browse files
committed
Made PIN_USB_HOST_ENABLE optional. Readme updates for MT-D11 and Generic D11C14A.
1 parent 2f448ea commit 76b4aa9

File tree

10 files changed

+48
-39
lines changed

10 files changed

+48
-39
lines changed

cores/arduino/USB/samd21_host.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ void UHD_Init(void)
161161
uhd_state = UHD_STATE_NO_VBUS;
162162

163163
// Put VBUS on USB port
164+
#if defined(PIN_USB_HOST_ENABLE)
164165
pinMode( PIN_USB_HOST_ENABLE, OUTPUT );
165166
digitalWrite( PIN_USB_HOST_ENABLE, PIN_USB_HOST_ENABLE_VALUE );
167+
#endif
166168

167169
uhd_enable_connection_int();
168170

variants/Generic_D11C14A/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ Other COM PWM Analog INT Arduino* Arduino* INT Analog PWM C
66
=========================================================================================
77
1-------------------
88
SCK*/RX2 TCC01 * * 5 | A5 A4 | 4 * * TCC00 MOSI*/TX2 REF
9-
MOSI* TCC02 * 8 | A8 A2 | 2 * * DAC
10-
SCK* TCC03 * 9 | A9 Vdd |
9+
MOSI* TCC02 * 8 | A8 (XIN) A2 | 2 * * DAC
10+
SCK* TCC03 * 9 | A9 (XOUT) Vdd |
1111
SDA/MISO* TC10 * NMI 14 | A14 Gnd |
1212
SCL/SS* TC11 * * 15 | A15 A25 | 25 USB/DP
1313
BOOT 28 | A28/RST A24 | 24 USB/DM
1414
SWDCLK TX1/MISO* 30 | A30 A31 | 31 * RX1/SS* SWDIO
1515
-------------------
1616
1717
* Most pins can be used for more than one function. When using PIN_MAP_STANDARD, the port
18-
pin number printed on the board is also used in Arduino (but without the 'A') for all
19-
of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.). When
20-
using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the top
21-
left pin (A2). PIN_MAP_COMPACT uses less RAM.
18+
pin number printed on the chip above is also used in Arduino (but without the 'A') for
19+
all of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.).
20+
When using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the
21+
top left pin (A5). PIN_MAP_COMPACT uses less RAM.
2222
* When USB CDC is enabled, Serial refers to SerialUSB, otherwise it refers to Serial1.
2323
* When using ONE_UART_NO_WIRE_ONE_SPI, use SPI on pins 4, 5, 14, and 15.
2424
When using NO_UART_ONE_WIRE_ONE_SPI, use SPI on pins 8, 9, 30, and 31.
@@ -91,10 +91,10 @@ Arduino | Port | Alternate Function | Comments (! means not used with this perip
9191
====================================================================================================================================
9292
9393
* Most pins can be used for more than one function. When using PIN_MAP_STANDARD, the port
94-
pin number printed on the board is also used in Arduino (but without the 'A') for all
95-
of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.). When
96-
using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the top
97-
left pin (A2). PIN_MAP_COMPACT uses less RAM.
94+
pin number printed on the chip above is also used in Arduino (but without the 'A') for
95+
all of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.).
96+
When using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the
97+
top left pin (A5). PIN_MAP_COMPACT uses less RAM.
9898
* NOT A PIN means the Arduino pin number is not mapped to a physical pin.
9999
* Pins 24 and 25 are in use by USB (USB_NEGATIVE and USB_POSITIVE).
100100
* The tone library uses TC2. TC2 is not routed to pins in the D11C14A (14-pin).

variants/Generic_D11C14A/variant.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,17 @@ static const uint8_t SCL = PIN_WIRE_SCL;
296296

297297

298298
/*
299-
* USB
299+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
300+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
300301
*/
301302
#if defined PIN_MAP_STANDARD
302303
#define PIN_USB_DM (24ul)
303304
#define PIN_USB_DP (25ul)
304-
#define PIN_USB_HOST_ENABLE (14ul)
305+
//#define PIN_USB_HOST_ENABLE (14ul)
305306
#elif defined PIN_MAP_COMPACT
306307
#define PIN_USB_DM (7ul)
307308
#define PIN_USB_DP (8ul)
308-
#define PIN_USB_HOST_ENABLE (5ul)
309+
//#define PIN_USB_HOST_ENABLE (5ul)
309310
#endif
310311

311312
#define PIN_USB_HOST_ENABLE_VALUE HIGH

variants/MT_D11/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
```
44
=========================== MattairTech MT-D11 (ATsamD11D14AM) ==========================
5-
Other COM PWM Analog INT Arduino* Arduino* INT PWM COM Other
5+
Other COM PWM Analog INT Arduino* Arduino* INT PWM COM Other
66
=========================================================================================
7-
-------------------
8-
DAC * | A2 | USB | Gnd |
9-
REF * | A3 | | Vcc |
10-
TCC00 * * | A4 ----- A31 | 31 * TC21 RX1 SWDIO
11-
TCC01 * * | A5 A30 | 30 TC20 TX1 SWDCLK
12-
TCC02 * | A6 A27 | 27 *
13-
TCC03 * | A7 A23 | 23 SCL
14-
MOSI / TX2 * * | A10 A22 | 22 * SDA
15-
SCK / RX2 * | A11 A17 | 17 TC11
16-
MISO * NMI | A14 A16 | 16 * TC10 LED
17-
BTN SS * * | A15 RST | BOOT
18-
-------------------
7+
-------------------
8+
DAC * 2 | A2 | USB | Gnd |
9+
REF * 3 | A3 | | Vcc |
10+
TCC00 * * 4 | A4 ----- A31 | 31 * TC21 RX1 SWDIO
11+
TCC01 * * 5 | A5 A30 | 30 TC20 TX1 SWDCLK
12+
TCC02 * 6 | A6 A27 | 27 *
13+
TCC03 * 7 | A7 A23 | 23 SCL
14+
MOSI / TX2 * * 10 | A10 A22 | 22 * SDA
15+
SCK / RX2 * 11 | A11 A17 | 17 TC11
16+
MISO * NMI 14 | A14 A16 | 16 * TC10 LED
17+
BTN SS * * 15 | A15 RST | BOOT
18+
-------------------
1919
2020
* Most pins can be used for more than one function. When using PIN_MAP_STANDARD, the port
2121
pin number printed on the board is also used in Arduino (but without the 'A') for all
@@ -59,7 +59,7 @@ Arduino | Silk | Port | Alternate Function | Comments (! means not used with thi
5959
20 | --- | ---- | NOT A PIN | NOT A PIN
6060
21 | --- | ---- | NOT A PIN | NOT A PIN
6161
22 | A22 | PA22 | I2C/SDA w/pullup | EIC/EXTINT[6] PTC/X[6] PTC/Y[12] !SERCOM1/PAD[0] SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[4]
62-
23 | A23 | PA23 | I2C/SCL w/pullup | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[0] !TC1/WO[1] !TCC0/WO[5]
62+
23 | A23 | PA23 | I2C/SCL w/pullup | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[1] !TC1/WO[1] !TCC0/WO[5]
6363
24 | --- | PA24 | USB_NEGATIVE | USB/DM
6464
25 | --- | PA25 | USB_POSITIVE | USB/DP
6565
26 | --- | ---- | NOT A PIN | NOT A PIN
@@ -89,7 +89,7 @@ Arduino | Silk | Port | Alternate Function | Comments (! means not used with thi
8989
10 | A16 | PA16 | LED | EIC/EXTINT[0] PTC/X[4] PTC/Y[10] !SERCOM1/PAD[2] !SERCOM2/PAD[2] TC1/WO[0] !TCC0/WO[6] LED
9090
11 | A17 | PA17 | HOST_ENABLE | !EIC/EXTINT[1] PTC/X[5] PTC/Y[11] !SERCOM1/PAD[3] !SERCOM2/PAD[3] TC1/WO[1] !TCC0/WO[7] HOST_ENABLE
9191
12 | A22 | PA22 | I2C/SDA w/pullup | EIC/EXTINT[6] PTC/X[6] PTC/Y[12] !SERCOM1/PAD[0] SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[4]
92-
13 | A23 | PA23 | I2C/SCL w/pullup | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[0] !TC1/WO[1] !TCC0/WO[5]
92+
13 | A23 | PA23 | I2C/SCL w/pullup | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[1] !TC1/WO[1] !TCC0/WO[5]
9393
14 | A27 | PA27 | | EIC/EXTINT[7] PTC/X[10]
9494
15 | A30 | PA30 | TX1 / SWD CLK | !EIC/EXTINT[2] !SERCOM1/PAD[0] SERCOM1/PAD[2] TC2/WO[0] !TCC0/WO[2] SWD CLK, leave floating during boot
9595
16 | A31 | PA31 | RX1 / SWD IO | EIC/EXTINT[3] !SERCOM1/PAD[1] SERCOM1/PAD[3] TC2/WO[1] !TCC0/WO[3] SWD IO

variants/MT_D11/variant.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,18 @@ static const uint8_t SCL = PIN_WIRE_SCL;
310310

311311

312312
/*
313-
* USB
313+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
314+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
314315
*/
315316
#if defined PIN_MAP_STANDARD
316317
#define PIN_USB_DM (24ul)
317318
#define PIN_USB_DP (25ul)
318-
#define PIN_USB_HOST_ENABLE (17ul)
319+
//#define PIN_USB_HOST_ENABLE (17ul)
319320
#elif defined PIN_MAP_COMPACT
320321
// USB pins not directly accessible using PIN_MAP_COMPACT
321322
#define PIN_USB_DM (0ul)
322323
#define PIN_USB_DP (0ul)
323-
#define PIN_USB_HOST_ENABLE (0ul)
324+
//#define PIN_USB_HOST_ENABLE (0ul)
324325
#endif
325326

326327
#define PIN_USB_HOST_ENABLE_VALUE HIGH

variants/MT_D21E/variant.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
280280

281281

282282
/*
283-
* USB
283+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
284+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
284285
*/
285286
#define PIN_USB_DM (24ul)
286287
#define PIN_USB_DP (25ul)
287-
#define PIN_USB_HOST_ENABLE (14ul)
288+
//#define PIN_USB_HOST_ENABLE (14ul)
288289
#define PIN_USB_HOST_ENABLE_VALUE HIGH
289290

290291
/*

variants/MT_D21E_revB/variant.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,12 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
368368

369369

370370
/*
371-
* USB
371+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
372+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
372373
*/
373374
#define PIN_USB_DM (24ul)
374375
#define PIN_USB_DP (25ul)
375-
#define PIN_USB_HOST_ENABLE (14ul)
376+
//#define PIN_USB_HOST_ENABLE (14ul)
376377
#define PIN_USB_HOST_ENABLE_VALUE HIGH
377378

378379
/*

variants/Xeno/variant.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,12 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
309309

310310

311311
/*
312-
* USB
312+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
313+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
313314
*/
314315
#define PIN_USB_DM (24ul)
315316
#define PIN_USB_DP (25ul)
316-
#define PIN_USB_HOST_ENABLE (14ul)
317+
//#define PIN_USB_HOST_ENABLE (14ul)
317318
#define PIN_USB_HOST_ENABLE_VALUE 0
318319

319320
/*

variants/arduino_mzero/variant.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ static const uint8_t SDA = PIN_WIRE_SDA;
216216
static const uint8_t SCL = PIN_WIRE_SCL;
217217

218218
/*
219-
* USB
219+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
220+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
220221
*/
221222
#define PIN_USB_DM (33ul)
222223
#define PIN_USB_DP (34ul)

variants/arduino_zero/variant.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ static const uint8_t SDA = PIN_WIRE_SDA;
220220
static const uint8_t SCL = PIN_WIRE_SCL;
221221

222222
/*
223-
* USB
223+
* USB - Define PIN_USB_HOST_ENABLE to assert the defined pin to
224+
* PIN_USB_HOST_ENABLE_VALUE during startup. Leave undefined to disable this pin.
224225
*/
225226
#define PIN_USB_DM (28ul)
226227
#define PIN_USB_DP (29ul)

0 commit comments

Comments
 (0)