mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 11:39:32 +00:00
Compare commits
10 Commits
1cea037c47
...
f87f0248fe
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f87f0248fe | ||
![]() |
bd3cbfc1ad | ||
![]() |
fddc4e00ca | ||
![]() |
5f7eec5504 | ||
![]() |
6b94c297b9 | ||
![]() |
edeb25cab5 | ||
![]() |
b2e1dbcca8 | ||
![]() |
5524ce1d97 | ||
![]() |
0991296b68 | ||
![]() |
848243004a |
@ -9,14 +9,14 @@ plugins:
|
|||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- checkov@3.2.467
|
- checkov@3.2.467
|
||||||
- renovate@41.88.0
|
- renovate@41.90.1
|
||||||
- prettier@3.6.2
|
- prettier@3.6.2
|
||||||
- trufflehog@3.90.5
|
- trufflehog@3.90.5
|
||||||
- yamllint@1.37.1
|
- yamllint@1.37.1
|
||||||
- bandit@1.8.6
|
- bandit@1.8.6
|
||||||
- trivy@0.65.0
|
- trivy@0.65.0
|
||||||
- taplo@0.10.0
|
- taplo@0.10.0
|
||||||
- ruff@0.12.10
|
- ruff@0.12.11
|
||||||
- isort@6.0.1
|
- isort@6.0.1
|
||||||
- markdownlint@0.45.0
|
- markdownlint@0.45.0
|
||||||
- oxipng@9.1.5
|
- oxipng@9.1.5
|
||||||
|
@ -87,6 +87,9 @@
|
|||||||
</screenshots>
|
</screenshots>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="2.7.8" date="2025-08-30">
|
||||||
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.8</url>
|
||||||
|
</release>
|
||||||
<release version="2.7.7" date="2025-08-28">
|
<release version="2.7.7" date="2025-08-28">
|
||||||
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.7</url>
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.7</url>
|
||||||
</release>
|
</release>
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
meshtasticd (2.7.7.0) UNRELEASED; urgency=medium
|
meshtasticd (2.7.8.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
[ Austin Lane ]
|
[ Austin Lane ]
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
@ -41,4 +41,7 @@ meshtasticd (2.7.7.0) UNRELEASED; urgency=medium
|
|||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- Ubuntu <github-actions[bot]@users.noreply.github.com> Thu, 28 Aug 2025 10:33:25 +0000
|
[ ]
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
-- <github-actions[bot]@users.noreply.github.com> Sat, 30 Aug 2025 00:26:04 +0000
|
||||||
|
@ -128,6 +128,7 @@ RAK9154Sensor rak9154Sensor;
|
|||||||
#ifdef HAS_PPM
|
#ifdef HAS_PPM
|
||||||
// note: XPOWERS_CHIP_XXX must be defined in variant.h
|
// note: XPOWERS_CHIP_XXX must be defined in variant.h
|
||||||
#include <XPowersLib.h>
|
#include <XPowersLib.h>
|
||||||
|
XPowersPPM *PPM = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BQ27220
|
#ifdef HAS_BQ27220
|
||||||
@ -681,7 +682,7 @@ bool Power::setup()
|
|||||||
found = true;
|
found = true;
|
||||||
} else if (lipoChargerInit()) {
|
} else if (lipoChargerInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (meshSolarInit()) {
|
} else if (meshSolarInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (analogInit()) {
|
} else if (analogInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -745,7 +746,11 @@ void Power::shutdown()
|
|||||||
|
|
||||||
#if HAS_SCREEN
|
#if HAS_SCREEN
|
||||||
if (screen) {
|
if (screen) {
|
||||||
|
#ifdef T_DECK_PRO
|
||||||
|
screen->showSimpleBanner("Device is powered off.\nConnect USB to start!", 0); // T-Deck Pro has no power button
|
||||||
|
#else
|
||||||
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen
|
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
@ -763,7 +768,7 @@ void Power::shutdown()
|
|||||||
#ifdef PIN_LED3
|
#ifdef PIN_LED3
|
||||||
ledOff(PIN_LED3);
|
ledOff(PIN_LED3);
|
||||||
#endif
|
#endif
|
||||||
doDeepSleep(DELAY_FOREVER, false, true);
|
doDeepSleep(DELAY_FOREVER, true, true);
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#elif defined(ARCH_PORTDUINO)
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
#else
|
#else
|
||||||
@ -1320,7 +1325,6 @@ bool Power::lipoInit()
|
|||||||
class LipoCharger : public HasBatteryLevel
|
class LipoCharger : public HasBatteryLevel
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
XPowersPPM *ppm = nullptr;
|
|
||||||
BQ27220 *bq = nullptr;
|
BQ27220 *bq = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -1329,41 +1333,41 @@ class LipoCharger : public HasBatteryLevel
|
|||||||
*/
|
*/
|
||||||
bool runOnce()
|
bool runOnce()
|
||||||
{
|
{
|
||||||
if (ppm == nullptr) {
|
if (PPM == nullptr) {
|
||||||
ppm = new XPowersPPM;
|
PPM = new XPowersPPM;
|
||||||
bool result = ppm->init(Wire, I2C_SDA, I2C_SCL, BQ25896_ADDR);
|
bool result = PPM->init(Wire, I2C_SDA, I2C_SCL, BQ25896_ADDR);
|
||||||
if (result) {
|
if (result) {
|
||||||
LOG_INFO("PPM BQ25896 init succeeded");
|
LOG_INFO("PPM BQ25896 init succeeded");
|
||||||
// Set the minimum operating voltage. Below this voltage, the PPM will protect
|
// Set the minimum operating voltage. Below this voltage, the PPM will protect
|
||||||
// ppm->setSysPowerDownVoltage(3100);
|
// PPM->setSysPowerDownVoltage(3100);
|
||||||
|
|
||||||
// Set input current limit, default is 500mA
|
// Set input current limit, default is 500mA
|
||||||
// ppm->setInputCurrentLimit(800);
|
// PPM->setInputCurrentLimit(800);
|
||||||
|
|
||||||
// Disable current limit pin
|
// Disable current limit pin
|
||||||
// ppm->disableCurrentLimitPin();
|
// PPM->disableCurrentLimitPin();
|
||||||
|
|
||||||
// Set the charging target voltage, Range:3840 ~ 4608mV ,step:16 mV
|
// Set the charging target voltage, Range:3840 ~ 4608mV ,step:16 mV
|
||||||
ppm->setChargeTargetVoltage(4288);
|
PPM->setChargeTargetVoltage(4288);
|
||||||
|
|
||||||
// Set the precharge current , Range: 64mA ~ 1024mA ,step:64mA
|
// Set the precharge current , Range: 64mA ~ 1024mA ,step:64mA
|
||||||
// ppm->setPrechargeCurr(64);
|
// PPM->setPrechargeCurr(64);
|
||||||
|
|
||||||
// The premise is that limit pin is disabled, or it will
|
// The premise is that limit pin is disabled, or it will
|
||||||
// only follow the maximum charging current set by limit pin.
|
// only follow the maximum charging current set by limit pin.
|
||||||
// Set the charging current , Range:0~5056mA ,step:64mA
|
// Set the charging current , Range:0~5056mA ,step:64mA
|
||||||
ppm->setChargerConstantCurr(1024);
|
PPM->setChargerConstantCurr(1024);
|
||||||
|
|
||||||
// To obtain voltage data, the ADC must be enabled first
|
// To obtain voltage data, the ADC must be enabled first
|
||||||
ppm->enableMeasure();
|
PPM->enableMeasure();
|
||||||
|
|
||||||
// Turn on charging function
|
// Turn on charging function
|
||||||
// If there is no battery connected, do not turn on the charging function
|
// If there is no battery connected, do not turn on the charging function
|
||||||
ppm->enableCharge();
|
PPM->enableCharge();
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("PPM BQ25896 init failed");
|
LOG_WARN("PPM BQ25896 init failed");
|
||||||
delete ppm;
|
delete PPM;
|
||||||
ppm = nullptr;
|
PPM = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1404,23 +1408,23 @@ class LipoCharger : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* return true if there is a battery installed in this unit
|
* return true if there is a battery installed in this unit
|
||||||
*/
|
*/
|
||||||
virtual bool isBatteryConnect() override { return ppm->getBattVoltage() > 0; }
|
virtual bool isBatteryConnect() override { return PPM->getBattVoltage() > 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if there is an external power source detected
|
* return true if there is an external power source detected
|
||||||
*/
|
*/
|
||||||
virtual bool isVbusIn() override { return ppm->getVbusVoltage() > 0; }
|
virtual bool isVbusIn() override { return PPM->getVbusVoltage() > 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if the battery is currently charging
|
* return true if the battery is currently charging
|
||||||
*/
|
*/
|
||||||
virtual bool isCharging() override
|
virtual bool isCharging() override
|
||||||
{
|
{
|
||||||
bool isCharging = ppm->isCharging();
|
bool isCharging = PPM->isCharging();
|
||||||
if (isCharging) {
|
if (isCharging) {
|
||||||
LOG_DEBUG("BQ27220 time to full charge: %d min", bq->getTimeToFull());
|
LOG_DEBUG("BQ27220 time to full charge: %d min", bq->getTimeToFull());
|
||||||
} else {
|
} else {
|
||||||
if (!ppm->isVbusIn()) {
|
if (!PPM->isVbusIn()) {
|
||||||
LOG_DEBUG("BQ27220 time to empty: %d min (%d mAh)", bq->getTimeToEmpty(), bq->getRemainingCapacity());
|
LOG_DEBUG("BQ27220 time to empty: %d min (%d mAh)", bq->getTimeToEmpty(), bq->getRemainingCapacity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1453,8 +1457,6 @@ bool Power::lipoChargerInit()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HELTEC_MESH_SOLAR
|
#ifdef HELTEC_MESH_SOLAR
|
||||||
#include "meshSolarApp.h"
|
#include "meshSolarApp.h"
|
||||||
|
|
||||||
@ -1492,7 +1494,7 @@ class meshSolarBatteryLevel : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* return true if there is an external power source detected
|
* return true if there is an external power source detected
|
||||||
*/
|
*/
|
||||||
virtual bool isVbusIn() override { return meshSolarIsVbusIn();}
|
virtual bool isVbusIn() override { return meshSolarIsVbusIn(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if the battery is currently charging
|
* return true if the battery is currently charging
|
||||||
|
@ -26,10 +26,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#ifdef RV3028_RTC
|
#if __has_include("Melopero_RV3028.h")
|
||||||
#include "Melopero_RV3028.h"
|
#include "Melopero_RV3028.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef PCF8563_RTC
|
#if __has_include("pcf8563.h")
|
||||||
#include "pcf8563.h"
|
#include "pcf8563.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ RTCSetResult readFromRTC()
|
|||||||
|
|
||||||
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
||||||
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
timeStartMsec = now;
|
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
timeStartMsec = now;
|
||||||
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
}
|
}
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
@ -94,9 +94,9 @@ RTCSetResult readFromRTC()
|
|||||||
|
|
||||||
LOG_DEBUG("Read RTC time from PCF8563 getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
LOG_DEBUG("Read RTC time from PCF8563 getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
||||||
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
timeStartMsec = now;
|
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
timeStartMsec = now;
|
||||||
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
}
|
}
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
|
@ -419,7 +419,7 @@ void setup()
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = time(NULL);
|
tv.tv_sec = time(NULL);
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
perhapsSetRTC(RTCQualityNTP, &tv);
|
perhapsSetRTC(RTCQualityDevice, &tv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
powerMonInit();
|
powerMonInit();
|
||||||
|
@ -32,6 +32,16 @@ esp_sleep_source_t wakeCause; // the reason we booted this time
|
|||||||
#endif
|
#endif
|
||||||
#include "Throttle.h"
|
#include "Throttle.h"
|
||||||
|
|
||||||
|
#ifdef USE_XL9555
|
||||||
|
#include "ExtensionIOXL9555.hpp"
|
||||||
|
extern ExtensionIOXL9555 io;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_PPM
|
||||||
|
#include <XPowersLib.h>
|
||||||
|
extern XPowersPPM *PPM;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef INCLUDE_vTaskSuspend
|
#ifndef INCLUDE_vTaskSuspend
|
||||||
#define INCLUDE_vTaskSuspend 0
|
#define INCLUDE_vTaskSuspend 0
|
||||||
#endif
|
#endif
|
||||||
@ -297,6 +307,14 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_PPM
|
||||||
|
if (PPM) {
|
||||||
|
LOG_INFO("PMM shutdown");
|
||||||
|
console->flush();
|
||||||
|
PPM->shutdown();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
if (pmu_found && PMU) {
|
if (pmu_found && PMU) {
|
||||||
// Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep.
|
// Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep.
|
||||||
@ -412,6 +430,16 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
if (pmu_found)
|
if (pmu_found)
|
||||||
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
|
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef T_LORA_PAGER
|
||||||
|
LOG_DEBUG("power down XL9555 io");
|
||||||
|
io.digitalWrite(EXPANDS_DRV_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_AMP_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_KB_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_SD_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_GPIO_EN, LOW);
|
||||||
|
#endif
|
||||||
|
|
||||||
auto res = esp_sleep_enable_gpio_wakeup();
|
auto res = esp_sleep_enable_gpio_wakeup();
|
||||||
if (res != ESP_OK) {
|
if (res != ESP_OK) {
|
||||||
LOG_ERROR("esp_sleep_enable_gpio_wakeup result %d", res);
|
LOG_ERROR("esp_sleep_enable_gpio_wakeup result %d", res);
|
||||||
@ -452,6 +480,14 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
gpio_wakeup_disable((gpio_num_t)RF95_IRQ);
|
gpio_wakeup_disable((gpio_num_t)RF95_IRQ);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef T_LORA_PAGER
|
||||||
|
LOG_DEBUG("power up XL9555 io");
|
||||||
|
io.digitalWrite(EXPANDS_DRV_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_KB_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_SD_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_GPIO_EN, HIGH);
|
||||||
|
#endif
|
||||||
|
|
||||||
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
||||||
notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here
|
notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here
|
||||||
|
@ -3,7 +3,10 @@ extends = portduino_base
|
|||||||
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
|
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
|
||||||
-I /usr/include
|
-I /usr/include
|
||||||
board = cross_platform
|
board = cross_platform
|
||||||
lib_deps = ${portduino_base.lib_deps}
|
lib_deps =
|
||||||
|
${portduino_base.lib_deps}
|
||||||
|
melopero/Melopero RV3028@^1.1.0
|
||||||
|
|
||||||
build_src_filter = ${portduino_base.build_src_filter}
|
build_src_filter = ${portduino_base.build_src_filter}
|
||||||
|
|
||||||
[env:native]
|
[env:native]
|
||||||
|
@ -4,4 +4,7 @@
|
|||||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||||
#define HAS_GPS 1
|
#define HAS_GPS 1
|
||||||
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
||||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
#define MAX_NUM_NODES settingsMap[maxnodes]
|
||||||
|
|
||||||
|
// RAK12002 RTC Module
|
||||||
|
#define RV3028_RTC (uint8_t)0b1010010
|
11
variants/nrf52840/diy/easy-nrf52-promicro_e22/platformio.ini
Normal file
11
variants/nrf52840/diy/easy-nrf52-promicro_e22/platformio.ini
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
; DIY no custom PCB, easy construction node based on Pro Micro Supermini NRF52840 Development Board + E22 900M30S
|
||||||
|
[env:easy-pro_micro_nrf_e22]
|
||||||
|
extends = nrf52840_base
|
||||||
|
board = promicro-nrf52840
|
||||||
|
build_flags = ${nrf52840_base.build_flags}
|
||||||
|
-I variants/nrf52840/diy/easy-nrf52-promicro_e22
|
||||||
|
-D PRIVATE_HW
|
||||||
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants//nrf52840/diy/easy-nrf52-promicro_e22>
|
||||||
|
lib_deps =
|
||||||
|
${nrf52840_base.lib_deps}
|
||||||
|
debug_tool = jlink
|
38
variants/nrf52840/diy/easy-nrf52-promicro_e22/variant.cpp
Normal file
38
variants/nrf52840/diy/easy-nrf52-promicro_e22/variant.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||||
|
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||||
|
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "variant.h"
|
||||||
|
#include "nrf.h"
|
||||||
|
#include "wiring_constants.h"
|
||||||
|
#include "wiring_digital.h"
|
||||||
|
|
||||||
|
const uint32_t g_ADigitalPinMap[] = {
|
||||||
|
// P0
|
||||||
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
|
|
||||||
|
// P1
|
||||||
|
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||||
|
|
||||||
|
void initVariant()
|
||||||
|
{
|
||||||
|
// 3V3 Power Rail
|
||||||
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
|
}
|
192
variants/nrf52840/diy/easy-nrf52-promicro_e22/variant.h
Normal file
192
variants/nrf52840/diy/easy-nrf52-promicro_e22/variant.h
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
A DIY, easy, no PCB, basic but powerful node based on E22 900M33S and
|
||||||
|
Pro Micro compatible NRF52840 dev boards such as the Tenstar Robot
|
||||||
|
Supermini or Nice Nano.
|
||||||
|
|
||||||
|
Without adding GPS or other peripherals, this node should run about 45
|
||||||
|
hours on a 1S 1000 mAh battery.
|
||||||
|
|
||||||
|
This node can be constructed by directly soldering the development
|
||||||
|
board directly to an EBYTE E22 900m30S. There will be 7 directly
|
||||||
|
soldered pads, 3 header pins, and only 1 wire connection required.
|
||||||
|
|
||||||
|
You can power the node via USB or a battery, or you can install a power
|
||||||
|
connector on the GND and VCC pads of the E22; a JST PH or XH socket
|
||||||
|
should fit. It may be easiest to install this first if you want it.
|
||||||
|
|
||||||
|
Note that the E22-900M33S will output near it's specified power level
|
||||||
|
only when supplied with 5-5.5 volts. If you take advantage of the
|
||||||
|
battery charger on the Pro Micro board and power everything from a 1S
|
||||||
|
Lithium battery, the E22-900M33S will output a maximum of about 1
|
||||||
|
Watt.
|
||||||
|
|
||||||
|
Be sure to perform the initial flash of the Meshtastic firmware before
|
||||||
|
proceeding with the assembly to protect the E22 and ensure that the
|
||||||
|
TXEN pad is not driven when it shouldn't be.
|
||||||
|
|
||||||
|
Detailed build instructions can be found here:
|
||||||
|
https://github.com/brad112358/easy_E22?tab=readme-ov-file#easy-diy-e22-nrf52840-build-instructions
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _VARIANT_EASY_PROMICRO_DIY_
|
||||||
|
#define _VARIANT_EASY_PROMICRO_DIY_
|
||||||
|
|
||||||
|
/** Master clock frequency */
|
||||||
|
#define VARIANT_MCK (64000000ul)
|
||||||
|
|
||||||
|
// #define USE_LFXO // Board uses 32khz crystal for LF
|
||||||
|
#define USE_LFRC // Board uses RC for LF
|
||||||
|
|
||||||
|
#define PROMICRO_DIY_TCXO
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------
|
||||||
|
* Headers
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "WVariant.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
/*
|
||||||
|
E22/NRF52 PRO MICRO PIN ASSIGNMENT
|
||||||
|
|
||||||
|
| Pin | Function | | Pin | Function |
|
||||||
|
| ----- | ----------- | --- | -------- | ------------ |
|
||||||
|
| Gnd | | | vbat | |
|
||||||
|
| P0.06 | Serial2 RX | | vbat | |
|
||||||
|
| P0.08 | Serial2 TX | | Gnd | |
|
||||||
|
| Gnd | | | reset | |
|
||||||
|
| Gnd | GND | | ext_vcc | *see 0.13 |
|
||||||
|
| P0.17 | Free pin | | P0.31 | BATTERY_PIN |
|
||||||
|
| P0.20 | Free pin | | P0.29 | DI01 |
|
||||||
|
| P0.22 | Free pin | | P0.02 | BUSY |
|
||||||
|
| P0.24 | Free pin | | P1.15 | NRST |
|
||||||
|
| P1.00 | TXEN | | P1.13 | MISO |
|
||||||
|
| P0.11 | RXEN | | P1.11 | MOSI |
|
||||||
|
| P1.04 | SDA | | P0.10 | SCK |
|
||||||
|
| P1.06 | SCL | | P0.09 | NSS |
|
||||||
|
| | | | | |
|
||||||
|
| | Mid board | | | Internal |
|
||||||
|
| P1.01 | GPS_TX | | 0.15 | LED |
|
||||||
|
| P1.02 | GPS_RX | | 0.13 | 3V3_EN |
|
||||||
|
| P1.07 | GPS_EN | | | |
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Number of pins defined in PinDescription array
|
||||||
|
#define PINS_COUNT (48)
|
||||||
|
#define NUM_DIGITAL_PINS (48)
|
||||||
|
#define NUM_ANALOG_INPUTS (1)
|
||||||
|
#define NUM_ANALOG_OUTPUTS (0)
|
||||||
|
|
||||||
|
// Pin 13 enables 3.3V periphery.
|
||||||
|
#define PIN_3V3_EN (0 + 13) // P0.13
|
||||||
|
|
||||||
|
// Battery
|
||||||
|
#define BATTERY_PIN (0 + 31) // P0.31
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
||||||
|
#define ADC_RESOLUTION 14
|
||||||
|
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||||
|
#define BATTERY_SENSE_RESOLUTION 4096.0
|
||||||
|
// Definition of milliVolt per LSB => 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
|
||||||
|
#define VBAT_MV_PER_LSB (0.73242188F)
|
||||||
|
// Voltage divider value => 1.5M + 1M voltage divider on VBAT = (1.5M / (1M + 1.5M))
|
||||||
|
#define VBAT_DIVIDER (0.6F)
|
||||||
|
// Compensation factor for the VBAT divider
|
||||||
|
#define VBAT_DIVIDER_COMP (2.02) // 2 + magic for current drain of input
|
||||||
|
// Fixed calculation of milliVolt from compensation value
|
||||||
|
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||||
|
#undef AREF_VOLTAGE
|
||||||
|
#define AREF_VOLTAGE 3.0
|
||||||
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||||
|
#define ADC_MULTIPLIER VBAT_DIVIDER_COMP // REAL_VBAT_MV_PER_LSB
|
||||||
|
#define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x)
|
||||||
|
|
||||||
|
// WIRE IC AND IIC PINS
|
||||||
|
#define WIRE_INTERFACES_COUNT 1
|
||||||
|
|
||||||
|
#define PIN_WIRE_SDA (32 + 4) // P1.04
|
||||||
|
#define PIN_WIRE_SCL (32 + 6) // P1.06
|
||||||
|
|
||||||
|
// LED
|
||||||
|
#define PIN_LED1 (0 + 15) // P0.15
|
||||||
|
#define LED_BUILTIN PIN_LED1
|
||||||
|
// Actually red
|
||||||
|
#define LED_BLUE PIN_LED1
|
||||||
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
|
// Button
|
||||||
|
// #define BUTTON_PIN // no button
|
||||||
|
|
||||||
|
// GPS
|
||||||
|
#define PIN_GPS_TX (32 + 1) // P1.01
|
||||||
|
#define PIN_GPS_RX (32 + 2) // P1.02
|
||||||
|
|
||||||
|
#define PIN_GPS_EN (32 + 7) // P1.07
|
||||||
|
#define GPS_POWER_TOGGLE
|
||||||
|
#define GPS_UBLOX
|
||||||
|
// define GPS_DEBUG
|
||||||
|
|
||||||
|
// UART interfaces
|
||||||
|
#define PIN_SERIAL1_RX PIN_GPS_TX
|
||||||
|
#define PIN_SERIAL1_TX PIN_GPS_RX
|
||||||
|
|
||||||
|
#define PIN_SERIAL2_RX (0 + 6) // P0.06
|
||||||
|
#define PIN_SERIAL2_TX (0 + 8) // P0.08
|
||||||
|
|
||||||
|
// Serial interfaces
|
||||||
|
#define SPI_INTERFACES_COUNT 1
|
||||||
|
|
||||||
|
#define PIN_SPI_MISO (32 + 13) // P1.13
|
||||||
|
#define PIN_SPI_MOSI (32 + 11) // P1.11
|
||||||
|
#define PIN_SPI_SCK (0 + 10) // P0.10
|
||||||
|
|
||||||
|
#define LORA_MISO PIN_SPI_MISO
|
||||||
|
#define LORA_MOSI PIN_SPI_MOSI
|
||||||
|
#define LORA_SCK PIN_SPI_SCK
|
||||||
|
#define LORA_CS (0 + 9) // P0.09 NSS
|
||||||
|
|
||||||
|
// LORA MODULE
|
||||||
|
#define USE_SX1262
|
||||||
|
|
||||||
|
#define LORA_DIO0 (0 + 2) // P0.02 BUSY
|
||||||
|
#define LORA_DIO1 (0 + 29) // P0.29 IRQ
|
||||||
|
#define LORA_RESET (32 + 15) // P1.15 NRST
|
||||||
|
|
||||||
|
// SX126X CONFIG
|
||||||
|
#undef TX_GAIN_LORA
|
||||||
|
#define TX_GAIN_LORA 22 // 8 for E22 900M30S, 25 for 900M33S, 22 for 3.7V battery powered 900M33S, 0 for 900M22S
|
||||||
|
#define SX126X_MAX_POWER 8 // 8 for 900M33S, 22 for 900M30S and 900M22S; defaults to 22 if not defined
|
||||||
|
|
||||||
|
#define SX126X_CS LORA_CS
|
||||||
|
#define SX126X_DIO1 LORA_DIO1
|
||||||
|
#define SX126X_BUSY LORA_DIO0
|
||||||
|
#define SX126X_RESET LORA_RESET
|
||||||
|
#define SX126X_RXEN (0 + 11) // P0.11
|
||||||
|
#define SX126X_TXEN (32 + 0) // P1.00
|
||||||
|
|
||||||
|
/*
|
||||||
|
| Mfr | Module | TCXO | RF Switch | Notes |
|
||||||
|
| ------------ | ---------------- | ---- | --------- | ------------------------------------- |
|
||||||
|
| Ebyte | E22-900M22S | Yes | Ext | |
|
||||||
|
| Ebyte | E22-900M30S | Yes | Ext | |
|
||||||
|
| Ebyte | E22-900M33S | Yes | Ext | MAX_POWER must be set to 8 for this! |
|
||||||
|
|
||||||
|
On the SX1262, DIO3 sets the voltage for an external TCXO, if one is present. If one is not present, use TCXO_OPTIONAL to try both
|
||||||
|
settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------
|
||||||
|
* Arduino objects - C++ only
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#endif
|
@ -208,7 +208,7 @@ No longer populated on PCB
|
|||||||
#undef AREF_VOLTAGE
|
#undef AREF_VOLTAGE
|
||||||
#define AREF_VOLTAGE 3.0
|
#define AREF_VOLTAGE 3.0
|
||||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||||
#define ADC_MULTIPLIER (4.90F)
|
#define ADC_MULTIPLIER (4.99F)
|
||||||
|
|
||||||
#define HAS_RTC 0
|
#define HAS_RTC 0
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 7
|
minor = 7
|
||||||
build = 7
|
build = 8
|
||||||
|
Loading…
Reference in New Issue
Block a user