From 0ff42ce1904f3e800dc19a2ec7a4cf613a6282da Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 15 Dec 2023 11:28:25 +0700 Subject: [PATCH] update featherwing host to new revision - cs, int are pin 10, 9 - remove GPIO0 as vbus enable --- examples/DualRole/CDC/serial_host_bridge/usbh_helper.h | 7 ++----- examples/DualRole/HID/hid_device_report/usbh_helper.h | 7 ++----- .../HID/hid_mouse_log_filter/hid_mouse_log_filter.ino | 3 --- examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h | 7 ++----- .../hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino | 3 --- .../DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h | 7 ++----- examples/DualRole/HID/hid_remapper/hid_remapper.ino | 3 --- examples/DualRole/HID/hid_remapper/usbh_helper.h | 7 ++----- .../MassStorage/msc_data_logger/msc_data_logger.ino | 3 --- .../DualRole/MassStorage/msc_data_logger/usbh_helper.h | 7 ++----- .../MassStorage/msc_file_explorer/msc_file_explorer.ino | 3 --- .../DualRole/MassStorage/msc_file_explorer/usbh_helper.h | 7 ++----- examples/DualRole/Simple/device_info/device_info.ino | 3 --- examples/DualRole/Simple/device_info/usbh_helper.h | 7 ++----- 14 files changed, 16 insertions(+), 58 deletions(-) diff --git a/examples/DualRole/CDC/serial_host_bridge/usbh_helper.h b/examples/DualRole/CDC/serial_host_bridge/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/CDC/serial_host_bridge/usbh_helper.h +++ b/examples/DualRole/CDC/serial_host_bridge/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/HID/hid_device_report/usbh_helper.h b/examples/DualRole/HID/hid_device_report/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/HID/hid_device_report/usbh_helper.h +++ b/examples/DualRole/HID/hid_device_report/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/HID/hid_mouse_log_filter/hid_mouse_log_filter.ino b/examples/DualRole/HID/hid_mouse_log_filter/hid_mouse_log_filter.ino index 375604b4..1388a4fd 100644 --- a/examples/DualRole/HID/hid_mouse_log_filter/hid_mouse_log_filter.ino +++ b/examples/DualRole/HID/hid_mouse_log_filter/hid_mouse_log_filter.ino @@ -61,9 +61,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif //while ( !Serial ) delay(10); // wait for native usb diff --git a/examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h b/examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h +++ b/examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino b/examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino index f26507da..14fc505b 100644 --- a/examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino +++ b/examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino @@ -72,9 +72,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif //while ( !Serial ) delay(10); // wait for native usb diff --git a/examples/DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h b/examples/DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h +++ b/examples/DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/HID/hid_remapper/hid_remapper.ino b/examples/DualRole/HID/hid_remapper/hid_remapper.ino index 535a2413..296f734f 100644 --- a/examples/DualRole/HID/hid_remapper/hid_remapper.ino +++ b/examples/DualRole/HID/hid_remapper/hid_remapper.ino @@ -55,9 +55,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif //while ( !Serial ) delay(10); // wait for native usb diff --git a/examples/DualRole/HID/hid_remapper/usbh_helper.h b/examples/DualRole/HID/hid_remapper/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/HID/hid_remapper/usbh_helper.h +++ b/examples/DualRole/HID/hid_remapper/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino b/examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino index 3526c217..1ed595c8 100644 --- a/examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino +++ b/examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino @@ -118,9 +118,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif #ifdef USE_FREERTOS diff --git a/examples/DualRole/MassStorage/msc_data_logger/usbh_helper.h b/examples/DualRole/MassStorage/msc_data_logger/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/MassStorage/msc_data_logger/usbh_helper.h +++ b/examples/DualRole/MassStorage/msc_data_logger/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/MassStorage/msc_file_explorer/msc_file_explorer.ino b/examples/DualRole/MassStorage/msc_file_explorer/msc_file_explorer.ino index c4945c27..bc90983b 100644 --- a/examples/DualRole/MassStorage/msc_file_explorer/msc_file_explorer.ino +++ b/examples/DualRole/MassStorage/msc_file_explorer/msc_file_explorer.ino @@ -48,9 +48,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif // while ( !Serial ) delay(10); // wait for native usb diff --git a/examples/DualRole/MassStorage/msc_file_explorer/usbh_helper.h b/examples/DualRole/MassStorage/msc_file_explorer/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/MassStorage/msc_file_explorer/usbh_helper.h +++ b/examples/DualRole/MassStorage/msc_file_explorer/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040 diff --git a/examples/DualRole/Simple/device_info/device_info.ino b/examples/DualRole/Simple/device_info/device_info.ino index ea0a16b7..c8b22eac 100644 --- a/examples/DualRole/Simple/device_info/device_info.ino +++ b/examples/DualRole/Simple/device_info/device_info.ino @@ -72,9 +72,6 @@ void setup() { // init host stack on controller (rhport) 1 // For rp2040: this is called in core1's setup1() USBHost.begin(1); - - // FeatherWing USB Host use MAX3421E's GPIO0 as VBUS enable (active high) - USBHost.max3421_writeIOPINS1(0x01, false); #endif // while ( !Serial ) delay(10); // wait for native usb diff --git a/examples/DualRole/Simple/device_info/usbh_helper.h b/examples/DualRole/Simple/device_info/usbh_helper.h index dcc48cc3..7f8ae69f 100644 --- a/examples/DualRole/Simple/device_info/usbh_helper.h +++ b/examples/DualRole/Simple/device_info/usbh_helper.h @@ -41,12 +41,9 @@ Adafruit_USBH_Host USBHost(&SPI, 15, 14); #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) Adafruit_USBH_Host USBHost(&SPI, 27, 33); - #elif defined(ARDUINO_METRO_ESP32S3) || defined(ADAFRUIT_METRO_M4_EXPRESS) || defined(ADAFRUIT_METRO_M0_EXPRESS) - // For Metro shape CS and INT are pin 10, 9 (host shield default) - Adafruit_USBH_Host USBHost(&SPI, 10, 9); #else - // default to FeatherWing USB Host MAX3421E: CS and INT are pin D11, D10 - Adafruit_USBH_Host USBHost(&SPI, 11, 10); + // Default CS and INT are pin 10, 9 + Adafruit_USBH_Host USBHost(&SPI, 10, 9); #endif #else // Native USB Host such as rp2040