Added default temperature from ESP32 MCU and NRF52 MCU

Added NRF52Board.h and NRF52Board.cpp
Modified NRF52 variants to extend from NRF52Board to share common feature
This commit is contained in:
Kevin Le
2025-12-12 19:01:15 +07:00
parent 9bba417ebc
commit 4504ad4daf
24 changed files with 86 additions and 19 deletions

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifdef HELTEC_MESH_SOLAR
#include "meshSolarApp.h"
@@ -20,7 +21,7 @@
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
class MeshSolarBoard : public mesh::MainBoard {
class MeshSolarBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,13 +2,14 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// built-ins
#define PIN_VBAT_READ 4
#define PIN_BAT_CTL 6
#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range
class T114Board : public mesh::MainBoard {
class T114Board : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,10 +2,11 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifdef XIAO_NRF52
class IkokaNanoNRFBoard : public mesh::MainBoard {
class IkokaNanoNRFBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,10 +2,11 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifdef XIAO_NRF52
class IkokaStickNRFBoard : public mesh::MainBoard {
class IkokaStickNRFBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,8 +2,9 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
class KeepteenLT1Board : public mesh::MainBoard {
class KeepteenLT1Board : public NRF52Board {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// built-ins
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
@@ -12,7 +13,7 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
class TechoBoard : public mesh::MainBoard {
class TechoBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// built-ins
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
@@ -12,7 +13,7 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
class TechoBoard : public mesh::MainBoard {
class TechoBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,13 +2,14 @@
#include <Arduino.h>
#include <MeshCore.h>
#include <helpers/NRF52Board.h>
// built-ins
#define PIN_VBAT_READ 29
#define PIN_BAT_CTL 34
#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range
class HeltecMeshPocket : public mesh::MainBoard {
class HeltecMeshPocket : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// LoRa and SPI pins
@@ -20,7 +21,7 @@
#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking
class MinewsemiME25LS01Board : public mesh::MainBoard {
class MinewsemiME25LS01Board : public NRF52Board {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;

View File

@@ -4,6 +4,7 @@
#include <Arduino.h>
#include <MeshCore.h>
#include <helpers/NRF52Board.h>
// LoRa radio module pins
#define P_LORA_DIO_1 (32 + 10)
@@ -34,7 +35,7 @@
#define PIN_VBAT_READ (0 + 2)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
class NanoG2Ultra : public mesh::MainBoard {
class NanoG2Ultra : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#define P_LORA_NSS 13 //P1.13 45
#define P_LORA_DIO_1 11 //P0.10 10
@@ -19,7 +20,7 @@
#define PIN_VBAT_READ 17
#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking
class PromicroBoard : public mesh::MainBoard {
class PromicroBoard : public NRF52Board {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// LoRa radio module pins for RAK4631
#define P_LORA_DIO_1 47
@@ -28,7 +29,7 @@
#define PIN_VBAT_READ 5
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)
class RAK4631Board : public mesh::MainBoard {
class RAK4631Board : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,12 +2,13 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// built-ins
#define PIN_VBAT_READ 5
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)
class RAKWismeshTagBoard : public mesh::MainBoard {
class RAKWismeshTagBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,8 +2,9 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
class SenseCapSolarBoard : public mesh::MainBoard {
class SenseCapSolarBoard : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,8 +2,9 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
class T1000eBoard : public mesh::MainBoard {
class T1000eBoard : public NRF52Board {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
// built-ins
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
@@ -12,7 +13,7 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
class ThinkNodeM1Board : public mesh::MainBoard {
class ThinkNodeM1Board : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,8 +2,9 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
class WioTrackerL1Board : public mesh::MainBoard {
class WioTrackerL1Board : public NRF52Board {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;

View File

@@ -2,6 +2,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifdef WIO_WM1110
@@ -10,7 +11,7 @@
#endif
#define Serial Serial1
class WioWM1110Board : public mesh::MainBoard {
class WioWM1110Board : public NRF52Board {
protected:
uint8_t startup_reason;

View File

@@ -2,10 +2,11 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifdef XIAO_NRF52
class XiaoNrf52Board : public mesh::MainBoard {
class XiaoNrf52Board : public NRF52Board {
protected:
uint8_t startup_reason;