mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-19 11:32:06 +00:00
Merge branch 'picomputer-s3' of github.com:meshtastic/firmware into picomputer-s3
This commit is contained in:
commit
2f60bbe5f2
25
.github/workflows/main_matrix.yml
vendored
25
.github/workflows/main_matrix.yml
vendored
@ -33,6 +33,7 @@ jobs:
|
|||||||
- board: m5stack-coreink
|
- board: m5stack-coreink
|
||||||
- board: tbeam-s3-core
|
- board: tbeam-s3-core
|
||||||
- board: tlora-t3s3-v1
|
- board: tlora-t3s3-v1
|
||||||
|
- board: rak11310
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -103,16 +104,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
board: ${{ matrix.board }}
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
# build-rpi2040:
|
build-rpi2040:
|
||||||
# strategy:
|
strategy:
|
||||||
# fail-fast: false
|
fail-fast: false
|
||||||
# max-parallel: 2
|
max-parallel: 2
|
||||||
# matrix:
|
matrix:
|
||||||
# include:
|
include:
|
||||||
# - board: pico
|
- board: pico
|
||||||
# uses: ./.github/workflows/build_rpi2040.yml
|
- board: rak11310
|
||||||
# with:
|
uses: ./.github/workflows/build_rpi2040.yml
|
||||||
# board: ${{ matrix.board }}
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
build-native:
|
build-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -186,7 +188,8 @@ jobs:
|
|||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-esp32, build-esp32-s3, build-nrf52, build-native] #, build-rpi2040]
|
needs:
|
||||||
|
[build-esp32, build-esp32-s3, build-nrf52, build-native, build-rpi2040]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2040_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9f8c10e50b5acd18e7bfd32638199c655be73a5b
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#0c33219f53faa035e188925ea1324f472e8b93d2
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#652f9f9eda0d77efeafebc7c1ff5cd45defc71bf
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
|
40
boards/wiscore_rak11300.json
Normal file
40
boards/wiscore_rak11300.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"earlephilhower": {
|
||||||
|
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||||
|
"usb_vid": "0x2E8A",
|
||||||
|
"usb_pid": "0x000A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"core": "earlephilhower",
|
||||||
|
"cpu": "cortex-m0plus",
|
||||||
|
"extra_flags": "-DARDUINO_GENERIC_RP2040 -DRASPBERRY_PI_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||||
|
"f_cpu": "133000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x2E8A", "0x00C0"],
|
||||||
|
["0x2E8A", "0x000A"]
|
||||||
|
],
|
||||||
|
"mcu": "rp2040",
|
||||||
|
"variant": "WisBlock_RAK11300_Board"
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "RP2040_M0_0",
|
||||||
|
"openocd_target": "rp2040.cfg",
|
||||||
|
"svd_path": "rp2040.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "WisBlock RAK11300",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 270336,
|
||||||
|
"maximum_size": 2097152,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"native_usb": true,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": false,
|
||||||
|
"protocol": "picotool",
|
||||||
|
"protocols": ["cmsis-dap", "raspberrypi-swd", "picotool", "picoprobe"]
|
||||||
|
},
|
||||||
|
"url": "https://docs.rakwireless.com/",
|
||||||
|
"vendor": "RAKwireless"
|
||||||
|
}
|
@ -7,12 +7,12 @@ default_envs = tbeam
|
|||||||
;default_envs = tbeam-s3-core
|
;default_envs = tbeam-s3-core
|
||||||
;default_envs = tbeam0.7
|
;default_envs = tbeam0.7
|
||||||
;default_envs = heltec-v1
|
;default_envs = heltec-v1
|
||||||
;default_envs = heltec-v2.0
|
;default_envs = heltec-v2_0
|
||||||
;default_envs = heltec-v2.1
|
;default_envs = heltec-v2_1
|
||||||
;default_envs = tlora-v1
|
;default_envs = tlora-v1
|
||||||
;default_envs = tlora_v1_3
|
;default_envs = tlora_v1_3
|
||||||
;default_envs = tlora-v2
|
;default_envs = tlora-v2
|
||||||
;default_envs = tlora-v2-1-1.6
|
;default_envs = tlora-v2-1-1_6
|
||||||
;default_envs = tlora-t3s3-v1
|
;default_envs = tlora-t3s3-v1
|
||||||
;default_envs = lora-relay-v1 # nrf board
|
;default_envs = lora-relay-v1 # nrf board
|
||||||
;default_envs = t-echo
|
;default_envs = t-echo
|
||||||
@ -21,7 +21,7 @@ default_envs = tbeam
|
|||||||
;default_envs = nano-g1
|
;default_envs = nano-g1
|
||||||
;default_envs = pca10059_diy_eink
|
;default_envs = pca10059_diy_eink
|
||||||
;default_envs = meshtastic-diy-v1
|
;default_envs = meshtastic-diy-v1
|
||||||
;default_envs = meshtastic-diy-v1.1
|
;default_envs = meshtastic-diy-v1_1
|
||||||
;default_envs = meshtastic-dr-dev
|
;default_envs = meshtastic-dr-dev
|
||||||
;default_envs = m5stack-coreink
|
;default_envs = m5stack-coreink
|
||||||
;default_envs = rak4631
|
;default_envs = rak4631
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 345b3bf103237503459457ac2b74f4fedf2db102
|
Subproject commit d7327c3de2a1dbd9ebb90864c703f97c673a4fc7
|
109
src/Power.cpp
109
src/Power.cpp
@ -6,6 +6,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
static const char *TAG = "ADCmod";
|
||||||
|
|
||||||
#ifdef DEBUG_HEAP_MQTT
|
#ifdef DEBUG_HEAP_MQTT
|
||||||
#include "mqtt/MQTT.h"
|
#include "mqtt/MQTT.h"
|
||||||
@ -17,6 +18,23 @@
|
|||||||
#define DELAY_FOREVER portMAX_DELAY
|
#define DELAY_FOREVER portMAX_DELAY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(BATTERY_PIN) && defined(ARCH_ESP32)
|
||||||
|
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1 is default
|
||||||
|
static const adc1_channel_t adc_channel = ADC_CHANNEL;
|
||||||
|
static const adc_unit_t unit = ADC_UNIT_1;
|
||||||
|
#else // ADC2
|
||||||
|
static const adc2_channel_t adc_channel = ADC_CHANNEL;
|
||||||
|
static const adc_unit_t unit = ADC_UNIT_2;
|
||||||
|
RTC_NOINIT_ATTR uint64_t RTC_reg_b;
|
||||||
|
|
||||||
|
#endif // BAT_MEASURE_ADC_UNIT
|
||||||
|
|
||||||
|
esp_adc_cal_characteristics_t *adc_characs = (esp_adc_cal_characteristics_t *)calloc(1, sizeof(esp_adc_cal_characteristics_t));
|
||||||
|
|
||||||
|
static const adc_atten_t atten = ADC_ATTEN_DB_11;
|
||||||
|
#endif // BATTERY_PIN && ARCH_ESP32
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
#include "XPowersAXP192.tpp"
|
#include "XPowersAXP192.tpp"
|
||||||
#include "XPowersAXP2101.tpp"
|
#include "XPowersAXP2101.tpp"
|
||||||
@ -128,18 +146,41 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
// Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic
|
// Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic
|
||||||
// environment.
|
// environment.
|
||||||
uint32_t raw = 0;
|
uint32_t raw = 0;
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1
|
||||||
|
for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
|
raw += adc1_get_raw(adc_channel);
|
||||||
|
}
|
||||||
|
#else // ADC2
|
||||||
|
int32_t adc_buf = 0;
|
||||||
|
for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
|
// ADC2 wifi bug workaround, see
|
||||||
|
// https://github.com/espressif/arduino-esp32/issues/102
|
||||||
|
WRITE_PERI_REG(SENS_SAR_READ_CTRL2_REG, RTC_reg_b);
|
||||||
|
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DATA_INV);
|
||||||
|
adc2_get_raw(adc_channel, ADC_WIDTH_BIT_12, &adc_buf);
|
||||||
|
raw += adc_buf;
|
||||||
|
}
|
||||||
|
#endif // BAT_MEASURE_ADC_UNIT
|
||||||
|
#else // !ARCH_ESP32
|
||||||
for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
raw += analogRead(BATTERY_PIN);
|
raw += analogRead(BATTERY_PIN);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
raw = raw / BATTERY_SENSE_SAMPLES;
|
raw = raw / BATTERY_SENSE_SAMPLES;
|
||||||
|
|
||||||
float scaled;
|
float scaled;
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
scaled = esp_adc_cal_raw_to_voltage(raw, adc_characs);
|
||||||
|
scaled *= operativeAdcMultiplier;
|
||||||
|
#else
|
||||||
#ifndef VBAT_RAW_TO_SCALED
|
#ifndef VBAT_RAW_TO_SCALED
|
||||||
scaled = 1000.0 * operativeAdcMultiplier * (AREF_VOLTAGE / 1024.0) * raw;
|
scaled = 1000.0 * operativeAdcMultiplier * (AREF_VOLTAGE / 1024.0) * raw;
|
||||||
#else
|
#else
|
||||||
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
||||||
#endif
|
#endif // VBAT RAW TO SCALED
|
||||||
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
#endif // ARCH_ESP32
|
||||||
|
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
||||||
|
|
||||||
last_read_value = scaled;
|
last_read_value = scaled;
|
||||||
return scaled;
|
return scaled;
|
||||||
} else {
|
} else {
|
||||||
@ -147,7 +188,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif // BATTERY_PIN
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -228,25 +269,48 @@ bool Power::analogInit()
|
|||||||
// disable any internal pullups
|
// disable any internal pullups
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifndef BATTERY_SENSE_RESOLUTION_BITS
|
||||||
// ESP32 needs special analog stuff
|
#define BATTERY_SENSE_RESOLUTION_BITS 10
|
||||||
adcAttachPin(BATTERY_PIN);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ARCH_ESP32 // ESP32 needs special analog stuff
|
||||||
|
|
||||||
|
#ifndef ADC_WIDTH // max resolution by default
|
||||||
|
static const adc_bits_width_t width = ADC_WIDTH_BIT_12;
|
||||||
|
#else
|
||||||
|
static const adc_bits_width_t width = ADC_WIDTH;
|
||||||
|
#endif
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1
|
||||||
|
adc1_config_width(width);
|
||||||
|
adc1_config_channel_atten(adc_channel, atten);
|
||||||
|
#else // ADC2
|
||||||
|
adc2_config_channel_atten(adc_channel, atten);
|
||||||
|
// ADC2 wifi bug workaround
|
||||||
|
RTC_reg_b = READ_PERI_REG(SENS_SAR_READ_CTRL2_REG);
|
||||||
|
#endif
|
||||||
|
// calibrate ADC
|
||||||
|
esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_characs);
|
||||||
|
// show ADC characterization base
|
||||||
|
if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) {
|
||||||
|
ESP_LOGI(TAG, "ADC characterization based on Two Point values stored in eFuse");
|
||||||
|
} else if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) {
|
||||||
|
ESP_LOGI(TAG, "ADC characterization based on reference voltage stored in eFuse");
|
||||||
|
} else {
|
||||||
|
ESP_LOGI(TAG, "ADC characterization based on default reference voltage");
|
||||||
|
}
|
||||||
|
#endif // ARCH_ESP32
|
||||||
|
|
||||||
#ifdef ARCH_NRF52
|
#ifdef ARCH_NRF52
|
||||||
#ifdef VBAT_AR_INTERNAL
|
#ifdef VBAT_AR_INTERNAL
|
||||||
analogReference(VBAT_AR_INTERNAL);
|
analogReference(VBAT_AR_INTERNAL);
|
||||||
#else
|
#else
|
||||||
analogReference(AR_INTERNAL); // 3.6V
|
analogReference(AR_INTERNAL); // 3.6V
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BATTERY_SENSE_RESOLUTION_BITS
|
|
||||||
#define BATTERY_SENSE_RESOLUTION_BITS 10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// adcStart(BATTERY_PIN);
|
|
||||||
analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // Default of 12 is not very linear. Recommended to use 10 or 11
|
analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // Default of 12 is not very linear. Recommended to use 10 or 11
|
||||||
// depending on needed resolution.
|
// depending on needed resolution.
|
||||||
|
|
||||||
|
#endif // ARCH_NRF52
|
||||||
|
|
||||||
batteryLevel = &analogLevel;
|
batteryLevel = &analogLevel;
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
@ -302,7 +366,7 @@ void Power::readPowerStatus()
|
|||||||
{
|
{
|
||||||
if (batteryLevel) {
|
if (batteryLevel) {
|
||||||
bool hasBattery = batteryLevel->isBatteryConnect();
|
bool hasBattery = batteryLevel->isBatteryConnect();
|
||||||
int batteryVoltageMv = 0;
|
uint32_t batteryVoltageMv = 0;
|
||||||
int8_t batteryChargePercent = 0;
|
int8_t batteryChargePercent = 0;
|
||||||
if (hasBattery) {
|
if (hasBattery) {
|
||||||
batteryVoltageMv = batteryLevel->getBattVoltage();
|
batteryVoltageMv = batteryLevel->getBattVoltage();
|
||||||
@ -365,8 +429,8 @@ void Power::readPowerStatus()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 10 low readings in a
|
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 10 low readings in
|
||||||
// row
|
// a row
|
||||||
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
||||||
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
||||||
low_voltage_counter++;
|
low_voltage_counter++;
|
||||||
@ -444,10 +508,10 @@ int32_t Power::runOnce()
|
|||||||
* Init the power manager chip
|
* Init the power manager chip
|
||||||
*
|
*
|
||||||
* axp192 power
|
* axp192 power
|
||||||
DCDC1 0.7-3.5V @ 1200mA max -> OLED // If you turn this off you'll lose comms to the axp192 because the OLED and the axp192
|
DCDC1 0.7-3.5V @ 1200mA max -> OLED // If you turn this off you'll lose comms to the axp192 because the OLED and the
|
||||||
share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this on!) LDO1
|
axp192 share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this
|
||||||
30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of days), can
|
on!) LDO1 30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of
|
||||||
not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
days), can not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool Power::axpChipInit()
|
bool Power::axpChipInit()
|
||||||
@ -574,7 +638,8 @@ bool Power::axpChipInit()
|
|||||||
// t-beam s3 core
|
// t-beam s3 core
|
||||||
/**
|
/**
|
||||||
* gnss module power channel
|
* gnss module power channel
|
||||||
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during initialization
|
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during
|
||||||
|
* initialization
|
||||||
*/
|
*/
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO4);
|
PMU->enablePowerOutput(XPOWERS_ALDO4);
|
||||||
|
@ -31,7 +31,7 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), con
|
|||||||
// setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks
|
// setDestination(&noopPrint); for testing, try turning off 'all' debug output and see what leaks
|
||||||
|
|
||||||
Port.begin(SERIAL_BAUD);
|
Port.begin(SERIAL_BAUD);
|
||||||
#if defined(ARCH_NRF52) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
#if defined(ARCH_NRF52) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(ARCH_RP2040)
|
||||||
time_t timeout = millis();
|
time_t timeout = millis();
|
||||||
while (!Port) {
|
while (!Port) {
|
||||||
if ((millis() - timeout) < 5000) {
|
if ((millis() - timeout) < 5000) {
|
||||||
|
23
src/main.cpp
23
src/main.cpp
@ -447,7 +447,21 @@ void setup()
|
|||||||
|
|
||||||
// Init our SPI controller (must be before screen and lora)
|
// Init our SPI controller (must be before screen and lora)
|
||||||
initSPI();
|
initSPI();
|
||||||
#ifndef ARCH_ESP32
|
#ifdef ARCH_RP2040
|
||||||
|
#ifdef HW_SPI1_DEVICE
|
||||||
|
SPI1.setSCK(RF95_SCK);
|
||||||
|
SPI1.setTX(RF95_MOSI);
|
||||||
|
SPI1.setRX(RF95_MISO);
|
||||||
|
pinMode(RF95_NSS, OUTPUT);
|
||||||
|
digitalWrite(RF95_NSS, HIGH);
|
||||||
|
SPI1.begin(false);
|
||||||
|
#else // HW_SPI1_DEVICE
|
||||||
|
SPI.setSCK(RF95_SCK);
|
||||||
|
SPI.setTX(RF95_MOSI);
|
||||||
|
SPI.setRX(RF95_MISO);
|
||||||
|
SPI.begin(false);
|
||||||
|
#endif // HW_SPI1_DEVICE
|
||||||
|
#elif !defined(ARCH_ESP32) // ARCH_RP2040
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
#else
|
#else
|
||||||
// ESP32
|
// ESP32
|
||||||
@ -509,9 +523,11 @@ void setup()
|
|||||||
digitalWrite(SX126X_ANT_SW, 1);
|
digitalWrite(SX126X_ANT_SW, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Init LockingHAL first, to use it for radio init
|
#ifdef HW_SPI1_DEVICE
|
||||||
|
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI1, spiSettings);
|
||||||
|
#else // HW_SPI1_DEVICE
|
||||||
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
|
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
|
||||||
|
#endif
|
||||||
|
|
||||||
// radio init MUST BE AFTER service.init, so we have our radio config settings (from nodedb init)
|
// radio init MUST BE AFTER service.init, so we have our radio config settings (from nodedb init)
|
||||||
|
|
||||||
@ -670,6 +686,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata()
|
|||||||
deviceMetadata.role = config.device.role;
|
deviceMetadata.role = config.device.role;
|
||||||
deviceMetadata.position_flags = config.position.position_flags;
|
deviceMetadata.position_flags = config.position.position_flags;
|
||||||
deviceMetadata.hw_model = HW_VENDOR;
|
deviceMetadata.hw_model = HW_VENDOR;
|
||||||
|
deviceMetadata.hasRemoteHardware = moduleConfig.remote_hardware.enabled;
|
||||||
return deviceMetadata;
|
return deviceMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,6 +349,11 @@ void NodeDB::init()
|
|||||||
if (channelFileCRC != crc32Buffer(&channelFile, sizeof(channelFile)))
|
if (channelFileCRC != crc32Buffer(&channelFile, sizeof(channelFile)))
|
||||||
saveWhat |= SEGMENT_CHANNELS;
|
saveWhat |= SEGMENT_CHANNELS;
|
||||||
|
|
||||||
|
if (!devicestate.node_remote_hardware_pins) {
|
||||||
|
meshtastic_NodeRemoteHardwarePin empty[12] = {meshtastic_RemoteHardwarePin_init_default};
|
||||||
|
memcpy(devicestate.node_remote_hardware_pins, empty, sizeof(empty));
|
||||||
|
}
|
||||||
|
|
||||||
saveToDisk(saveWhat);
|
saveToDisk(saveWhat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ PB_BIND(meshtastic_AdminMessage, meshtastic_AdminMessage, 2)
|
|||||||
PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)
|
PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
#include <pb.h>
|
#include <pb.h>
|
||||||
#include "meshtastic/channel.pb.h"
|
#include "meshtastic/channel.pb.h"
|
||||||
#include "meshtastic/config.pb.h"
|
#include "meshtastic/config.pb.h"
|
||||||
|
#include "meshtastic/connection_status.pb.h"
|
||||||
|
#include "meshtastic/deviceonly.pb.h"
|
||||||
#include "meshtastic/mesh.pb.h"
|
#include "meshtastic/mesh.pb.h"
|
||||||
#include "meshtastic/module_config.pb.h"
|
#include "meshtastic/module_config.pb.h"
|
||||||
#include "meshtastic/connection_status.pb.h"
|
|
||||||
|
|
||||||
#if PB_PROTO_HEADER_VERSION != 40
|
#if PB_PROTO_HEADER_VERSION != 40
|
||||||
#error Regenerate this file with the current version of nanopb generator.
|
#error Regenerate this file with the current version of nanopb generator.
|
||||||
@ -70,6 +71,13 @@ typedef struct _meshtastic_HamParameters {
|
|||||||
char short_name[6];
|
char short_name[6];
|
||||||
} meshtastic_HamParameters;
|
} meshtastic_HamParameters;
|
||||||
|
|
||||||
|
/* Response envelope for node_remote_hardware_pins */
|
||||||
|
typedef struct _meshtastic_NodeRemoteHardwarePinsResponse {
|
||||||
|
/* Nodes and their respective remote hardware GPIO pins */
|
||||||
|
pb_size_t node_remote_hardware_pins_count;
|
||||||
|
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16];
|
||||||
|
} meshtastic_NodeRemoteHardwarePinsResponse;
|
||||||
|
|
||||||
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||||
This message is used to do settings operations to both remote AND local nodes.
|
This message is used to do settings operations to both remote AND local nodes.
|
||||||
(Prior to 1.2 these operations were done via special ToRadio operations) */
|
(Prior to 1.2 these operations were done via special ToRadio operations) */
|
||||||
@ -111,6 +119,10 @@ typedef struct _meshtastic_AdminMessage {
|
|||||||
meshtastic_DeviceConnectionStatus get_device_connection_status_response;
|
meshtastic_DeviceConnectionStatus get_device_connection_status_response;
|
||||||
/* Setup a node for licensed amateur (ham) radio operation */
|
/* Setup a node for licensed amateur (ham) radio operation */
|
||||||
meshtastic_HamParameters set_ham_mode;
|
meshtastic_HamParameters set_ham_mode;
|
||||||
|
/* Get the mesh's nodes with their available gpio pins for RemoteHardware module use */
|
||||||
|
bool get_node_remote_hardware_pins_request;
|
||||||
|
/* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use */
|
||||||
|
meshtastic_NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response;
|
||||||
/* Set the owner for this node */
|
/* Set the owner for this node */
|
||||||
meshtastic_User set_owner;
|
meshtastic_User set_owner;
|
||||||
/* Set channels (using the new API).
|
/* Set channels (using the new API).
|
||||||
@ -168,17 +180,21 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_AdminMessage_init_default {0, {0}}
|
#define meshtastic_AdminMessage_init_default {0, {0}}
|
||||||
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
|
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
||||||
#define meshtastic_AdminMessage_init_zero {0, {0}}
|
#define meshtastic_AdminMessage_init_zero {0, {0}}
|
||||||
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
|
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_HamParameters_call_sign_tag 1
|
#define meshtastic_HamParameters_call_sign_tag 1
|
||||||
#define meshtastic_HamParameters_tx_power_tag 2
|
#define meshtastic_HamParameters_tx_power_tag 2
|
||||||
#define meshtastic_HamParameters_frequency_tag 3
|
#define meshtastic_HamParameters_frequency_tag 3
|
||||||
#define meshtastic_HamParameters_short_name_tag 4
|
#define meshtastic_HamParameters_short_name_tag 4
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1
|
||||||
#define meshtastic_AdminMessage_get_channel_request_tag 1
|
#define meshtastic_AdminMessage_get_channel_request_tag 1
|
||||||
#define meshtastic_AdminMessage_get_channel_response_tag 2
|
#define meshtastic_AdminMessage_get_channel_response_tag 2
|
||||||
#define meshtastic_AdminMessage_get_owner_request_tag 3
|
#define meshtastic_AdminMessage_get_owner_request_tag 3
|
||||||
@ -196,6 +212,8 @@ extern "C" {
|
|||||||
#define meshtastic_AdminMessage_get_device_connection_status_request_tag 16
|
#define meshtastic_AdminMessage_get_device_connection_status_request_tag 16
|
||||||
#define meshtastic_AdminMessage_get_device_connection_status_response_tag 17
|
#define meshtastic_AdminMessage_get_device_connection_status_response_tag 17
|
||||||
#define meshtastic_AdminMessage_set_ham_mode_tag 18
|
#define meshtastic_AdminMessage_set_ham_mode_tag 18
|
||||||
|
#define meshtastic_AdminMessage_get_node_remote_hardware_pins_request_tag 19
|
||||||
|
#define meshtastic_AdminMessage_get_node_remote_hardware_pins_response_tag 20
|
||||||
#define meshtastic_AdminMessage_set_owner_tag 32
|
#define meshtastic_AdminMessage_set_owner_tag 32
|
||||||
#define meshtastic_AdminMessage_set_channel_tag 33
|
#define meshtastic_AdminMessage_set_channel_tag 33
|
||||||
#define meshtastic_AdminMessage_set_config_tag 34
|
#define meshtastic_AdminMessage_set_config_tag 34
|
||||||
@ -230,6 +248,8 @@ X(a, STATIC, ONEOF, STRING, (payload_variant,get_ringtone_response,get_ri
|
|||||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_device_connection_status_request,get_device_connection_status_request), 16) \
|
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_device_connection_status_request,get_device_connection_status_request), 16) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_device_connection_status_response,get_device_connection_status_response), 17) \
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_device_connection_status_response,get_device_connection_status_response), 17) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_ham_mode,set_ham_mode), 18) \
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_ham_mode,set_ham_mode), 18) \
|
||||||
|
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_node_remote_hardware_pins_request,get_node_remote_hardware_pins_request), 19) \
|
||||||
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_node_remote_hardware_pins_response,get_node_remote_hardware_pins_response), 20) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \
|
||||||
@ -253,6 +273,7 @@ X(a, STATIC, ONEOF, INT32, (payload_variant,nodedb_reset,nodedb_reset),
|
|||||||
#define meshtastic_AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE meshtastic_DeviceMetadata
|
#define meshtastic_AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE meshtastic_DeviceMetadata
|
||||||
#define meshtastic_AdminMessage_payload_variant_get_device_connection_status_response_MSGTYPE meshtastic_DeviceConnectionStatus
|
#define meshtastic_AdminMessage_payload_variant_get_device_connection_status_response_MSGTYPE meshtastic_DeviceConnectionStatus
|
||||||
#define meshtastic_AdminMessage_payload_variant_set_ham_mode_MSGTYPE meshtastic_HamParameters
|
#define meshtastic_AdminMessage_payload_variant_set_ham_mode_MSGTYPE meshtastic_HamParameters
|
||||||
|
#define meshtastic_AdminMessage_payload_variant_get_node_remote_hardware_pins_response_MSGTYPE meshtastic_NodeRemoteHardwarePinsResponse
|
||||||
#define meshtastic_AdminMessage_payload_variant_set_owner_MSGTYPE meshtastic_User
|
#define meshtastic_AdminMessage_payload_variant_set_owner_MSGTYPE meshtastic_User
|
||||||
#define meshtastic_AdminMessage_payload_variant_set_channel_MSGTYPE meshtastic_Channel
|
#define meshtastic_AdminMessage_payload_variant_set_channel_MSGTYPE meshtastic_Channel
|
||||||
#define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config
|
#define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config
|
||||||
@ -266,16 +287,25 @@ X(a, STATIC, SINGULAR, STRING, short_name, 4)
|
|||||||
#define meshtastic_HamParameters_CALLBACK NULL
|
#define meshtastic_HamParameters_CALLBACK NULL
|
||||||
#define meshtastic_HamParameters_DEFAULT NULL
|
#define meshtastic_HamParameters_DEFAULT NULL
|
||||||
|
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_FIELDLIST(X, a) \
|
||||||
|
X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1)
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_CALLBACK NULL
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
|
||||||
|
|
||||||
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
|
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
|
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
|
||||||
|
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
|
||||||
|
|
||||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||||
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
|
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
|
||||||
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
|
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define meshtastic_AdminMessage_size 234
|
#define meshtastic_AdminMessage_size 500
|
||||||
#define meshtastic_HamParameters_size 32
|
#define meshtastic_HamParameters_size 32
|
||||||
|
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -15,5 +15,8 @@ PB_BIND(meshtastic_ChannelFile, meshtastic_ChannelFile, 2)
|
|||||||
PB_BIND(meshtastic_OEMStore, meshtastic_OEMStore, 2)
|
PB_BIND(meshtastic_OEMStore, meshtastic_OEMStore, 2)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_NodeRemoteHardwarePin, meshtastic_NodeRemoteHardwarePin, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "meshtastic/channel.pb.h"
|
#include "meshtastic/channel.pb.h"
|
||||||
#include "meshtastic/localonly.pb.h"
|
#include "meshtastic/localonly.pb.h"
|
||||||
#include "meshtastic/mesh.pb.h"
|
#include "meshtastic/mesh.pb.h"
|
||||||
|
#include "meshtastic/module_config.pb.h"
|
||||||
|
|
||||||
#if PB_PROTO_HEADER_VERSION != 40
|
#if PB_PROTO_HEADER_VERSION != 40
|
||||||
#error Regenerate this file with the current version of nanopb generator.
|
#error Regenerate this file with the current version of nanopb generator.
|
||||||
@ -24,6 +25,51 @@ typedef enum _meshtastic_ScreenFonts {
|
|||||||
} meshtastic_ScreenFonts;
|
} meshtastic_ScreenFonts;
|
||||||
|
|
||||||
/* Struct definitions */
|
/* Struct definitions */
|
||||||
|
/* The on-disk saved channels */
|
||||||
|
typedef struct _meshtastic_ChannelFile {
|
||||||
|
/* The channels our node knows about */
|
||||||
|
pb_size_t channels_count;
|
||||||
|
meshtastic_Channel channels[8];
|
||||||
|
/* A version integer used to invalidate old save files when we make
|
||||||
|
incompatible changes This integer is set at build time and is private to
|
||||||
|
NodeDB.cpp in the device code. */
|
||||||
|
uint32_t version;
|
||||||
|
} meshtastic_ChannelFile;
|
||||||
|
|
||||||
|
typedef PB_BYTES_ARRAY_T(2048) meshtastic_OEMStore_oem_icon_bits_t;
|
||||||
|
typedef PB_BYTES_ARRAY_T(32) meshtastic_OEMStore_oem_aes_key_t;
|
||||||
|
/* This can be used for customizing the firmware distribution. If populated,
|
||||||
|
show a secondary bootup screen with custom logo and text for 2.5 seconds. */
|
||||||
|
typedef struct _meshtastic_OEMStore {
|
||||||
|
/* The Logo width in Px */
|
||||||
|
uint32_t oem_icon_width;
|
||||||
|
/* The Logo height in Px */
|
||||||
|
uint32_t oem_icon_height;
|
||||||
|
/* The Logo in XBM bytechar format */
|
||||||
|
meshtastic_OEMStore_oem_icon_bits_t oem_icon_bits;
|
||||||
|
/* Use this font for the OEM text. */
|
||||||
|
meshtastic_ScreenFonts oem_font;
|
||||||
|
/* Use this font for the OEM text. */
|
||||||
|
char oem_text[40];
|
||||||
|
/* The default device encryption key, 16 or 32 byte */
|
||||||
|
meshtastic_OEMStore_oem_aes_key_t oem_aes_key;
|
||||||
|
/* A Preset LocalConfig to apply during factory reset */
|
||||||
|
bool has_oem_local_config;
|
||||||
|
meshtastic_LocalConfig oem_local_config;
|
||||||
|
/* A Preset LocalModuleConfig to apply during factory reset */
|
||||||
|
bool has_oem_local_module_config;
|
||||||
|
meshtastic_LocalModuleConfig oem_local_module_config;
|
||||||
|
} meshtastic_OEMStore;
|
||||||
|
|
||||||
|
/* RemoteHardwarePins associated with a node */
|
||||||
|
typedef struct _meshtastic_NodeRemoteHardwarePin {
|
||||||
|
/* The node_num exposing the available gpio pin */
|
||||||
|
uint32_t node_num;
|
||||||
|
/* The the available gpio pin for usage with RemoteHardware module */
|
||||||
|
bool has_pin;
|
||||||
|
meshtastic_RemoteHardwarePin pin;
|
||||||
|
} meshtastic_NodeRemoteHardwarePin;
|
||||||
|
|
||||||
/* This message is never sent over the wire, but it is used for serializing DB
|
/* This message is never sent over the wire, but it is used for serializing DB
|
||||||
state to flash in the device code
|
state to flash in the device code
|
||||||
FIXME, since we write this each time we enter deep sleep (and have infinite
|
FIXME, since we write this each time we enter deep sleep (and have infinite
|
||||||
@ -61,44 +107,11 @@ typedef struct _meshtastic_DeviceState {
|
|||||||
Might be null */
|
Might be null */
|
||||||
bool has_rx_waypoint;
|
bool has_rx_waypoint;
|
||||||
meshtastic_MeshPacket rx_waypoint;
|
meshtastic_MeshPacket rx_waypoint;
|
||||||
|
/* The mesh's nodes with their available gpio pins for RemoteHardware module */
|
||||||
|
pb_size_t node_remote_hardware_pins_count;
|
||||||
|
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[12];
|
||||||
} meshtastic_DeviceState;
|
} meshtastic_DeviceState;
|
||||||
|
|
||||||
/* The on-disk saved channels */
|
|
||||||
typedef struct _meshtastic_ChannelFile {
|
|
||||||
/* The channels our node knows about */
|
|
||||||
pb_size_t channels_count;
|
|
||||||
meshtastic_Channel channels[8];
|
|
||||||
/* A version integer used to invalidate old save files when we make
|
|
||||||
incompatible changes This integer is set at build time and is private to
|
|
||||||
NodeDB.cpp in the device code. */
|
|
||||||
uint32_t version;
|
|
||||||
} meshtastic_ChannelFile;
|
|
||||||
|
|
||||||
typedef PB_BYTES_ARRAY_T(2048) meshtastic_OEMStore_oem_icon_bits_t;
|
|
||||||
typedef PB_BYTES_ARRAY_T(32) meshtastic_OEMStore_oem_aes_key_t;
|
|
||||||
/* This can be used for customizing the firmware distribution. If populated,
|
|
||||||
show a secondary bootup screen with custom logo and text for 2.5 seconds. */
|
|
||||||
typedef struct _meshtastic_OEMStore {
|
|
||||||
/* The Logo width in Px */
|
|
||||||
uint32_t oem_icon_width;
|
|
||||||
/* The Logo height in Px */
|
|
||||||
uint32_t oem_icon_height;
|
|
||||||
/* The Logo in XBM bytechar format */
|
|
||||||
meshtastic_OEMStore_oem_icon_bits_t oem_icon_bits;
|
|
||||||
/* Use this font for the OEM text. */
|
|
||||||
meshtastic_ScreenFonts oem_font;
|
|
||||||
/* Use this font for the OEM text. */
|
|
||||||
char oem_text[40];
|
|
||||||
/* The default device encryption key, 16 or 32 byte */
|
|
||||||
meshtastic_OEMStore_oem_aes_key_t oem_aes_key;
|
|
||||||
/* A Preset LocalConfig to apply during factory reset */
|
|
||||||
bool has_oem_local_config;
|
|
||||||
meshtastic_LocalConfig oem_local_config;
|
|
||||||
/* A Preset LocalModuleConfig to apply during factory reset */
|
|
||||||
bool has_oem_local_module_config;
|
|
||||||
meshtastic_LocalModuleConfig oem_local_module_config;
|
|
||||||
} meshtastic_OEMStore;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -114,24 +127,18 @@ extern "C" {
|
|||||||
#define meshtastic_OEMStore_oem_font_ENUMTYPE meshtastic_ScreenFonts
|
#define meshtastic_OEMStore_oem_font_ENUMTYPE meshtastic_ScreenFonts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default}, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default}
|
#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default}, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default, 0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
||||||
#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0}
|
#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0}
|
||||||
#define meshtastic_OEMStore_init_default {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default}
|
#define meshtastic_OEMStore_init_default {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default}
|
||||||
#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero}, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero}
|
#define meshtastic_NodeRemoteHardwarePin_init_default {0, false, meshtastic_RemoteHardwarePin_init_default}
|
||||||
|
#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero}, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero, 0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
||||||
#define meshtastic_ChannelFile_init_zero {0, {meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero}, 0}
|
#define meshtastic_ChannelFile_init_zero {0, {meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero}, 0}
|
||||||
#define meshtastic_OEMStore_init_zero {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}, false, meshtastic_LocalConfig_init_zero, false, meshtastic_LocalModuleConfig_init_zero}
|
#define meshtastic_OEMStore_init_zero {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}, false, meshtastic_LocalConfig_init_zero, false, meshtastic_LocalModuleConfig_init_zero}
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_init_zero {0, false, meshtastic_RemoteHardwarePin_init_zero}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_DeviceState_my_node_tag 2
|
|
||||||
#define meshtastic_DeviceState_owner_tag 3
|
|
||||||
#define meshtastic_DeviceState_node_db_tag 4
|
|
||||||
#define meshtastic_DeviceState_receive_queue_tag 5
|
|
||||||
#define meshtastic_DeviceState_rx_text_message_tag 7
|
|
||||||
#define meshtastic_DeviceState_version_tag 8
|
|
||||||
#define meshtastic_DeviceState_no_save_tag 9
|
|
||||||
#define meshtastic_DeviceState_did_gps_reset_tag 11
|
|
||||||
#define meshtastic_DeviceState_rx_waypoint_tag 12
|
|
||||||
#define meshtastic_ChannelFile_channels_tag 1
|
#define meshtastic_ChannelFile_channels_tag 1
|
||||||
#define meshtastic_ChannelFile_version_tag 2
|
#define meshtastic_ChannelFile_version_tag 2
|
||||||
#define meshtastic_OEMStore_oem_icon_width_tag 1
|
#define meshtastic_OEMStore_oem_icon_width_tag 1
|
||||||
@ -142,6 +149,18 @@ extern "C" {
|
|||||||
#define meshtastic_OEMStore_oem_aes_key_tag 6
|
#define meshtastic_OEMStore_oem_aes_key_tag 6
|
||||||
#define meshtastic_OEMStore_oem_local_config_tag 7
|
#define meshtastic_OEMStore_oem_local_config_tag 7
|
||||||
#define meshtastic_OEMStore_oem_local_module_config_tag 8
|
#define meshtastic_OEMStore_oem_local_module_config_tag 8
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_node_num_tag 1
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_pin_tag 2
|
||||||
|
#define meshtastic_DeviceState_my_node_tag 2
|
||||||
|
#define meshtastic_DeviceState_owner_tag 3
|
||||||
|
#define meshtastic_DeviceState_node_db_tag 4
|
||||||
|
#define meshtastic_DeviceState_receive_queue_tag 5
|
||||||
|
#define meshtastic_DeviceState_rx_text_message_tag 7
|
||||||
|
#define meshtastic_DeviceState_version_tag 8
|
||||||
|
#define meshtastic_DeviceState_no_save_tag 9
|
||||||
|
#define meshtastic_DeviceState_did_gps_reset_tag 11
|
||||||
|
#define meshtastic_DeviceState_rx_waypoint_tag 12
|
||||||
|
#define meshtastic_DeviceState_node_remote_hardware_pins_tag 13
|
||||||
|
|
||||||
/* Struct field encoding specification for nanopb */
|
/* Struct field encoding specification for nanopb */
|
||||||
#define meshtastic_DeviceState_FIELDLIST(X, a) \
|
#define meshtastic_DeviceState_FIELDLIST(X, a) \
|
||||||
@ -153,7 +172,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \
|
|||||||
X(a, STATIC, SINGULAR, UINT32, version, 8) \
|
X(a, STATIC, SINGULAR, UINT32, version, 8) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, no_save, 9) \
|
X(a, STATIC, SINGULAR, BOOL, no_save, 9) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) \
|
X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, rx_waypoint, 12)
|
X(a, STATIC, OPTIONAL, MESSAGE, rx_waypoint, 12) \
|
||||||
|
X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 13)
|
||||||
#define meshtastic_DeviceState_CALLBACK NULL
|
#define meshtastic_DeviceState_CALLBACK NULL
|
||||||
#define meshtastic_DeviceState_DEFAULT NULL
|
#define meshtastic_DeviceState_DEFAULT NULL
|
||||||
#define meshtastic_DeviceState_my_node_MSGTYPE meshtastic_MyNodeInfo
|
#define meshtastic_DeviceState_my_node_MSGTYPE meshtastic_MyNodeInfo
|
||||||
@ -162,6 +182,7 @@ X(a, STATIC, OPTIONAL, MESSAGE, rx_waypoint, 12)
|
|||||||
#define meshtastic_DeviceState_receive_queue_MSGTYPE meshtastic_MeshPacket
|
#define meshtastic_DeviceState_receive_queue_MSGTYPE meshtastic_MeshPacket
|
||||||
#define meshtastic_DeviceState_rx_text_message_MSGTYPE meshtastic_MeshPacket
|
#define meshtastic_DeviceState_rx_text_message_MSGTYPE meshtastic_MeshPacket
|
||||||
#define meshtastic_DeviceState_rx_waypoint_MSGTYPE meshtastic_MeshPacket
|
#define meshtastic_DeviceState_rx_waypoint_MSGTYPE meshtastic_MeshPacket
|
||||||
|
#define meshtastic_DeviceState_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
|
||||||
|
|
||||||
#define meshtastic_ChannelFile_FIELDLIST(X, a) \
|
#define meshtastic_ChannelFile_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, REPEATED, MESSAGE, channels, 1) \
|
X(a, STATIC, REPEATED, MESSAGE, channels, 1) \
|
||||||
@ -184,19 +205,29 @@ X(a, STATIC, OPTIONAL, MESSAGE, oem_local_module_config, 8)
|
|||||||
#define meshtastic_OEMStore_oem_local_config_MSGTYPE meshtastic_LocalConfig
|
#define meshtastic_OEMStore_oem_local_config_MSGTYPE meshtastic_LocalConfig
|
||||||
#define meshtastic_OEMStore_oem_local_module_config_MSGTYPE meshtastic_LocalModuleConfig
|
#define meshtastic_OEMStore_oem_local_module_config_MSGTYPE meshtastic_LocalModuleConfig
|
||||||
|
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_FIELDLIST(X, a) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, node_num, 1) \
|
||||||
|
X(a, STATIC, OPTIONAL, MESSAGE, pin, 2)
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_CALLBACK NULL
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_DEFAULT NULL
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_pin_MSGTYPE meshtastic_RemoteHardwarePin
|
||||||
|
|
||||||
extern const pb_msgdesc_t meshtastic_DeviceState_msg;
|
extern const pb_msgdesc_t meshtastic_DeviceState_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_ChannelFile_msg;
|
extern const pb_msgdesc_t meshtastic_ChannelFile_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_OEMStore_msg;
|
extern const pb_msgdesc_t meshtastic_OEMStore_msg;
|
||||||
|
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePin_msg;
|
||||||
|
|
||||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||||
#define meshtastic_DeviceState_fields &meshtastic_DeviceState_msg
|
#define meshtastic_DeviceState_fields &meshtastic_DeviceState_msg
|
||||||
#define meshtastic_ChannelFile_fields &meshtastic_ChannelFile_msg
|
#define meshtastic_ChannelFile_fields &meshtastic_ChannelFile_msg
|
||||||
#define meshtastic_OEMStore_fields &meshtastic_OEMStore_msg
|
#define meshtastic_OEMStore_fields &meshtastic_OEMStore_msg
|
||||||
|
#define meshtastic_NodeRemoteHardwarePin_fields &meshtastic_NodeRemoteHardwarePin_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define meshtastic_ChannelFile_size 638
|
#define meshtastic_ChannelFile_size 638
|
||||||
#define meshtastic_DeviceState_size 22364
|
#define meshtastic_DeviceState_size 22736
|
||||||
#define meshtastic_OEMStore_size 3043
|
#define meshtastic_NodeRemoteHardwarePin_size 29
|
||||||
|
#define meshtastic_OEMStore_size 3137
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -157,7 +157,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
|||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define meshtastic_LocalConfig_size 458
|
#define meshtastic_LocalConfig_size 458
|
||||||
#define meshtastic_LocalModuleConfig_size 439
|
#define meshtastic_LocalModuleConfig_size 533
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -719,6 +719,8 @@ typedef struct _meshtastic_DeviceMetadata {
|
|||||||
uint32_t position_flags;
|
uint32_t position_flags;
|
||||||
/* Device hardware model */
|
/* Device hardware model */
|
||||||
meshtastic_HardwareModel hw_model;
|
meshtastic_HardwareModel hw_model;
|
||||||
|
/* Has Remote Hardware enabled */
|
||||||
|
bool hasRemoteHardware;
|
||||||
} meshtastic_DeviceMetadata;
|
} meshtastic_DeviceMetadata;
|
||||||
|
|
||||||
/* Packets from the radio to the phone will appear on the fromRadio characteristic.
|
/* Packets from the radio to the phone will appear on the fromRadio characteristic.
|
||||||
@ -855,7 +857,7 @@ extern "C" {
|
|||||||
#define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}}
|
#define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}}
|
||||||
#define meshtastic_NeighborInfo_init_default {0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default}}
|
#define meshtastic_NeighborInfo_init_default {0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default}}
|
||||||
#define meshtastic_Neighbor_init_default {0, 0}
|
#define meshtastic_Neighbor_init_default {0, 0}
|
||||||
#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN}
|
#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0}
|
||||||
#define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0}
|
#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0}
|
||||||
#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||||
@ -872,7 +874,7 @@ extern "C" {
|
|||||||
#define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}}
|
#define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}}
|
||||||
#define meshtastic_NeighborInfo_init_zero {0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero}}
|
#define meshtastic_NeighborInfo_init_zero {0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero}}
|
||||||
#define meshtastic_Neighbor_init_zero {0, 0}
|
#define meshtastic_Neighbor_init_zero {0, 0}
|
||||||
#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN}
|
#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_Position_latitude_i_tag 1
|
#define meshtastic_Position_latitude_i_tag 1
|
||||||
@ -987,6 +989,7 @@ extern "C" {
|
|||||||
#define meshtastic_DeviceMetadata_role_tag 7
|
#define meshtastic_DeviceMetadata_role_tag 7
|
||||||
#define meshtastic_DeviceMetadata_position_flags_tag 8
|
#define meshtastic_DeviceMetadata_position_flags_tag 8
|
||||||
#define meshtastic_DeviceMetadata_hw_model_tag 9
|
#define meshtastic_DeviceMetadata_hw_model_tag 9
|
||||||
|
#define meshtastic_DeviceMetadata_hasRemoteHardware_tag 10
|
||||||
#define meshtastic_FromRadio_id_tag 1
|
#define meshtastic_FromRadio_id_tag 1
|
||||||
#define meshtastic_FromRadio_packet_tag 2
|
#define meshtastic_FromRadio_packet_tag 2
|
||||||
#define meshtastic_FromRadio_my_info_tag 3
|
#define meshtastic_FromRadio_my_info_tag 3
|
||||||
@ -1210,7 +1213,8 @@ X(a, STATIC, SINGULAR, BOOL, hasBluetooth, 5) \
|
|||||||
X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) \
|
X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, role, 7) \
|
X(a, STATIC, SINGULAR, UENUM, role, 7) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, position_flags, 8) \
|
X(a, STATIC, SINGULAR, UINT32, position_flags, 8) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, hw_model, 9)
|
X(a, STATIC, SINGULAR, UENUM, hw_model, 9) \
|
||||||
|
X(a, STATIC, SINGULAR, BOOL, hasRemoteHardware, 10)
|
||||||
#define meshtastic_DeviceMetadata_CALLBACK NULL
|
#define meshtastic_DeviceMetadata_CALLBACK NULL
|
||||||
#define meshtastic_DeviceMetadata_DEFAULT NULL
|
#define meshtastic_DeviceMetadata_DEFAULT NULL
|
||||||
|
|
||||||
@ -1254,7 +1258,7 @@ extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define meshtastic_Compressed_size 243
|
#define meshtastic_Compressed_size 243
|
||||||
#define meshtastic_Data_size 270
|
#define meshtastic_Data_size 270
|
||||||
#define meshtastic_DeviceMetadata_size 44
|
#define meshtastic_DeviceMetadata_size 46
|
||||||
#define meshtastic_FromRadio_size 330
|
#define meshtastic_FromRadio_size 330
|
||||||
#define meshtastic_LogRecord_size 81
|
#define meshtastic_LogRecord_size 81
|
||||||
#define meshtastic_MeshPacket_size 321
|
#define meshtastic_MeshPacket_size 321
|
||||||
|
@ -36,6 +36,10 @@ PB_BIND(meshtastic_ModuleConfig_TelemetryConfig, meshtastic_ModuleConfig_Telemet
|
|||||||
PB_BIND(meshtastic_ModuleConfig_CannedMessageConfig, meshtastic_ModuleConfig_CannedMessageConfig, AUTO)
|
PB_BIND(meshtastic_ModuleConfig_CannedMessageConfig, meshtastic_ModuleConfig_CannedMessageConfig, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_RemoteHardwarePin, meshtastic_RemoteHardwarePin, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enum definitions */
|
/* Enum definitions */
|
||||||
|
typedef enum _meshtastic_RemoteHardwarePinType {
|
||||||
|
/* Unset/unused */
|
||||||
|
meshtastic_RemoteHardwarePinType_UNKNOWN = 0,
|
||||||
|
/* GPIO pin can be read (if it is high / low) */
|
||||||
|
meshtastic_RemoteHardwarePinType_DIGITAL_READ = 1,
|
||||||
|
/* GPIO pin can be written to (high / low) */
|
||||||
|
meshtastic_RemoteHardwarePinType_DIGITAL_WRITE = 2
|
||||||
|
} meshtastic_RemoteHardwarePinType;
|
||||||
|
|
||||||
/* Baudrate for codec2 voice */
|
/* Baudrate for codec2 voice */
|
||||||
typedef enum _meshtastic_ModuleConfig_AudioConfig_Audio_Baud {
|
typedef enum _meshtastic_ModuleConfig_AudioConfig_Audio_Baud {
|
||||||
meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0,
|
meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0,
|
||||||
@ -103,12 +112,6 @@ typedef struct _meshtastic_ModuleConfig_MQTTConfig {
|
|||||||
char root[16];
|
char root[16];
|
||||||
} meshtastic_ModuleConfig_MQTTConfig;
|
} meshtastic_ModuleConfig_MQTTConfig;
|
||||||
|
|
||||||
/* RemoteHardwareModule Config */
|
|
||||||
typedef struct _meshtastic_ModuleConfig_RemoteHardwareConfig {
|
|
||||||
/* Whether the Module is enabled */
|
|
||||||
bool enabled;
|
|
||||||
} meshtastic_ModuleConfig_RemoteHardwareConfig;
|
|
||||||
|
|
||||||
/* Audio Config for codec2 voice */
|
/* Audio Config for codec2 voice */
|
||||||
typedef struct _meshtastic_ModuleConfig_AudioConfig {
|
typedef struct _meshtastic_ModuleConfig_AudioConfig {
|
||||||
/* Whether Audio is enabled */
|
/* Whether Audio is enabled */
|
||||||
@ -262,6 +265,27 @@ typedef struct _meshtastic_ModuleConfig_CannedMessageConfig {
|
|||||||
bool send_bell;
|
bool send_bell;
|
||||||
} meshtastic_ModuleConfig_CannedMessageConfig;
|
} meshtastic_ModuleConfig_CannedMessageConfig;
|
||||||
|
|
||||||
|
/* A GPIO pin definition for remote hardware module */
|
||||||
|
typedef struct _meshtastic_RemoteHardwarePin {
|
||||||
|
/* GPIO Pin number (must match Arduino) */
|
||||||
|
uint8_t gpio_pin;
|
||||||
|
/* Name for the GPIO pin (i.e. Front gate, mailbox, etc) */
|
||||||
|
char name[15];
|
||||||
|
/* Type of GPIO access available to consumers on the mesh */
|
||||||
|
meshtastic_RemoteHardwarePinType type;
|
||||||
|
} meshtastic_RemoteHardwarePin;
|
||||||
|
|
||||||
|
/* RemoteHardwareModule Config */
|
||||||
|
typedef struct _meshtastic_ModuleConfig_RemoteHardwareConfig {
|
||||||
|
/* Whether the Module is enabled */
|
||||||
|
bool enabled;
|
||||||
|
/* Whether the Module allows consumers to read / write to pins not defined in available_pins */
|
||||||
|
bool allow_undefined_pin_access;
|
||||||
|
/* Exposes the available pins to the mesh for reading and writing */
|
||||||
|
pb_size_t available_pins_count;
|
||||||
|
meshtastic_RemoteHardwarePin available_pins[4];
|
||||||
|
} meshtastic_ModuleConfig_RemoteHardwareConfig;
|
||||||
|
|
||||||
/* Module Config */
|
/* Module Config */
|
||||||
typedef struct _meshtastic_ModuleConfig {
|
typedef struct _meshtastic_ModuleConfig {
|
||||||
pb_size_t which_payload_variant;
|
pb_size_t which_payload_variant;
|
||||||
@ -293,6 +317,10 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Helper constants for enums */
|
/* Helper constants for enums */
|
||||||
|
#define _meshtastic_RemoteHardwarePinType_MIN meshtastic_RemoteHardwarePinType_UNKNOWN
|
||||||
|
#define _meshtastic_RemoteHardwarePinType_MAX meshtastic_RemoteHardwarePinType_DIGITAL_WRITE
|
||||||
|
#define _meshtastic_RemoteHardwarePinType_ARRAYSIZE ((meshtastic_RemoteHardwarePinType)(meshtastic_RemoteHardwarePinType_DIGITAL_WRITE+1))
|
||||||
|
|
||||||
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT
|
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT
|
||||||
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MAX meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B
|
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MAX meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B
|
||||||
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_AudioConfig_Audio_Baud)(meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1))
|
#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_AudioConfig_Audio_Baud)(meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1))
|
||||||
@ -325,11 +353,13 @@ extern "C" {
|
|||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar
|
#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar
|
#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar
|
||||||
|
|
||||||
|
#define meshtastic_RemoteHardwarePin_type_ENUMTYPE meshtastic_RemoteHardwarePinType
|
||||||
|
|
||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}}
|
#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}}
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, ""}
|
#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, ""}
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0}
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}}
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN}
|
#define meshtastic_ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN}
|
||||||
#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
@ -337,9 +367,10 @@ extern "C" {
|
|||||||
#define meshtastic_ModuleConfig_RangeTestConfig_init_default {0, 0, 0}
|
#define meshtastic_ModuleConfig_RangeTestConfig_init_default {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0}
|
#define meshtastic_ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0}
|
||||||
|
#define meshtastic_RemoteHardwarePin_init_default {0, "", _meshtastic_RemoteHardwarePinType_MIN}
|
||||||
#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}}
|
#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}}
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, ""}
|
#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, ""}
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0}
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}}
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN}
|
#define meshtastic_ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN}
|
||||||
#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
@ -347,6 +378,7 @@ extern "C" {
|
|||||||
#define meshtastic_ModuleConfig_RangeTestConfig_init_zero {0, 0, 0}
|
#define meshtastic_ModuleConfig_RangeTestConfig_init_zero {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0}
|
#define meshtastic_ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0}
|
||||||
|
#define meshtastic_RemoteHardwarePin_init_zero {0, "", _meshtastic_RemoteHardwarePinType_MIN}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1
|
#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1
|
||||||
@ -357,7 +389,6 @@ extern "C" {
|
|||||||
#define meshtastic_ModuleConfig_MQTTConfig_json_enabled_tag 6
|
#define meshtastic_ModuleConfig_MQTTConfig_json_enabled_tag 6
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_tls_enabled_tag 7
|
#define meshtastic_ModuleConfig_MQTTConfig_tls_enabled_tag 7
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_root_tag 8
|
#define meshtastic_ModuleConfig_MQTTConfig_root_tag 8
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_enabled_tag 1
|
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_codec2_enabled_tag 1
|
#define meshtastic_ModuleConfig_AudioConfig_codec2_enabled_tag 1
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_ptt_pin_tag 2
|
#define meshtastic_ModuleConfig_AudioConfig_ptt_pin_tag 2
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_bitrate_tag 3
|
#define meshtastic_ModuleConfig_AudioConfig_bitrate_tag 3
|
||||||
@ -412,6 +443,12 @@ extern "C" {
|
|||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_enabled_tag 9
|
#define meshtastic_ModuleConfig_CannedMessageConfig_enabled_tag 9
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_allow_input_source_tag 10
|
#define meshtastic_ModuleConfig_CannedMessageConfig_allow_input_source_tag 10
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_send_bell_tag 11
|
#define meshtastic_ModuleConfig_CannedMessageConfig_send_bell_tag 11
|
||||||
|
#define meshtastic_RemoteHardwarePin_gpio_pin_tag 1
|
||||||
|
#define meshtastic_RemoteHardwarePin_name_tag 2
|
||||||
|
#define meshtastic_RemoteHardwarePin_type_tag 3
|
||||||
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_enabled_tag 1
|
||||||
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_allow_undefined_pin_access_tag 2
|
||||||
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_available_pins_tag 3
|
||||||
#define meshtastic_ModuleConfig_mqtt_tag 1
|
#define meshtastic_ModuleConfig_mqtt_tag 1
|
||||||
#define meshtastic_ModuleConfig_serial_tag 2
|
#define meshtastic_ModuleConfig_serial_tag 2
|
||||||
#define meshtastic_ModuleConfig_external_notification_tag 3
|
#define meshtastic_ModuleConfig_external_notification_tag 3
|
||||||
@ -458,9 +495,12 @@ X(a, STATIC, SINGULAR, STRING, root, 8)
|
|||||||
#define meshtastic_ModuleConfig_MQTTConfig_DEFAULT NULL
|
#define meshtastic_ModuleConfig_MQTTConfig_DEFAULT NULL
|
||||||
|
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, enabled, 1)
|
X(a, STATIC, SINGULAR, BOOL, enabled, 1) \
|
||||||
|
X(a, STATIC, SINGULAR, BOOL, allow_undefined_pin_access, 2) \
|
||||||
|
X(a, STATIC, REPEATED, MESSAGE, available_pins, 3)
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_CALLBACK NULL
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_CALLBACK NULL
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_DEFAULT NULL
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_DEFAULT NULL
|
||||||
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_available_pins_MSGTYPE meshtastic_RemoteHardwarePin
|
||||||
|
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_FIELDLIST(X, a) \
|
#define meshtastic_ModuleConfig_AudioConfig_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, codec2_enabled, 1) \
|
X(a, STATIC, SINGULAR, BOOL, codec2_enabled, 1) \
|
||||||
@ -544,6 +584,13 @@ X(a, STATIC, SINGULAR, BOOL, send_bell, 11)
|
|||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_CALLBACK NULL
|
#define meshtastic_ModuleConfig_CannedMessageConfig_CALLBACK NULL
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_DEFAULT NULL
|
#define meshtastic_ModuleConfig_CannedMessageConfig_DEFAULT NULL
|
||||||
|
|
||||||
|
#define meshtastic_RemoteHardwarePin_FIELDLIST(X, a) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, gpio_pin, 1) \
|
||||||
|
X(a, STATIC, SINGULAR, STRING, name, 2) \
|
||||||
|
X(a, STATIC, SINGULAR, UENUM, type, 3)
|
||||||
|
#define meshtastic_RemoteHardwarePin_CALLBACK NULL
|
||||||
|
#define meshtastic_RemoteHardwarePin_DEFAULT NULL
|
||||||
|
|
||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_MQTTConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_MQTTConfig_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_RemoteHardwareConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_RemoteHardwareConfig_msg;
|
||||||
@ -554,6 +601,7 @@ extern const pb_msgdesc_t meshtastic_ModuleConfig_StoreForwardConfig_msg;
|
|||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_RangeTestConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_RangeTestConfig_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_TelemetryConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_TelemetryConfig_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg;
|
extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg;
|
||||||
|
extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
||||||
|
|
||||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||||
#define meshtastic_ModuleConfig_fields &meshtastic_ModuleConfig_msg
|
#define meshtastic_ModuleConfig_fields &meshtastic_ModuleConfig_msg
|
||||||
@ -566,6 +614,7 @@ extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg;
|
|||||||
#define meshtastic_ModuleConfig_RangeTestConfig_fields &meshtastic_ModuleConfig_RangeTestConfig_msg
|
#define meshtastic_ModuleConfig_RangeTestConfig_fields &meshtastic_ModuleConfig_RangeTestConfig_msg
|
||||||
#define meshtastic_ModuleConfig_TelemetryConfig_fields &meshtastic_ModuleConfig_TelemetryConfig_msg
|
#define meshtastic_ModuleConfig_TelemetryConfig_fields &meshtastic_ModuleConfig_TelemetryConfig_msg
|
||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_fields &meshtastic_ModuleConfig_CannedMessageConfig_msg
|
#define meshtastic_ModuleConfig_CannedMessageConfig_fields &meshtastic_ModuleConfig_CannedMessageConfig_msg
|
||||||
|
#define meshtastic_RemoteHardwarePin_fields &meshtastic_RemoteHardwarePin_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define meshtastic_ModuleConfig_AudioConfig_size 19
|
#define meshtastic_ModuleConfig_AudioConfig_size 19
|
||||||
@ -573,11 +622,12 @@ extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg;
|
|||||||
#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 40
|
#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 40
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_size 220
|
#define meshtastic_ModuleConfig_MQTTConfig_size 220
|
||||||
#define meshtastic_ModuleConfig_RangeTestConfig_size 10
|
#define meshtastic_ModuleConfig_RangeTestConfig_size 10
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_size 2
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_size 96
|
||||||
#define meshtastic_ModuleConfig_SerialConfig_size 26
|
#define meshtastic_ModuleConfig_SerialConfig_size 26
|
||||||
#define meshtastic_ModuleConfig_StoreForwardConfig_size 22
|
#define meshtastic_ModuleConfig_StoreForwardConfig_size 22
|
||||||
#define meshtastic_ModuleConfig_TelemetryConfig_size 26
|
#define meshtastic_ModuleConfig_TelemetryConfig_size 26
|
||||||
#define meshtastic_ModuleConfig_size 223
|
#define meshtastic_ModuleConfig_size 223
|
||||||
|
#define meshtastic_RemoteHardwarePin_size 21
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -50,6 +50,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
// if handled == false, then let others look at this message also if they want
|
// if handled == false, then let others look at this message also if they want
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
assert(r);
|
assert(r);
|
||||||
|
bool fromOthers = mp.from != 0 && mp.from != nodeDB.getNodeNum();
|
||||||
|
|
||||||
switch (r->which_payload_variant) {
|
switch (r->which_payload_variant) {
|
||||||
|
|
||||||
@ -175,6 +176,14 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
handleGetDeviceConnectionStatus(mp);
|
handleGetDeviceConnectionStatus(mp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case meshtastic_AdminMessage_get_module_config_response_tag: {
|
||||||
|
LOG_INFO("Client is receiving a get_module_config response.\n");
|
||||||
|
if (fromOthers && r->get_module_config_response.which_payload_variant ==
|
||||||
|
meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG) {
|
||||||
|
handleGetModuleConfigResponse(mp, r);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
#ifdef ARCH_PORTDUINO
|
#ifdef ARCH_PORTDUINO
|
||||||
case meshtastic_AdminMessage_exit_simulator_tag:
|
case meshtastic_AdminMessage_exit_simulator_tag:
|
||||||
LOG_INFO("Exiting simulator\n");
|
LOG_INFO("Exiting simulator\n");
|
||||||
@ -205,6 +214,29 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdminModule::handleGetModuleConfigResponse(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *r)
|
||||||
|
{
|
||||||
|
// Skip if it's disabled or no pins are exposed
|
||||||
|
if (!r->get_module_config_response.payload_variant.remote_hardware.enabled ||
|
||||||
|
!r->get_module_config_response.payload_variant.remote_hardware.available_pins) {
|
||||||
|
LOG_DEBUG("Remote hardware module disabled or no vailable_pins. Skipping...\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) {
|
||||||
|
if (devicestate.node_remote_hardware_pins[i].node_num == 0 || !devicestate.node_remote_hardware_pins[i].has_pin) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (uint8_t j = 0; j < sizeof(r->get_module_config_response.payload_variant.remote_hardware.available_pins); j++) {
|
||||||
|
auto availablePin = r->get_module_config_response.payload_variant.remote_hardware.available_pins[j];
|
||||||
|
if (i < devicestate.node_remote_hardware_pins_count) {
|
||||||
|
devicestate.node_remote_hardware_pins[i].node_num = mp.from;
|
||||||
|
devicestate.node_remote_hardware_pins[i].pin = availablePin;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter methods
|
* Setter methods
|
||||||
*/
|
*/
|
||||||
@ -487,6 +519,28 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdminModule::handleGetNodeRemoteHardwarePins(const meshtastic_MeshPacket &req)
|
||||||
|
{
|
||||||
|
meshtastic_AdminMessage r = meshtastic_AdminMessage_init_default;
|
||||||
|
r.which_payload_variant = meshtastic_AdminMessage_get_node_remote_hardware_pins_response_tag;
|
||||||
|
for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) {
|
||||||
|
if (devicestate.node_remote_hardware_pins[i].node_num == 0 || !devicestate.node_remote_hardware_pins[i].has_pin) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
r.get_node_remote_hardware_pins_response.node_remote_hardware_pins[i] = devicestate.node_remote_hardware_pins[i];
|
||||||
|
}
|
||||||
|
for (uint8_t i = 0; i < moduleConfig.remote_hardware.available_pins_count; i++) {
|
||||||
|
if (!moduleConfig.remote_hardware.available_pins[i].gpio_pin) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
meshtastic_NodeRemoteHardwarePin nodePin = meshtastic_NodeRemoteHardwarePin_init_default;
|
||||||
|
nodePin.node_num = nodeDB.getNodeNum();
|
||||||
|
nodePin.pin = moduleConfig.remote_hardware.available_pins[i];
|
||||||
|
r.get_node_remote_hardware_pins_response.node_remote_hardware_pins[i + 12] = nodePin;
|
||||||
|
}
|
||||||
|
myReply = allocDataProtobuf(r);
|
||||||
|
}
|
||||||
|
|
||||||
void AdminModule::handleGetDeviceMetadata(const meshtastic_MeshPacket &req)
|
void AdminModule::handleGetDeviceMetadata(const meshtastic_MeshPacket &req)
|
||||||
{
|
{
|
||||||
meshtastic_AdminMessage r = meshtastic_AdminMessage_init_default;
|
meshtastic_AdminMessage r = meshtastic_AdminMessage_init_default;
|
||||||
|
@ -26,15 +26,18 @@ class AdminModule : public ProtobufModule<meshtastic_AdminMessage>
|
|||||||
bool hasOpenEditTransaction = false;
|
bool hasOpenEditTransaction = false;
|
||||||
|
|
||||||
void saveChanges(int saveWhat, bool shouldReboot = true);
|
void saveChanges(int saveWhat, bool shouldReboot = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getters
|
* Getters
|
||||||
*/
|
*/
|
||||||
|
void handleGetModuleConfigResponse(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *p);
|
||||||
void handleGetOwner(const meshtastic_MeshPacket &req);
|
void handleGetOwner(const meshtastic_MeshPacket &req);
|
||||||
void handleGetConfig(const meshtastic_MeshPacket &req, uint32_t configType);
|
void handleGetConfig(const meshtastic_MeshPacket &req, uint32_t configType);
|
||||||
void handleGetModuleConfig(const meshtastic_MeshPacket &req, uint32_t configType);
|
void handleGetModuleConfig(const meshtastic_MeshPacket &req, uint32_t configType);
|
||||||
void handleGetChannel(const meshtastic_MeshPacket &req, uint32_t channelIndex);
|
void handleGetChannel(const meshtastic_MeshPacket &req, uint32_t channelIndex);
|
||||||
void handleGetDeviceMetadata(const meshtastic_MeshPacket &req);
|
void handleGetDeviceMetadata(const meshtastic_MeshPacket &req);
|
||||||
void handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &req);
|
void handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &req);
|
||||||
|
void handleGetNodeRemoteHardwarePins(const meshtastic_MeshPacket &req);
|
||||||
/**
|
/**
|
||||||
* Setters
|
* Setters
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +53,7 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r
|
|||||||
{
|
{
|
||||||
if (moduleConfig.remote_hardware.enabled) {
|
if (moduleConfig.remote_hardware.enabled) {
|
||||||
auto p = *pptr;
|
auto p = *pptr;
|
||||||
LOG_INFO("Received RemoteHardware typ=%d\n", p.type);
|
LOG_INFO("Received RemoteHardware type=%d\n", p.type);
|
||||||
|
|
||||||
switch (p.type) {
|
switch (p.type) {
|
||||||
case meshtastic_HardwareMessage_Type_WRITE_GPIOS:
|
case meshtastic_HardwareMessage_Type_WRITE_GPIOS:
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
#ifndef HAS_CPU_SHUTDOWN
|
#ifndef HAS_CPU_SHUTDOWN
|
||||||
#define HAS_CPU_SHUTDOWN 1
|
#define HAS_CPU_SHUTDOWN 1
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef DEFAULT_VREF
|
||||||
|
#define DEFAULT_VREF 1100
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
#define HAS_PMU
|
#define HAS_PMU
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "PowerStatus.h"
|
#include "PowerStatus.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
#include <esp_adc_cal.h>
|
||||||
|
#include <soc/adc_channel.h>
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Per @spattinson
|
* Per @spattinson
|
||||||
* MIN_BAT_MILLIVOLTS seems high. Typical 18650 are different chemistry to LiPo, even for LiPos that chart seems a bit off, other
|
* MIN_BAT_MILLIVOLTS seems high. Typical 18650 are different chemistry to LiPo, even for LiPos that chart seems a bit off, other
|
||||||
@ -14,6 +17,10 @@
|
|||||||
|
|
||||||
#define BAT_MILLIVOLTS_FULL 4100
|
#define BAT_MILLIVOLTS_FULL 4100
|
||||||
#define BAT_MILLIVOLTS_EMPTY 3500
|
#define BAT_MILLIVOLTS_EMPTY 3500
|
||||||
|
#ifdef BAT_MEASURE_ADC_UNIT
|
||||||
|
extern RTC_NOINIT_ATTR uint64_t RTC_reg_b;
|
||||||
|
#include "soc/sens_reg.h" // needed for adc pin reset
|
||||||
|
#endif
|
||||||
|
|
||||||
class Power : private concurrency::OSThread
|
class Power : private concurrency::OSThread
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
#define I2C_SDA 4
|
#define I2C_SDA 4
|
||||||
#define I2C_SCL 5
|
#define I2C_SCL 5
|
||||||
|
#define BATTERY_PIN 34
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO34_CHANNEL
|
||||||
|
|
||||||
// GPS
|
// GPS
|
||||||
#undef GPS_RX_PIN
|
#undef GPS_RX_PIN
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
#define GPS_TX_PIN 15
|
#define GPS_TX_PIN 15
|
||||||
#define GPS_UBLOX
|
#define GPS_UBLOX
|
||||||
|
|
||||||
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
#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 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 1.85 // (R1 = 470k, R2 = 680k)
|
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
||||||
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
||||||
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
||||||
|
@ -27,3 +27,5 @@
|
|||||||
#define ADC_MULTIPLIER 3.2
|
#define ADC_MULTIPLIER 3.2
|
||||||
|
|
||||||
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
|
||||||
|
#define BAT_MEASURE_ADC_UNIT 2
|
@ -29,5 +29,6 @@
|
|||||||
|
|
||||||
#define ADC_MULTIPLIER 3.8
|
#define ADC_MULTIPLIER 3.8
|
||||||
|
|
||||||
#define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO37_CHANNEL
|
||||||
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
@ -27,3 +27,5 @@
|
|||||||
// ratio of voltage divider = 3.20 (R12=100k, R10=220k)
|
// ratio of voltage divider = 3.20 (R12=100k, R10=220k)
|
||||||
#define ADC_MULTIPLIER 3.2
|
#define ADC_MULTIPLIER 3.2
|
||||||
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
|
||||||
|
#define BAT_MEASURE_ADC_UNIT 2
|
@ -8,7 +8,8 @@
|
|||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
#define ADC_MULTIPLIER 5.22
|
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||||
|
#define ADC_MULTIPLIER 4.9
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
#define ADC_MULTIPLIER 5.22
|
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||||
|
#define ADC_MULTIPLIER 4.9
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
// code)
|
// code)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity.
|
#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity.
|
||||||
#define ADC_MULTIPLIER 2
|
#define ADC_MULTIPLIER 2
|
||||||
|
|
||||||
|
68
variants/rak11310/pins_arduino.h
Normal file
68
variants/rak11310/pins_arduino.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Pin definitions taken from:
|
||||||
|
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||||
|
|
||||||
|
static const uint8_t WB_IO1 = 6; // SLOT_A SLOT_B
|
||||||
|
static const uint8_t WB_IO2 = 22; // SLOT_A SLOT_B
|
||||||
|
static const uint8_t WB_IO3 = 7; // SLOT_C
|
||||||
|
static const uint8_t WB_IO4 = 28; // SLOT_C
|
||||||
|
static const uint8_t WB_IO5 = 9; // SLOT_D
|
||||||
|
static const uint8_t WB_IO6 = 8; // SLOT_D
|
||||||
|
static const uint8_t WB_A0 = 26; // IO_SLOT
|
||||||
|
static const uint8_t WB_A1 = 27; // IO_SLOT
|
||||||
|
|
||||||
|
#define PIN_A0 (26u)
|
||||||
|
#define PIN_A1 (27u)
|
||||||
|
#define PIN_A2 (28u)
|
||||||
|
#define PIN_A3 (29u)
|
||||||
|
|
||||||
|
static const uint8_t A0 = PIN_A0;
|
||||||
|
static const uint8_t A1 = PIN_A1;
|
||||||
|
static const uint8_t A2 = PIN_A2;
|
||||||
|
static const uint8_t A3 = PIN_A3;
|
||||||
|
|
||||||
|
// LEDs
|
||||||
|
#define PIN_LED (23u)
|
||||||
|
#define PIN_LED1 PIN_LED
|
||||||
|
#define PIN_LED2 (24u)
|
||||||
|
#define LED_BUILTIN PIN_LED
|
||||||
|
|
||||||
|
#define ADC_RESOLUTION 12
|
||||||
|
|
||||||
|
// Serial
|
||||||
|
#define PIN_SERIAL1_TX (0ul)
|
||||||
|
#define PIN_SERIAL1_RX (1ul)
|
||||||
|
|
||||||
|
#define PIN_SERIAL2_TX (4ul)
|
||||||
|
#define PIN_SERIAL2_RX (5ul)
|
||||||
|
|
||||||
|
// SPI
|
||||||
|
#define PIN_SPI0_MISO (12u)
|
||||||
|
#define PIN_SPI0_MOSI (11u)
|
||||||
|
#define PIN_SPI0_SCK (10u)
|
||||||
|
#define PIN_SPI0_SS (13u)
|
||||||
|
|
||||||
|
#define PIN_SPI1_MISO (16u)
|
||||||
|
#define PIN_SPI1_MOSI (19u)
|
||||||
|
#define PIN_SPI1_SCK (18u)
|
||||||
|
#define PIN_SPI1_SS (17u)
|
||||||
|
|
||||||
|
// Wire
|
||||||
|
#define PIN_WIRE0_SDA (2u)
|
||||||
|
#define PIN_WIRE0_SCL (3u)
|
||||||
|
|
||||||
|
#define PIN_WIRE1_SDA (20u)
|
||||||
|
#define PIN_WIRE1_SCL (21u)
|
||||||
|
|
||||||
|
#define SERIAL_HOWMANY (3u)
|
||||||
|
#define SPI_HOWMANY (2u)
|
||||||
|
#define WIRE_HOWMANY (2u)
|
||||||
|
|
||||||
|
static const uint8_t SS = PIN_SPI0_SS;
|
||||||
|
static const uint8_t MOSI = PIN_SPI0_MOSI;
|
||||||
|
static const uint8_t MISO = PIN_SPI0_MISO;
|
||||||
|
static const uint8_t SCK = PIN_SPI0_SCK;
|
||||||
|
|
||||||
|
static const uint8_t SDA = PIN_WIRE0_SDA;
|
||||||
|
static const uint8_t SCL = PIN_WIRE0_SCL;
|
15
variants/rak11310/platformio.ini
Normal file
15
variants/rak11310/platformio.ini
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[env:rak11310]
|
||||||
|
extends = rp2040_base
|
||||||
|
board = wiscore_rak11300
|
||||||
|
board_level = extra
|
||||||
|
upload_protocol = picotool
|
||||||
|
|
||||||
|
# add our variants files to the include and src paths
|
||||||
|
build_flags = ${rp2040_base.build_flags}
|
||||||
|
-DPRIVATE_HW
|
||||||
|
-Ivariants/rak11310
|
||||||
|
-DDEBUG_RP2040_PORT=Serial
|
||||||
|
-DUSE_TINYUSB
|
||||||
|
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||||
|
lib_deps =
|
||||||
|
${rp2040_base.lib_deps}
|
55
variants/rak11310/variant.h
Normal file
55
variants/rak11310/variant.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||||
|
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||||
|
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||||
|
|
||||||
|
#define ARDUINO_ARCH_AVR
|
||||||
|
|
||||||
|
#undef CBC
|
||||||
|
#define CBC 0
|
||||||
|
#undef CTR
|
||||||
|
#define CTR 1
|
||||||
|
#undef ECB
|
||||||
|
#define ECB 0
|
||||||
|
|
||||||
|
#undef GPS_SERIAL_NUM
|
||||||
|
|
||||||
|
#define LED_CONN PIN_LED2
|
||||||
|
|
||||||
|
#define BUTTON_PIN 9
|
||||||
|
#define BUTTON_NEED_PULLUP
|
||||||
|
// #define EXT_NOTIFY_OUT 4
|
||||||
|
|
||||||
|
#define BATTERY_PIN 26
|
||||||
|
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||||
|
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||||
|
|
||||||
|
#define USE_SX1262
|
||||||
|
|
||||||
|
#undef RF95_SCK
|
||||||
|
#undef RF95_MISO
|
||||||
|
#undef RF95_MOSI
|
||||||
|
#undef RF95_NSS
|
||||||
|
|
||||||
|
// RAK BSP somehow uses SPI1 instead of SPI0
|
||||||
|
#define HW_SPI1_DEVICE
|
||||||
|
#define RF95_SCK PIN_SPI0_SCK
|
||||||
|
#define RF95_MOSI PIN_SPI0_MOSI
|
||||||
|
#define RF95_MISO PIN_SPI0_MISO
|
||||||
|
#define RF95_NSS PIN_SPI0_SS
|
||||||
|
|
||||||
|
#define LORA_DIO0 RADIOLIB_NC
|
||||||
|
#define LORA_RESET 14
|
||||||
|
#define LORA_DIO1 29
|
||||||
|
#define LORA_DIO2 15
|
||||||
|
#define LORA_DIO3 RADIOLIB_NC
|
||||||
|
|
||||||
|
#ifdef USE_SX1262
|
||||||
|
#define SX126X_CS RF95_NSS
|
||||||
|
#define SX126X_DIO1 LORA_DIO1
|
||||||
|
#define SX126X_BUSY LORA_DIO2
|
||||||
|
#define SX126X_RESET LORA_RESET
|
||||||
|
#define SX126X_POWER_EN 25
|
||||||
|
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Adafruit_TinyUSB.h>
|
@ -8,11 +8,9 @@ upload_protocol = picotool
|
|||||||
build_flags = ${rp2040_base.build_flags}
|
build_flags = ${rp2040_base.build_flags}
|
||||||
-DPRIVATE_HW
|
-DPRIVATE_HW
|
||||||
-Ivariants/rpipico
|
-Ivariants/rpipico
|
||||||
-DARDUINO_AVR_NANO_EVERY
|
|
||||||
-DDEBUG_RP2040_WIRE
|
|
||||||
-DDEBUG_RP2040_SPI
|
|
||||||
-DDEBUG_RP2040_CORE
|
|
||||||
-DDEBUG_RP2040_PORT=Serial
|
-DDEBUG_RP2040_PORT=Serial
|
||||||
-DUSE_TINYUSB
|
-DUSE_TINYUSB
|
||||||
|
-DHW_SPI1_DEVICE
|
||||||
|
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
@ -4,8 +4,11 @@
|
|||||||
|
|
||||||
#define ARDUINO_ARCH_AVR
|
#define ARDUINO_ARCH_AVR
|
||||||
|
|
||||||
|
#undef CBC
|
||||||
#define CBC 0
|
#define CBC 0
|
||||||
|
#undef CTR
|
||||||
#define CTR 1
|
#define CTR 1
|
||||||
|
#undef ECB
|
||||||
#define ECB 0
|
#define ECB 0
|
||||||
|
|
||||||
#define NO_GPS 1
|
#define NO_GPS 1
|
||||||
@ -18,11 +21,12 @@
|
|||||||
#define BUTTON_PIN 17
|
#define BUTTON_PIN 17
|
||||||
#define EXT_NOTIFY_OUT 4
|
#define EXT_NOTIFY_OUT 4
|
||||||
|
|
||||||
|
#define LED_PIN PIN_LED
|
||||||
|
|
||||||
#define BATTERY_PIN 26
|
#define BATTERY_PIN 26
|
||||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||||
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||||
|
|
||||||
#define USE_RF95
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|
||||||
#undef RF95_SCK
|
#undef RF95_SCK
|
||||||
|
@ -8,11 +8,9 @@ upload_protocol = picotool
|
|||||||
build_flags = ${rp2040_base.build_flags}
|
build_flags = ${rp2040_base.build_flags}
|
||||||
-DPRIVATE_HW
|
-DPRIVATE_HW
|
||||||
-Ivariants/rpipicow
|
-Ivariants/rpipicow
|
||||||
-DARDUINO_AVR_NANO_EVERY
|
|
||||||
-DDEBUG_RP2040_WIRE
|
|
||||||
-DDEBUG_RP2040_SPI
|
|
||||||
-DDEBUG_RP2040_CORE
|
|
||||||
-DDEBUG_RP2040_PORT=Serial
|
-DDEBUG_RP2040_PORT=Serial
|
||||||
-DUSE_TINYUSB
|
-DUSE_TINYUSB
|
||||||
|
-DHW_SPI1_DEVICE
|
||||||
|
-L "${platformio.libdeps_dir}/${this.__env__}/BSEC2 Software Library/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
@ -4,8 +4,11 @@
|
|||||||
|
|
||||||
#define ARDUINO_ARCH_AVR
|
#define ARDUINO_ARCH_AVR
|
||||||
|
|
||||||
|
#undef CBC
|
||||||
#define CBC 0
|
#define CBC 0
|
||||||
|
#undef CTR
|
||||||
#define CTR 1
|
#define CTR 1
|
||||||
|
#undef ECB
|
||||||
#define ECB 0
|
#define ECB 0
|
||||||
|
|
||||||
#define NO_GPS 1
|
#define NO_GPS 1
|
||||||
@ -22,7 +25,6 @@
|
|||||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||||
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||||
|
|
||||||
#define USE_RF95
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|
||||||
#undef RF95_SCK
|
#undef RF95_SCK
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
// Info:https://uniteng.com/wiki/doku.php?id=meshtastic:station#rf_design_-_lora_station_edition_g1
|
// Info:https://uniteng.com/wiki/doku.php?id=meshtastic:station#rf_design_-_lora_station_edition_g1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
#define BATTERY_SENSE_SAMPLES 30 // Set the number of samples, It has an effect of increasing sensitivity.
|
#define BATTERY_SENSE_SAMPLES 30 // Set the number of samples, It has an effect of increasing sensitivity.
|
||||||
#define ADC_MULTIPLIER 6.45
|
#define ADC_MULTIPLIER 6.45
|
||||||
#define BAT_FULLVOLT 12600
|
#define BAT_FULLVOLT 12600
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#define BUTTON_PIN 39
|
#define BUTTON_PIN 39
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
#define LORA_DIO0 26 // a No connect on the SX1262 module
|
#define LORA_DIO0 26 // a No connect on the SX1262 module
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
||||||
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||||
|
|
||||||
#define I2C_SDA 18 // I2C pins for this board
|
#define I2C_SDA 18 // I2C pins for this board
|
||||||
#define I2C_SCL 17
|
#define I2C_SCL 17
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#define GPS_TX_PIN 13 // per @eugene
|
#define GPS_TX_PIN 13 // per @eugene
|
||||||
|
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
|
|
||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#define GPS_TX_PIN 13 // per @eugene
|
#define GPS_TX_PIN 13 // per @eugene
|
||||||
|
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
|
|
||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
@ -3,9 +3,12 @@
|
|||||||
#define GPS_RX_PIN 15 // per @der_bear on the forum, 36 is incorrect for this board type and 15 is a better pick
|
#define GPS_RX_PIN 15 // per @der_bear on the forum, 36 is incorrect for this board type and 15 is a better pick
|
||||||
#define GPS_TX_PIN 13
|
#define GPS_TX_PIN 13
|
||||||
|
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
|
#define BATTERY_SENSE_SAMPLES 30
|
||||||
|
|
||||||
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
||||||
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
#define ADC_MULTIPLIER 2
|
||||||
|
|
||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
||||||
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
||||||
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
|
|
||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
Loading…
Reference in New Issue
Block a user