Refactor EInkDisplay (#3299)
* Refactor EInkDisplay A lot of variant specific code is merged, with the macros pushed to the respective variant.h files. "Dynamic Partial" code has been purged, pending a rewrite. * fix: declare class only if USE_EINK, init all members * refactor: move macros to platformio.ini Responds to https://github.com/meshtastic/firmware/pull/3299#issuecomment-1966425926 * fix: EInkDisplay::connect() references old macros Usage was in a block of variant-specific code, which had been intentionally left untouched. * fix: remove duplicate macros from variant.h --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
co-authored by
GitHub
Ben Meadors
parent
7aee014f5e
commit
6acc63729b
@@ -4,6 +4,9 @@ board = nordic_pca10059
|
||||
board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_M01
|
||||
-DEINK_WIDTH=300
|
||||
-DEINK_HEIGHT=400
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Dongle_nRF52840-pca10059-v1>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -136,7 +136,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (0 + 31) // LORA_CS P0.31
|
||||
#define SX126X_DIO1 (0 + 29) // DIO1 P0.29
|
||||
#define SX126X_BUSY (0 + 2) // LORA_BUSY P0.02
|
||||
#define SX126X_BUSY (0 + 2) // LORA_BUSY P0.02
|
||||
#define SX126X_RESET (32 + 15) // LORA_RESET P1.15
|
||||
#define SX126X_TXEN (32 + 13) // TXEN P1.13 NiceRF 868 dont use
|
||||
#define SX126X_RXEN (32 + 10) // RXEN P1.10 NiceRF 868 dont use
|
||||
|
||||
@@ -10,5 +10,8 @@ lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
zinggjm/GxEPD2@^1.4.9
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_290_T5D
|
||||
-DEINK_WIDTH=296
|
||||
-DEINK_HEIGHT=128
|
||||
debug_tool = jlink
|
||||
;upload_port = /dev/ttyACM4
|
||||
|
||||
@@ -16,9 +16,9 @@ build_flags = ${esp32_base.build_flags}
|
||||
;-DPRIVATE_HW
|
||||
-Ivariants/esp32-s3-pico
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DTECHO_DISPLAY_MODEL=GxEPD2_290_T94_V2
|
||||
-DEPD_HEIGHT=128
|
||||
-DEPD_WIDTH=296
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_290_T94_V2
|
||||
-DEINK_WIDTH=296
|
||||
-DEINK_HEIGHT=128
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
zinggjm/GxEPD2@^1.5.3
|
||||
|
||||
@@ -74,4 +74,4 @@
|
||||
#define PIN_EINK_DC 33
|
||||
#define PIN_EINK_RES 42 // 37 //(-1) // cant be MISO Waveshare ??)
|
||||
#define PIN_EINK_SCLK 35
|
||||
#define PIN_EINK_MOSI 36
|
||||
#define PIN_EINK_MOSI 36
|
||||
@@ -2,7 +2,12 @@
|
||||
extends = esp32s3_base
|
||||
board = heltec_wifi_lora_32_V3
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags} -D HELTEC_WIRELESS_PAPER -I variants/heltec_wireless_paper
|
||||
${esp32s3_base.build_flags}
|
||||
-I variants/heltec_wireless_paper
|
||||
-D HELTEC_WIRELESS_PAPER
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_FC1
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/ixt/GxEPD2#39f325b677713eb04dfcc83b8e402e77523fb8bf
|
||||
|
||||
@@ -5,6 +5,9 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-I variants/heltec_wireless_paper_v1
|
||||
-D HELTEC_WIRELESS_PAPER_V1_0
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2/
|
||||
|
||||
@@ -6,13 +6,6 @@
|
||||
|
||||
#define USE_EINK
|
||||
|
||||
// Settings for Dynamic Refresh mode
|
||||
// Change between full-refresh, fast-refresh, or update-skipping, to balance urgency and display health.
|
||||
#define USE_EINK_DYNAMIC_REFRESH
|
||||
#define EINK_LOWPRIORITY_LIMIT_SECONDS 30
|
||||
#define EINK_HIGHPRIORITY_LIMIT_SECONDS 1
|
||||
#define EINK_FASTREFRESH_REPEAT_LIMIT 5
|
||||
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
|
||||
@@ -9,8 +9,9 @@ build_flags =
|
||||
;-D RADIOLIB_VERBOSE
|
||||
-Ofast
|
||||
-D__MCUXPRESSO
|
||||
-DEPD_HEIGHT=200
|
||||
-DEPD_WIDTH=200
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_154_M09
|
||||
-DEINK_WIDTH=200
|
||||
-DEINK_HEIGHT=200
|
||||
-DUSER_SETUP_LOADED
|
||||
-DM5_COREINK
|
||||
-DM5STACK
|
||||
|
||||
@@ -19,9 +19,9 @@ build_flags =
|
||||
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink
|
||||
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_eink
|
||||
-Dmy
|
||||
-DTECHO_DISPLAY_MODEL=GxEPD2_290_T5D
|
||||
-DEPD_HEIGHT=128
|
||||
-DEPD_WIDTH=296
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_290_T5D
|
||||
-DEINK_WIDTH=296
|
||||
-DEINK_HEIGHT=128
|
||||
-DBOARD_HAS_PSRAM
|
||||
-mfix-esp32-psram-cache-issue
|
||||
-DARDUINO_USB_MODE=0
|
||||
|
||||
@@ -53,4 +53,4 @@
|
||||
#define PIN_EINK_DC 1
|
||||
#define PIN_EINK_RES (-1)
|
||||
#define PIN_EINK_SCLK 5
|
||||
#define PIN_EINK_MOSI 6
|
||||
#define PIN_EINK_MOSI 6
|
||||
@@ -5,6 +5,9 @@ board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak10701 -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak10701> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -202,13 +202,13 @@ static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT
|
||||
|
||||
/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ )
|
||||
|
||||
P1.10 NSS SPI NSS (Arduino GPIO number 42)
|
||||
P1.11 SCK SPI CLK (Arduino GPIO number 43)
|
||||
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
|
||||
P1.13 MISO SPI MISO (Arduino GPIO number 45)
|
||||
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
|
||||
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
|
||||
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
|
||||
P1.10 NSS SPI NSS (Arduino GPIO number 42)
|
||||
P1.11 SCK SPI CLK (Arduino GPIO number 43)
|
||||
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
|
||||
P1.13 MISO SPI MISO (Arduino GPIO number 45)
|
||||
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
|
||||
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
|
||||
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
|
||||
|
||||
Important for successful SX1262 initialization:
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -181,13 +181,13 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ )
|
||||
|
||||
P1.10 NSS SPI NSS (Arduino GPIO number 42)
|
||||
P1.11 SCK SPI CLK (Arduino GPIO number 43)
|
||||
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
|
||||
P1.13 MISO SPI MISO (Arduino GPIO number 45)
|
||||
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
|
||||
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
|
||||
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
|
||||
P1.10 NSS SPI NSS (Arduino GPIO number 42)
|
||||
P1.11 SCK SPI CLK (Arduino GPIO number 43)
|
||||
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
|
||||
P1.13 MISO SPI MISO (Arduino GPIO number 45)
|
||||
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
|
||||
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
|
||||
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
|
||||
|
||||
Important for successful SX1262 initialization:
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -6,6 +6,9 @@ board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D PIN_EINK_EN=34
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper_onrxtx>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -8,6 +8,9 @@ debug_tool = jlink
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo
|
||||
-DGPS_POWER_TOGGLE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||
-DEINK_WIDTH=200
|
||||
-DEINK_HEIGHT=200
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/t-echo>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
Reference in New Issue
Block a user