Skip to content

Commit

Permalink
Merge pull request #207 from adafruit/add-feather-s2-tft
Browse files Browse the repository at this point in the history
Add Adafruit ESP32-S2 TFT Feather Support
  • Loading branch information
brentru authored Jan 10, 2022
2 parents a6566e1 + 52ec163 commit 038005d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
arduino-platform: ["funhouse_tinyusb", "magtag_tinyusb",
"metro_s2_tinyusb", "feather_s2_tinyusb",
"qtpy_esp32_s2"]
"qtpy_esp32_s2", "feather_s2_tft_tinyusb"]
steps:
- uses: actions/setup-python@v1
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 8 additions & 0 deletions src/Wippersnapper_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
#define STATUS_NEOPIXEL_PIN 33
#define STATUS_NEOPIXEL_NUM 1
#define PIN_I2C_POWER_INVERTED 7
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT)
#define BOARD_ID "adafruit-feather-esp32s2-tft"
#define USE_TINYUSB
#define USE_STATUS_NEOPIXEL
#define NEEDS_STATUS_NEOPIXEL_POWER
#define STATUS_NEOPIXEL_PIN 33
#define STATUS_NEOPIXEL_NUM 1
#define PIN_I2C_POWER_INVERTED 7
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
#define BOARD_ID "adafruit-qtpy-esp32s2"
#define USE_TINYUSB
Expand Down
9 changes: 7 additions & 2 deletions src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ WipperSnapper_Component_I2C::WipperSnapper_Component_I2C(
WS_DEBUG_PRINT("\tFrequency (Hz): ");
WS_DEBUG_PRINTLN(msgInitRequest->i2c_frequency);

// Invert Feather ESP32-S2 pin power for I2C
#ifdef ARDUINO_ADAFRUIT_FEATHER_ESP32S2
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
// Invert Feather ESP32-S2 pin power for I2C
pinMode(PIN_I2C_POWER_INVERTED, OUTPUT);
digitalWrite(PIN_I2C_POWER_INVERTED, LOW);
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT)
// Power the AP2112 regulator
// TODO: Remove when fixed by latest BSP release
pinMode(TFT_I2C_POWER, OUTPUT);
digitalWrite(TFT_I2C_POWER, HIGH);
#endif

// Enable pullups on SCL, SDA
Expand Down
3 changes: 2 additions & 1 deletion src/components/statusLED/Wippersnapper_StatusLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ bool Wippersnapper::statusLEDInit() {
#ifdef NEEDS_STATUS_NEOPIXEL_POWER
pinMode(NEOPIXEL_POWER, OUTPUT);
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT)
digitalWrite(NEOPIXEL_POWER, HIGH);
#else
digitalWrite(NEOPIXEL_POWER, LOW);
Expand Down
2 changes: 1 addition & 1 deletion src/network_interfaces/Wippersnapper_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ class Wippersnapper_ESP32 : public Wippersnapper {
_disconnect();
delay(100);
WiFi.begin(_ssid, _pass);
delay(100);
_status = WS_NET_DISCONNECTED;
delay(5000);
}
}

Expand Down
12 changes: 10 additions & 2 deletions src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
* BSD license, all text here must be included in any redistribution.
*
*/
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
defined(ARDUINO_FUNHOUSE_ESP32S2) || \
defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT)
#include "Wippersnapper_FS.h"
// On-board external flash (QSPI or SPI) macros should already
// defined in your board variant if supported
Expand Down Expand Up @@ -277,7 +282,10 @@ void Wippersnapper_FS::createConfigFileSkel() {
secretsFile.flush();
// platform-dependent changes
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || defined (ARDUINO_ADAFRUIT_QTPY_ESP32S2)
defined(ARDUINO_FUNHOUSE_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT)
secretsFile.print("HERE\",\n\t\"network_type_wifi_native\":{\n\t\t\"network_"
"ssid\":\"YOUR_WIFI_SSID_");
#elif defined(ADAFRUIT_PYPORTAL) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE)
Expand Down

0 comments on commit 038005d

Please sign in to comment.