mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-15 09:45:06 +00:00
WIP LoRAType
This commit is contained in:
parent
2c625f6ba1
commit
54240c0d87
@ -7,9 +7,9 @@
|
||||
#include "main.h"
|
||||
#include <SPI.h>
|
||||
|
||||
// #ifdef HELTEC_WIRELESS_PAPER
|
||||
// SPIClass *hspi = NULL;
|
||||
// #endif
|
||||
#if defined(HELTEC_WIRELESS_PAPER)// || defined(LORA_TYPE)
|
||||
SPIClass *hspi = NULL;
|
||||
#endif
|
||||
|
||||
#define COLORED GxEPD_BLACK
|
||||
#define UNCOLORED GxEPD_WHITE
|
||||
@ -40,6 +40,10 @@
|
||||
// 4.2 inch 300x400 - GxEPD2_420_M01
|
||||
#define TECHO_DISPLAY_MODEL GxEPD2_420_M01
|
||||
|
||||
#elif defined(LORA_TYPE)
|
||||
// 1.54 inch 200x200 - GxEPD2_154_M09
|
||||
#define TECHO_DISPLAY_MODEL GxEPD2_154_GDEY0154D67
|
||||
|
||||
#elif defined(M5_COREINK)
|
||||
// M5Stack CoreInk
|
||||
// 1.54 inch 200x200 - GxEPD2_154_M09
|
||||
@ -146,7 +150,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
||||
// 4.2 inch 300x400 - GxEPD2_420_M01
|
||||
adafruitDisplay->nextPage();
|
||||
|
||||
#elif defined(PCA10059) || defined(M5_COREINK)
|
||||
#elif defined(PCA10059) || defined(M5_COREINK) || defined(LORA_TYPE)
|
||||
adafruitDisplay->nextPage();
|
||||
|
||||
#elif defined(PRIVATE_HW) || defined(my)
|
||||
@ -247,6 +251,12 @@ bool EInkDisplay::connect()
|
||||
adafruitDisplay->setRotation(3);
|
||||
adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight);
|
||||
}
|
||||
#elif defined(LORA_TYPE)
|
||||
auto lowLevel = new TECHO_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY);
|
||||
adafruitDisplay = new GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT>(*lowLevel);
|
||||
adafruitDisplay->init(115200, true, 40, false, SPI, SPISettings(4000000, MSBFIRST, SPI_MODE0));
|
||||
adafruitDisplay->setRotation(3);
|
||||
adafruitDisplay->setPartialWindow(0, 0, EPD_WIDTH, EPD_HEIGHT);
|
||||
#elif defined(M5_COREINK)
|
||||
auto lowLevel = new TECHO_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY);
|
||||
adafruitDisplay = new GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT>(*lowLevel);
|
||||
|
10
src/main.cpp
10
src/main.cpp
@ -615,9 +615,14 @@ void setup()
|
||||
SPI.begin();
|
||||
#else
|
||||
// ESP32
|
||||
#ifdef LORA_TYPE
|
||||
SPI.begin(PIN_EINK_SCLK, 15, PIN_EINK_MOSI, PIN_EINK_CS);
|
||||
#else
|
||||
SPI.begin(RF95_SCK, RF95_MISO, RF95_MOSI, RF95_NSS);
|
||||
#endif
|
||||
LOG_WARN("SPI.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)\n", RF95_SCK, RF95_MISO, RF95_MOSI, RF95_NSS);
|
||||
SPI.setFrequency(4000000);
|
||||
|
||||
#endif
|
||||
|
||||
// Initialize the screen first so we can show the logo while we start up everything else.
|
||||
@ -661,8 +666,13 @@ void setup()
|
||||
digitalWrite(SX126X_ANT_SW, 1);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HW_SPI1_DEVICE
|
||||
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI1, spiSettings);
|
||||
#elif LORA_TYPE
|
||||
SPIClass radioSPI(VSPI);
|
||||
radioSPI.begin(RF95_SCK, RF95_MISO, RF95_MOSI, RF95_NSS);
|
||||
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(radioSPI, spiSettings);
|
||||
#else // HW_SPI1_DEVICE
|
||||
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
|
||||
#endif
|
||||
|
@ -121,6 +121,8 @@
|
||||
#define HW_VENDOR meshtastic_HardwareModel_PICOMPUTER_S3
|
||||
#elif defined(HELTEC_HT62)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_HT62
|
||||
#elif defined(LORA_TYPE)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_LORA_TYPE
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
15
variants/lora_type/platformio.ini
Normal file
15
variants/lora_type/platformio.ini
Normal file
@ -0,0 +1,15 @@
|
||||
[env:lora_type]
|
||||
extends = esp32_base
|
||||
board = esp32doit-devkit-v1
|
||||
board_level = extra
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-DLORA_TYPE
|
||||
-DEBYTE_E22
|
||||
-Ivariants/lora_type
|
||||
-DEPD_HEIGHT=200
|
||||
-DEPD_WIDTH=200
|
||||
-DM5_COREINK
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
zinggjm/GxEPD2@^1.4.9
|
37
variants/lora_type/variant.h
Normal file
37
variants/lora_type/variant.h
Normal file
@ -0,0 +1,37 @@
|
||||
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||
#define ADC_MULTIPLIER 2.0 // (R1 = 27k, R2 = 100k)
|
||||
#define LED_PIN 33 // add status LED (compatible with core-pcb and DIY targets)
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262/SX1268 module
|
||||
#define LORA_RESET 16 // RST for SX1276, and for SX1262/SX1268
|
||||
#define LORA_DIO1 4 // IRQ for SX1262/SX1268
|
||||
#define LORA_DIO2 26 // BUSY for SX1262/SX1268
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#define RF95_SCK 18
|
||||
#define RF95_MISO 19
|
||||
#define RF95_MOSI 23
|
||||
#define RF95_NSS 5
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#define SX126X_CS 5 // NSS for SX126X
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_RXEN 25
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define USE_EINK
|
||||
#define PIN_EINK_EN -1 // N/C
|
||||
#define PIN_EINK_CS 15 // EPD_CS
|
||||
#define PIN_EINK_BUSY 27 // EPD_BUSY
|
||||
#define PIN_EINK_DC 12 // EPD_D/C
|
||||
#define PIN_EINK_RES 32 // Connected but not needed
|
||||
#define PIN_EINK_SCLK 14 // EPD_SCLK
|
||||
#define PIN_EINK_MOSI 13 // GxEPD2_EPDEPD_MOSI
|
Loading…
Reference in New Issue
Block a user