Added Yellow AP basic parts, for now using Arduino GFX for simplicity

This commit is contained in:
atc1441
2023-08-06 23:35:30 +02:00
parent 41c7cb843f
commit 0b66a23ce4
3 changed files with 169 additions and 69 deletions

View File

@@ -34,73 +34,6 @@ build_flags =
-D ILI9341_DRIVER
-D SMOOTH_FONT
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an SONOFF ZB Bridge-P
;
; ----------------------------------------------------------------------------------------
[env:Sonoff_zb_bridge_P_AP]
board = esp32dev
board_build.partitions = default.csv
build_flags =
${env.build_flags}
-D CORE_DEBUG_LEVEL=0
-D POWER_NO_SOFT_POWER
; -DBOARD_HAS_PSRAM
; -mfix-esp32-psram-cache-issue
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=-1
-D FLASHER_AP_POWER={-1}
-D FLASHER_AP_TEST=-1
-D FLASHER_AP_TXD=19
-D FLASHER_AP_RXD=23
-D FLASHER_LED=2
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the UniRfInterface PCB with EBYTE E79 CC1352P Module
;
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_CC1352P]
platform = https://github.com/platformio/platform-espressif32.git
board=lolin_s2_mini
board_build.partitions = default.csv
build_unflags =
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags =
${env.build_flags}
-D OPENEPAPERLINK_MINI_AP_PCB
-D ARDUINO_USB_MODE=0
-D CONFIG_SPIRAM_USE_MALLOC=1
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
-D BOARD_HAS_PSRAM
-D POWER_NO_SOFT_POWER
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=21
-D FLASHER_AP_POWER={-1} ;this board has no soft power control
-D FLASHER_AP_TXD=17
-D FLASHER_AP_RXD=16
-D FLASHER_AP_TEST=-1
-D FLASHER_LED=2
-D FLASHER_RGB_LED=-1
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the Mini_AP
;
; ----------------------------------------------------------------------------------------
@@ -317,3 +250,111 @@ build_flags =
-D SMOOTH_FONT
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
;
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_16_8_YELLOW_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
lib_deps =
${env.lib_deps}
https://github.com/moononournation/Arduino_GFX
build_unflags =
-D ARDUINO_USB_MODE=1
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags =
${env.build_flags}
-D YELLOW_IPS_AP
-D CORE_DEBUG_LEVEL=0
-D ARDUINO_USB_MODE=0
-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
-D CONFIG_SPIRAM_USE_MALLOC=1
-D POWER_NO_SOFT_POWER
-D BOARD_HAS_PSRAM
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=47
-D FLASHER_AP_POWER={-1}
-D FLASHER_AP_TEST=-1
-D FLASHER_AP_TXD=17
-D FLASHER_AP_RXD=18
-D FLASHER_LED=14
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an SONOFF ZB Bridge-P
;
; ----------------------------------------------------------------------------------------
[env:Sonoff_zb_bridge_P_AP]
board = esp32dev
board_build.partitions = default.csv
build_flags =
${env.build_flags}
-D CORE_DEBUG_LEVEL=0
-D POWER_NO_SOFT_POWER
; -DBOARD_HAS_PSRAM
; -mfix-esp32-psram-cache-issue
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=-1
-D FLASHER_AP_POWER={-1}
-D FLASHER_AP_TEST=-1
-D FLASHER_AP_TXD=19
-D FLASHER_AP_RXD=23
-D FLASHER_LED=2
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the UniRfInterface PCB with EBYTE E79 CC1352P Module
;
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_CC1352P]
platform = https://github.com/platformio/platform-espressif32.git
board=lolin_s2_mini
board_build.partitions = default.csv
build_unflags =
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags =
${env.build_flags}
-D OPENEPAPERLINK_MINI_AP_PCB
-D ARDUINO_USB_MODE=0
-D CONFIG_SPIRAM_USE_MALLOC=1
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
-D BOARD_HAS_PSRAM
-D POWER_NO_SOFT_POWER
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=21
-D FLASHER_AP_POWER={-1} ;this board has no soft power control
-D FLASHER_AP_TXD=17
-D FLASHER_AP_RXD=16
-D FLASHER_AP_TEST=-1
-D FLASHER_LED=2
-D FLASHER_RGB_LED=-1
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB

View File

@@ -0,0 +1,50 @@
#ifdef YELLOW_IPS_AP
#include <Arduino.h>
#include <Arduino_GFX_Library.h>
#include <WiFi.h>
#include "tag_db.h"
Arduino_DataBus *bus = new Arduino_ESP32SPI(11 /* DC */, 10 /* CS */, 12 /* SCK */, 13 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
Arduino_GFX *gfx = new Arduino_ST7789(bus, 1 /* RST */, 3 /* rotation */, true /* IPS */, 170 /* width */, 320 /* height */, 35 /* col offset 1 */, 0 /* row offset 1 */, 35 /* col offset 2 */, 0 /* row offset 2 */);
void yellow_ap_display_init(void) {
gfx->begin();
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("OpenEPaperLink");
gfx->setCursor(10, 40);
gfx->setTextColor(GREEN);
gfx->println("Also on 16MB Flash 8MB RAM");
gfx->setCursor(10, 80);
gfx->setTextColor(WHITE);
gfx->println("Booting");
}
bool first_clear = 0;
uint32_t last_update = 0;
void yellow_ap_display_loop(void) {
if (millis() - last_update >= 100) {
if (first_clear == 0) {
first_clear = 1;
gfx->fillScreen(BLACK);
gfx->setTextSize(3);
}
last_update = millis();
gfx->setCursor(0, 0);
gfx->setTextColor(RED, BLACK);
gfx->println("OpenEPaperLink");
gfx->setTextColor(GREEN, BLACK);
gfx->println("Millis :");
gfx->println(millis());
gfx->setTextColor(WHITE, BLACK);
gfx->println("IP Address :");
gfx->println(WiFi.localIP().toString());
gfx->setTextColor(WHITE, BLACK);
gfx->println("Tag Count :");
gfx->println(getTagCount());
}
}
#endif

View File

@@ -51,6 +51,10 @@ void timeTask(void* parameter) {
void setup() {
Serial.begin(115200);
Serial.print(">\n");
#ifdef YELLOW_IPS_AP
extern void yellow_ap_display_init(void);
yellow_ap_display_init();
#endif
xTaskCreate(ledTask, "ledhandler", 2000, NULL, 2, NULL);
vTaskDelay(10 / portTICK_PERIOD_MS);
@@ -154,8 +158,13 @@ void loop() {
while (1) {
// pinTest();
while (1) {
vTaskDelay(10000 / portTICK_PERIOD_MS);
// pinTest();
#ifdef YELLOW_IPS_AP
extern void yellow_ap_display_loop(void);
yellow_ap_display_loop();
#else
vTaskDelay(10000 / portTICK_PERIOD_MS);
// pinTest();
#endif
}
#ifdef OPENEPAPERLINK_PCB
if (extTagConnected()) {