mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #723 from recrof/heltec_t114_refactor
tidy up heltec_t114 variant
This commit is contained in:
commit
a9fef1aefa
7 changed files with 27 additions and 42 deletions
|
|
@ -1,19 +1,17 @@
|
||||||
#include <Arduino.h>
|
|
||||||
#include "T114Board.h"
|
#include "T114Board.h"
|
||||||
|
|
||||||
#include <bluefruit.h>
|
#include <Arduino.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
|
#include <bluefruit.h>
|
||||||
|
|
||||||
static BLEDfu bledfu;
|
static BLEDfu bledfu;
|
||||||
|
|
||||||
static void connect_callback(uint16_t conn_handle)
|
static void connect_callback(uint16_t conn_handle) {
|
||||||
{
|
|
||||||
(void)conn_handle;
|
(void)conn_handle;
|
||||||
MESH_DEBUG_PRINTLN("BLE client connected");
|
MESH_DEBUG_PRINTLN("BLE client connected");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void disconnect_callback(uint16_t conn_handle, uint8_t reason)
|
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
||||||
{
|
|
||||||
(void)conn_handle;
|
(void)conn_handle;
|
||||||
(void)reason;
|
(void)reason;
|
||||||
|
|
||||||
|
|
@ -60,7 +58,7 @@ void T114Board::begin() {
|
||||||
|
|
||||||
// Disable unused analog peripherals
|
// Disable unused analog peripherals
|
||||||
// SAADC channels - only keep what's needed for battery monitoring
|
// SAADC channels - only keep what's needed for battery monitoring
|
||||||
NRF_SAADC->ENABLE = 0; // Re-enable only when needed for measurements
|
NRF_SAADC->ENABLE = 0; // Re-enable only when needed for measurements
|
||||||
|
|
||||||
// COMP - Comparator not used
|
// COMP - Comparator not used
|
||||||
NRF_COMP->ENABLE = 0;
|
NRF_COMP->ENABLE = 0;
|
||||||
|
|
@ -78,10 +76,10 @@ void T114Board::begin() {
|
||||||
|
|
||||||
pinMode(SX126X_POWER_EN, OUTPUT);
|
pinMode(SX126X_POWER_EN, OUTPUT);
|
||||||
digitalWrite(SX126X_POWER_EN, HIGH);
|
digitalWrite(SX126X_POWER_EN, HIGH);
|
||||||
delay(10); // give sx1262 some time to power up
|
delay(10); // give sx1262 some time to power up
|
||||||
}
|
}
|
||||||
|
|
||||||
bool T114Board::startOTAUpdate(const char* id, char reply[]) {
|
bool T114Board::startOTAUpdate(const char *id, char reply[]) {
|
||||||
// Config the peripheral connection with maximum bandwidth
|
// Config the peripheral connection with maximum bandwidth
|
||||||
// more SRAM required by SoftDevice
|
// more SRAM required by SoftDevice
|
||||||
// Note: All config***() function must be called before begin()
|
// Note: All config***() function must be called before begin()
|
||||||
|
|
@ -3,19 +3,6 @@
|
||||||
#include <MeshCore.h>
|
#include <MeshCore.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
// LoRa radio module pins for Heltec T114
|
|
||||||
#define P_LORA_DIO_1 20
|
|
||||||
#define P_LORA_NSS 24
|
|
||||||
#define P_LORA_RESET 25
|
|
||||||
#define P_LORA_BUSY 17
|
|
||||||
#define P_LORA_SCLK 19
|
|
||||||
#define P_LORA_MISO 23
|
|
||||||
#define P_LORA_MOSI 22
|
|
||||||
#define SX126X_POWER_EN 37
|
|
||||||
|
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH true
|
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
|
||||||
|
|
||||||
// built-ins
|
// built-ins
|
||||||
#define PIN_VBAT_READ 4
|
#define PIN_VBAT_READ 4
|
||||||
#define PIN_BAT_CTL 6
|
#define PIN_BAT_CTL 6
|
||||||
|
|
@ -1,40 +1,40 @@
|
||||||
[nrf52840_t114]
|
|
||||||
extends = nrf52_base
|
|
||||||
platform_packages = framework-arduinoadafruitnrf52
|
|
||||||
build_flags = ${nrf52_base.build_flags}
|
|
||||||
-I src/helpers/nrf52
|
|
||||||
-I lib/nrf52/s140_nrf52_6.1.1_API/include
|
|
||||||
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
|
|
||||||
lib_deps =
|
|
||||||
${nrf52_base.lib_deps}
|
|
||||||
rweather/Crypto @ ^0.4.0
|
|
||||||
|
|
||||||
[Heltec_t114]
|
[Heltec_t114]
|
||||||
extends = nrf52840_t114
|
extends = nrf52_base
|
||||||
board = heltec_t114
|
board = heltec_t114
|
||||||
board_build.ldscript = boards/nrf52840_s140_v6.ld
|
board_build.ldscript = boards/nrf52840_s140_v6.ld
|
||||||
build_flags = ${nrf52840_t114.build_flags}
|
build_flags = ${nrf52_base.build_flags}
|
||||||
-I variants/t114
|
-I lib/nrf52/s140_nrf52_6.1.1_API/include
|
||||||
|
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
|
||||||
|
-I variants/heltec_t114
|
||||||
-I src/helpers/ui
|
-I src/helpers/ui
|
||||||
-DHELTEC_T114
|
-D HELTEC_T114
|
||||||
|
-D P_LORA_DIO_1=20
|
||||||
|
-D P_LORA_NSS=24
|
||||||
|
-D P_LORA_RESET=25
|
||||||
|
-D P_LORA_BUSY=17
|
||||||
|
-D P_LORA_SCLK=19
|
||||||
|
-D P_LORA_MISO=23
|
||||||
|
-D P_LORA_MOSI=22
|
||||||
-D P_LORA_TX_LED=35
|
-D P_LORA_TX_LED=35
|
||||||
-D RADIO_CLASS=CustomSX1262
|
-D RADIO_CLASS=CustomSX1262
|
||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||||
-D LORA_TX_POWER=22
|
-D LORA_TX_POWER=22
|
||||||
|
-D SX126X_POWER_EN=37
|
||||||
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
-D ST7789
|
-D ST7789
|
||||||
-D DISPLAY_CLASS=ST7789Display
|
-D DISPLAY_CLASS=ST7789Display
|
||||||
build_src_filter = ${nrf52840_t114.build_src_filter}
|
build_src_filter = ${nrf52_base.build_src_filter}
|
||||||
+<helpers/*.cpp>
|
+<helpers/*.cpp>
|
||||||
+<helpers/nrf52/T114Board.cpp>
|
+<../variants/heltec_t114>
|
||||||
+<../variants/t114>
|
|
||||||
+<helpers/ui/ST7789Display.cpp>
|
+<helpers/ui/ST7789Display.cpp>
|
||||||
+<helpers/ui/MomentaryButton.cpp>
|
+<helpers/ui/MomentaryButton.cpp>
|
||||||
+<helpers/ui/OLEDDisplay.cpp>
|
+<helpers/ui/OLEDDisplay.cpp>
|
||||||
+<helpers/ui/OLEDDisplayFonts.cpp>
|
+<helpers/ui/OLEDDisplayFonts.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_t114.lib_deps}
|
${nrf52_base.lib_deps}
|
||||||
stevemarple/MicroNMEA @ ^2.0.6
|
stevemarple/MicroNMEA @ ^2.0.6
|
||||||
adafruit/Adafruit GFX Library @ ^1.12.1
|
adafruit/Adafruit GFX Library @ ^1.12.1
|
||||||
debug_tool = jlink
|
debug_tool = jlink
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#define RADIOLIB_STATIC_ONLY 1
|
#define RADIOLIB_STATIC_ONLY 1
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||||
#include <helpers/nrf52/T114Board.h>
|
#include <T114Board.h>
|
||||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
#include <helpers/SensorManager.h>
|
#include <helpers/SensorManager.h>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue