mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-08-07 17:32:47 +02:00
feat: heltec wireless stick lite board
This commit is contained in:
+4
-5
@@ -88,8 +88,7 @@ board = heltec_wifi_lora_32_V3
|
||||
board_build.mcu = esp32s3
|
||||
build_flags = -Werror -Wall -DHELTEC_WS -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
|
||||
|
||||
;[env:heltec_wireless_stick_lite]
|
||||
;board = heltec_wireless_stick_lite
|
||||
;board_build.mcu = esp32c3
|
||||
;board_build.f_cpu = 240000000L
|
||||
;build_flags = -Werror -Wall -DHELTEC_WSL -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
|
||||
[env:heltec_wireless_stick_lite]
|
||||
board = heltec_wireless_stick_lite
|
||||
board_build.mcu = esp32c3
|
||||
build_flags = -Werror -Wall -DHELTEC_WSL -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
|
||||
@@ -5,11 +5,14 @@
|
||||
#include "pins_config.h"
|
||||
#include "display.h"
|
||||
|
||||
#ifdef HAS_DISPLAY
|
||||
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
|
||||
#endif
|
||||
|
||||
extern Configuration Config;
|
||||
|
||||
void setup_display() {
|
||||
#ifdef HAS_DISPLAY
|
||||
Wire.begin(OLED_SDA, OLED_SCL);
|
||||
|
||||
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
|
||||
@@ -27,17 +30,21 @@ void setup_display() {
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
void display_toggle(bool toggle) {
|
||||
#ifdef HAS_DISPLAY
|
||||
if (toggle) {
|
||||
display.ssd1306_command(SSD1306_DISPLAYON);
|
||||
} else {
|
||||
display.ssd1306_command(SSD1306_DISPLAYOFF);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -47,9 +54,11 @@ void show_display(String line1, int wait) {
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -61,9 +70,11 @@ void show_display(String line1, String line2, int wait) {
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, String line3, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -77,9 +88,11 @@ void show_display(String line1, String line2, String line3, int wait) {
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, String line3, String line4, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -95,9 +108,11 @@ void show_display(String line1, String line2, String line3, String line4, int wa
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, String line3, String line4, String line5, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -115,9 +130,11 @@ void show_display(String line1, String line2, String line3, String line4, String
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, String line3, String line4, String line5, String line6, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(1);
|
||||
@@ -137,9 +154,11 @@ void show_display(String line1, String line2, String line3, String line4, String
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, int wait) {
|
||||
#ifdef HAS_DISPLAY
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
display.setTextSize(2);
|
||||
@@ -162,4 +181,5 @@ void show_display(String line1, String line2, String line3, String line4, String
|
||||
display.ssd1306_command(1);
|
||||
display.display();
|
||||
delay(wait);
|
||||
#endif
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
extern Configuration Config;
|
||||
|
||||
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(HELTEC_WSL)
|
||||
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
bool transmissionFlag = true;
|
||||
bool enableInterrupt = true;
|
||||
|
||||
+15
-1
@@ -7,7 +7,7 @@
|
||||
#undef OLED_SCL
|
||||
#undef OLED_RST
|
||||
|
||||
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom)
|
||||
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom) || defined(HELTEC_WSL)
|
||||
#define HAS_SX126X
|
||||
#endif
|
||||
|
||||
@@ -79,6 +79,16 @@
|
||||
#define RADIO_TXEN 13
|
||||
#endif
|
||||
|
||||
#ifdef HELTEC_WSL
|
||||
#define RADIO_SCLK_PIN 10 // SX1262 SCK
|
||||
#define RADIO_MISO_PIN 6 // SX1262 MISO
|
||||
#define RADIO_MOSI_PIN 7 // SX1262 MOSI
|
||||
#define RADIO_CS_PIN 8 // SX1262 NSS
|
||||
#define RADIO_RST_PIN 5 // SX1262 RST
|
||||
#define RADIO_DIO1_PIN 3 // SX1262 DIO1
|
||||
#define RADIO_BUSY_PIN 4 // SX1262 BUSY
|
||||
#endif
|
||||
|
||||
|
||||
// OLED
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom)
|
||||
@@ -99,6 +109,10 @@
|
||||
#define OLED_RST 21
|
||||
#endif
|
||||
|
||||
#ifndef HELTEC_WSL
|
||||
#define HAS_DISPLAY
|
||||
#endif
|
||||
|
||||
|
||||
// Leds and other stuff
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(HELTEC_WS) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
|
||||
Reference in New Issue
Block a user