* add wiphone, still WIP

* (very preliminary) wiphone support

* undo config changes

* revert extensions.json

* eh?
This commit is contained in:
Thomas Göttgens
2024-05-06 13:48:57 +02:00
committed by GitHub
parent 77a66e1dce
commit 353c7e07d1
6 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 20
#define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
static const uint8_t G23 = 23;
static const uint8_t G19 = 19;
static const uint8_t G18 = 18;
static const uint8_t G3 = 3;
static const uint8_t G16 = 16;
static const uint8_t G21 = 21;
static const uint8_t G2 = 2;
static const uint8_t G12 = 12;
static const uint8_t G15 = 15;
static const uint8_t G35 = 35;
static const uint8_t G36 = 36;
static const uint8_t G25 = 25;
static const uint8_t G26 = 26;
static const uint8_t G1 = 1;
static const uint8_t G17 = 17;
static const uint8_t G22 = 22;
static const uint8_t G5 = 5;
static const uint8_t G13 = 13;
static const uint8_t G0 = 0;
static const uint8_t G34 = 34;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t ADC1 = 35;
static const uint8_t ADC2 = 36;
#endif /* Pins_Arduino_h */

View File

@@ -0,0 +1,13 @@
[env:wiphone]
extends = esp32_base
board = wiphone
monitor_filters = esp32_exception_decoder
board_build.partitions = default_16MB.csv
build_flags =
${esp32_base.build_flags} -D WIPHONE -I variants/wiphone
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.8
sparkfun/SX1509 IO Expander@^3.0.5
pololu/APA102@^3.0.0

View File

@@ -0,0 +1,58 @@
#define I2C_SDA 15
#define I2C_SCL 25
#define GPIO_EXTENDER 1509
#define EXTENDER_FLAG 0x40
#define EXTENDER_PIN(x) (x + EXTENDER_FLAG)
#undef RF95_SCK
#undef RF95_MISO
#undef RF95_MOSI
#undef RF95_NSS
#define RF95_SCK 14
#define RF95_MISO 12
#define RF95_MOSI 13
#define RF95_NSS 27
#define USE_RF95
#define LORA_DIO0 38
#define LORA_RESET RADIOLIB_NC
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC
// This board has no GPS or Screen for now
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define NO_GPS
#define HAS_GPS 0
#define NO_SCREEN
#define HAS_SCREEN 0
// Default SPI1 will be mapped to the display
#define ST7789_SDA 23
#define ST7789_SCK 18
#define ST7789_CS 5
#define ST7789_RS 26
#define ST7789_BL -1 // EXTENDER_PIN(9)
#define ST7789_RESET -1
#define ST7789_MISO 19
#define ST7789_BUSY -1
#define ST7789_SPI_HOST SPI3_HOST
#define ST7789_BACKLIGHT_EN -1 // EXTENDER_PIN(9)
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_HEIGHT 240
#define TFT_WIDTH 320
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5
#define I2S_MCLK_GPIO0
#define I2S_BCK_PIN 4 // rev1.3 - 4 (wp05)
#define I2S_WS_PIN 33
#define I2S_MOSI_PIN 21
#define I2S_MISO_PIN 34