mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00

Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / build-debian-src (push) Waiting to run
CI / package-pio-deps-native-tft (push) Waiting to run
CI / test-native (push) Waiting to run
CI / docker-debian-amd64 (push) Waiting to run
CI / docker-alpine-amd64 (push) Waiting to run
CI / docker-debian-arm64 (push) Waiting to run
CI / docker-debian-armv7 (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
117 lines
3.1 KiB
C++
117 lines
3.1 KiB
C++
#pragma once
|
|
#include <fstream>
|
|
#include <map>
|
|
#include <unordered_map>
|
|
|
|
#include "platform/portduino/USBHal.h"
|
|
|
|
// Product strings for auto-configuration
|
|
// {"PRODUCT_STRING", "CONFIG.YAML"}
|
|
// YAML paths are relative to `meshtastic/available.d`
|
|
inline const std::unordered_map<std::string, std::string> configProducts = {{"MESHTOAD", "lora-usb-meshtoad-e22.yaml"},
|
|
{"MESHSTICK", "lora-meshstick-1262.yaml"},
|
|
{"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"},
|
|
{"MESHADV-MINI", "lora-MeshAdv-Mini-900M22S.yaml"},
|
|
{"POWERPI", "lora-MeshAdv-900M30S.yaml"}};
|
|
|
|
enum configNames {
|
|
default_gpiochip,
|
|
cs_pin,
|
|
cs_line,
|
|
cs_gpiochip,
|
|
irq_pin,
|
|
irq_line,
|
|
irq_gpiochip,
|
|
busy_pin,
|
|
busy_line,
|
|
busy_gpiochip,
|
|
reset_pin,
|
|
reset_line,
|
|
reset_gpiochip,
|
|
txen_pin,
|
|
txen_line,
|
|
txen_gpiochip,
|
|
rxen_pin,
|
|
rxen_line,
|
|
rxen_gpiochip,
|
|
sx126x_ant_sw_pin,
|
|
sx126x_ant_sw_line,
|
|
sx126x_ant_sw_gpiochip,
|
|
sx126x_max_power,
|
|
sx128x_max_power,
|
|
lr1110_max_power,
|
|
lr1120_max_power,
|
|
rf95_max_power,
|
|
dio2_as_rf_switch,
|
|
dio3_tcxo_voltage,
|
|
use_simradio,
|
|
use_autoconf,
|
|
use_rf95,
|
|
use_sx1262,
|
|
use_sx1268,
|
|
use_sx1280,
|
|
use_lr1110,
|
|
use_lr1120,
|
|
use_lr1121,
|
|
use_llcc68,
|
|
lora_usb_serial_num,
|
|
lora_usb_pid,
|
|
lora_usb_vid,
|
|
user,
|
|
spidev,
|
|
spiSpeed,
|
|
i2cdev,
|
|
has_gps,
|
|
touchscreenModule,
|
|
touchscreenCS,
|
|
touchscreenIRQ,
|
|
touchscreenI2CAddr,
|
|
touchscreenBusFrequency,
|
|
touchscreenRotate,
|
|
touchscreenspidev,
|
|
displayspidev,
|
|
displayBusFrequency,
|
|
displayPanel,
|
|
displayWidth,
|
|
displayHeight,
|
|
displayCS,
|
|
displayDC,
|
|
displayRGBOrder,
|
|
displayBacklight,
|
|
displayBacklightPWMChannel,
|
|
displayBacklightInvert,
|
|
displayReset,
|
|
displayRotate,
|
|
displayOffsetRotate,
|
|
displayOffsetX,
|
|
displayOffsetY,
|
|
displayInvert,
|
|
keyboardDevice,
|
|
pointerDevice,
|
|
logoutputlevel,
|
|
traceFilename,
|
|
webserver,
|
|
webserverport,
|
|
webserverrootpath,
|
|
websslkeypath,
|
|
websslcertpath,
|
|
maxtophone,
|
|
maxnodes,
|
|
ascii_logs,
|
|
config_directory,
|
|
available_directory,
|
|
mac_address
|
|
};
|
|
enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d };
|
|
enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 };
|
|
enum { level_error, level_warn, level_info, level_debug, level_trace };
|
|
|
|
extern std::map<configNames, int> settingsMap;
|
|
extern std::map<configNames, std::string> settingsStrings;
|
|
extern std::ofstream traceFile;
|
|
extern Ch341Hal *ch341Hal;
|
|
int initGPIOPin(int pinNum, std::string gpioChipname, int line);
|
|
bool loadConfig(const char *configPath);
|
|
static bool ends_with(std::string_view str, std::string_view suffix);
|
|
void getMacAddr(uint8_t *dmac);
|
|
bool MAC_from_string(std::string mac_str, uint8_t *dmac); |