diff --git a/bin/device-install.bat b/bin/device-install.bat index 519073b08a..c209deb565 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -15,12 +15,12 @@ SET "LOGCOUNTER=0" SET "BPS_RESET=0" @REM FIXME: Determine mcu from PlatformIO variant, this is unmaintainable. -SET "S3=s3 v3 t-deck wireless-paper wireless-tracker station-g2 unphone t-eth-elite tlora-pager mesh-tab dreamcatcher ESP32-S3-Pico seeed-sensecap-indicator heltec_capsule_sensor_v3 vision-master icarus tracksenger elecrow-adv heltec-v4" +SET "S3=s3 v3 t-deck wireless-paper wireless-tracker station-g2 unphone t-eth-elite tlora-pager mesh-tab dreamcatcher ESP32-S3-Pico seeed-sensecap-indicator heltec_capsule_sensor_v3 vision-master icarus tracksenger elecrow-adv heltec-v4 Makerfabs_MaTouch" SET "C3=esp32c3" @REM FIXME: Determine flash size from PlatformIO variant, this is unmaintainable. SET "BIGDB_8MB=crowpanel-esp32s3 heltec_capsule_sensor_v3 heltec-v3 heltec-vision-master-e213 heltec-vision-master-e290 heltec-vision-master-t190 heltec-wireless-paper heltec-wireless-tracker heltec-wsl-v3 icarus seeed-xiao-s3 tbeam-s3-core tracksenger" SET "MUIDB_8MB=picomputer-s3 unphone seeed-sensecap-indicator" -SET "BIGDB_16MB=t-deck mesh-tab t-energy-s3 dreamcatcher ESP32-S3-Pico m5stack-cores3 station-g2 t-eth-elite tlora-pager t-watch-s3 elecrow-adv heltec-v4" +SET "BIGDB_16MB=t-deck mesh-tab t-energy-s3 dreamcatcher ESP32-S3-Pico m5stack-cores3 station-g2 t-eth-elite tlora-pager t-watch-s3 elecrow-adv heltec-v4 Makerfabs_MaTouch" GOTO getopts :help diff --git a/bin/device-install.sh b/bin/device-install.sh index 69e4794ba8..2abda76229 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -43,6 +43,7 @@ BIGDB_16MB=( "t-eth-elite" "t-watch-s3" "tlora-pager" + "Makerfabs_MaTouch" ) S3_VARIANTS=( "s3" @@ -64,6 +65,7 @@ S3_VARIANTS=( "icarus" "tracksenger" "elecrow-adv" + "Makerfabs_MaTouch" ) # Determine the correct esptool command to use diff --git a/boards/makerfabs_matouch.json b/boards/makerfabs_matouch.json new file mode 100644 index 0000000000..43970ccf07 --- /dev/null +++ b/boards/makerfabs_matouch.json @@ -0,0 +1,40 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_16MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "-DBOARD_HAS_PSRAM", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=0", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "ESP32-S3-WROOM-1-N16R8" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": ["esp-builtin"], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "ESP32-S3-WROOM-1-N16R8 (16 MB Flash, 8 MB PSRAM)", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 524288, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.makerfabs.com/esp32-s3-spi-tft-with-touch-ili9488.html", + "vendor": "Espressif" +} diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 0da44cce07..89946c8297 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -288,6 +288,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_WISMESH_TAP_V2 = 116, /* RAK3401 */ meshtastic_HardwareModel_RAK3401 = 117, + /* Makerfabs MaTouch_ESP32-S3 SPI TFT with Touch 3.5'' ILI9488*/ + meshtastic_HardwareModel_MAKERFABS_MATOUCH_3_5_SPI = 118, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 9b5abfba04..4b403848eb 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -205,6 +205,8 @@ #define HW_VENDOR meshtastic_HardwareModel_M5STACK_C6L #elif defined(HELTEC_WIRELESS_TRACKER_V2) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_WIRELESS_TRACKER_V2 +#elif defined(MAKERFABS_MATOUCH) +#define HW_VENDOR meshtastic_HardwareModel_MAKERFABS_MATOUCH_3_5_SPI #endif // ----------------------------------------------------------------------------- diff --git a/variants/esp32s3/makerfabs_matouch/pins_arduino.h b/variants/esp32s3/makerfabs_matouch/pins_arduino.h new file mode 100644 index 0000000000..957de06c6d --- /dev/null +++ b/variants/esp32s3/makerfabs_matouch/pins_arduino.h @@ -0,0 +1,47 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include "soc/soc_caps.h" +#include + +#define USB_VID 0x303A +#define USB_PID 0x1001 + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +static const uint8_t SDA = 38; +static const uint8_t SCL = 39; + +static const uint8_t SS = -1; +static const uint8_t MOSI = 10; +static const uint8_t MISO = 4; +static const uint8_t SCK = 5; + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; +static const uint8_t A9 = 10; +static const uint8_t A10 = 11; +static const uint8_t A11 = 12; +static const uint8_t A12 = 13; + +static const uint8_t T1 = 1; +static const uint8_t T3 = 3; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/makerfabs_matouch/platformio.ini b/variants/esp32s3/makerfabs_matouch/platformio.ini new file mode 100644 index 0000000000..7f1c8df9b9 --- /dev/null +++ b/variants/esp32s3/makerfabs_matouch/platformio.ini @@ -0,0 +1,86 @@ +[matouch_base] +extends = esp32s3_base +board = makerfabs_matouch +board_level = extra +board_upload.flash_size = 16MB +board_build.partitions = default_16MB.csv +board_build.psram = enabled +upload_protocol = esptool +build_flags = ${esp32s3_base.build_flags} + -I variants/esp32s3/makerfabs_matouch + -D MAKERFABS_MATOUCH + -D CONFIG_ARDUHAL_ESP_LOG + -D CONFIG_ARDUHAL_LOG_COLORS=1 + -D CONFIG_DISABLE_HAL_LOCKS=1 + -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 + -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 + -D MESHTASTIC_EXCLUDE_WEBSERVER=1 + -D MESHTASTIC_EXCLUDE_SERIAL=1 + -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 + -D MESHTASTIC_EXCLUDE_SCREEN=1 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_USE_SYSMON=0 + -D LV_USE_PROFILER=0 + -D LV_USE_PERF_MONITOR=0 + -D LV_USE_MEM_MONITOR=0 + -D LV_USE_LOG=0 + -D LV_BUILD_TEST=0 + -D RADIOLIB_DEBUG_SPI=0 + -D RADIOLIB_DEBUG_PROTOCOL=0 + -D RADIOLIB_DEBUG_BASIC=0 + -D RADIOLIB_VERBOSE_ASSERT=0 + -D RADIOLIB_SPI_PARANOID=0 + -D USE_LOG_DEBUG + -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D HAS_SCREEN=0 + -D HAS_TFT=1 + -D USE_PIN_BUZZER + -D RAM_SIZE=1024 + -D LGFX_DRIVER_TEMPLATE + -D LGFX_DRIVER=LGFX_GENERIC + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" + -D LGFX_PIN_SCK=14 + -D LGFX_PIN_MOSI=13 + -D LGFX_PIN_MISO=12 + -D LGFX_PIN_DC=21 + -D LGFX_PIN_CS=15 + -D LGFX_PIN_RST=-1 + -D LGFX_PIN_BL=48 + -D LGFX_TOUCH_INT=40 + -D VIEW_320x240 + -D USE_PACKET_API +build_src_filter = ${esp32_base.build_src_filter} +lib_deps = + ${esp32_base.lib_deps} + ${device-ui_base.lib_deps} + lovyan03/LovyanGFX@^1.2.0 + +[touch_ft5x06] +extends = matouch_base +build_flags = ${matouch_base.build_flags} + -D LGFX_TOUCH=FT5x06 + -D LGFX_TOUCH_I2C_FREQ=400000 + -D LGFX_TOUCH_I2C_PORT=0 + -D LGFX_TOUCH_I2C_ADDR=0x38 + -D LGFX_TOUCH_I2C_SDA=38 + -D LGFX_TOUCH_I2C_SCL=39 + -D LGFX_TOUCH_RST=-1 + +;https://www.makerfabs.com/esp32-s3-spi-tft-with-touch-ili9488.html +[env:makerfabs_matouch_3_5_spi_ili9488] +extends = matouch_base +build_flags = ${touch_ft5x06.build_flags} + -D SPI_FREQUENCY=75000000 + -D DISPLAY_SET_RESOLUTION + -D LGFX_SCREEN_WIDTH=320 + -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 + -D LGFX_PANEL=ILI9488 + -D LGFX_ROTATION=0 + -D LGFX_TOUCH_X_MIN=0 + -D LGFX_TOUCH_X_MAX=319 + -D LGFX_TOUCH_Y_MIN=0 + -D LGFX_TOUCH_Y_MAX=479 + -D LGFX_TOUCH_ROTATION=0 \ No newline at end of file diff --git a/variants/esp32s3/makerfabs_matouch/variant.h b/variants/esp32s3/makerfabs_matouch/variant.h new file mode 100644 index 0000000000..1b4d25f6fd --- /dev/null +++ b/variants/esp32s3/makerfabs_matouch/variant.h @@ -0,0 +1,24 @@ +#define HAS_TOUCHSCREEN 1 + +#define PIN_BUZZER 7 + +//TFT SPI +#define SPI_MOSI 13 +#define SPI_SCK 14 +#define SPI_MISO 12 +#define SPI_CS 15 + +#define USE_RF95 + +// LORA SPI +#define LORA_SCK 5 +#define LORA_MISO 4 +#define LORA_MOSI 10 +#define LORA_CS 6 + +// LORA CONFIG +#define LORA_DIO0 9 +#define LORA_RESET 17 +#define LORA_DIO1 46 +#define LORA_DIO2 -1 +#define LORA_DIO3 -1