Skip to content

Commit

Permalink
Merge pull request #356 from adafruit/correct-feather-esp32v2-pin
Browse files Browse the repository at this point in the history
correct feather esp32 v2 with max3421e pin
  • Loading branch information
hathach authored Dec 27, 2023
2 parents de5353d + e4e854e commit 541fc93
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/DualRole/CDC/serial_host_bridge/usbh_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
2 changes: 1 addition & 1 deletion examples/DualRole/HID/hid_device_report/usbh_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
2 changes: 1 addition & 1 deletion examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
2 changes: 1 addition & 1 deletion examples/DualRole/HID/hid_remapper/usbh_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
2 changes: 1 addition & 1 deletion examples/DualRole/Simple/device_info/usbh_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);
Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
any redistribution
*********************************************************************/


/* This example demonstrates use of both device and host, where
* - Device run on native usb controller (roothub port0)
* - Host run on MAX3421E controller (roothub port1) tested with:
Expand All @@ -20,8 +19,7 @@
* - SPI instance, CS pin, INT pin are correctly configured
*/

/* Host example will get device descriptors of attached devices and print it out via
* device cdc (Serial) as follows:
/* Host example will get device descriptors of attached devices and print it out:
* Device 1: ID 046d:c52f
Device Descriptor:
bLength 18
Expand All @@ -41,21 +39,16 @@
*
*/
#include "Adafruit_TinyUSB.h"

// USBHost is defined in usbh_helper.h
// USB Host using MAX3421E: SPI, CS, INT
#include "SPI.h"

// USB Host using MAX3421E: SPI, CS, INT
#if defined(ARDUINO_METRO_ESP32S2)
Adafruit_USBH_Host USBHost(&SPI, 15, 14);

Adafruit_USBH_Host USBHost(&SPI, 15, 14);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
Adafruit_USBH_Host USBHost(&SPI, 27, 33);

Adafruit_USBH_Host USBHost(&SPI, 33, 15);
#else

// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
// Default CS and INT are pin 10, 9
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
#endif

// Language ID: English
Expand All @@ -72,11 +65,13 @@ typedef struct {
// CFG_TUH_DEVICE_MAX is defined by tusb_config header
dev_info_t dev_info[CFG_TUH_DEVICE_MAX] = { 0 };

//--------------------------------------------------------------------+
// setup() & loop()
//--------------------------------------------------------------------+
void setup() {
Serial.begin(115200);

// init host stack on controller (rhport) 1
// For rp2040: this is called in core1's setup1()
USBHost.begin(1);

// while ( !Serial ) delay(10); // wait for native usb
Expand Down
4 changes: 3 additions & 1 deletion examples/Host/Simple/host_device_info/host_device_info.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ dev_info_t dev_info[CFG_TUH_DEVICE_MAX] = { 0 };

Adafruit_USBH_Host USBHost;

//--------------------------------------------------------------------+
// setup() & loop()
//--------------------------------------------------------------------+
void setup() {
Serial1.begin(115200);
Serial1.println("TinyUSB Host: Device Info Example");
Expand All @@ -63,7 +66,6 @@ void setup() {
USBHost.begin(0);
}

//------------- Core0 -------------//
void loop() {
USBHost.task();
Serial1.flush();
Expand Down

0 comments on commit 541fc93

Please sign in to comment.