mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-18 07:47:32 +00:00
Extra pins (#9260)
* Maybe add working extra GPIO pins to portduino * Fix typo and add config.yaml example for ExtraPins * Write extra pins back out with -y flag
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "LR11x0Interface.h"
|
||||
#include "Module.h"
|
||||
@@ -97,6 +98,7 @@ extern struct portduino_config_struct {
|
||||
pinMapping lora_txen_pin = {"Lora", "TXen"};
|
||||
pinMapping lora_rxen_pin = {"Lora", "RXen"};
|
||||
pinMapping lora_sx126x_ant_sw_pin = {"Lora", "SX126X_ANT_SW"};
|
||||
std::vector<pinMapping> extra_pins = {};
|
||||
|
||||
// GPS
|
||||
bool has_gps = false;
|
||||
@@ -300,6 +302,20 @@ extern struct portduino_config_struct {
|
||||
}
|
||||
out << YAML::EndMap; // Lora
|
||||
|
||||
if (!extra_pins.empty()) {
|
||||
out << YAML::Key << "GPIO" << YAML::Value << YAML::BeginMap;
|
||||
out << YAML::Key << "ExtraPins" << YAML::Value << YAML::BeginSeq;
|
||||
for (auto extra : extra_pins) {
|
||||
out << YAML::BeginMap;
|
||||
out << YAML::Key << "pin" << YAML::Value << extra.pin;
|
||||
out << YAML::Key << "line" << YAML::Value << extra.line;
|
||||
out << YAML::Key << "gpiochip" << YAML::Value << extra.gpiochip;
|
||||
out << YAML::EndMap;
|
||||
}
|
||||
out << YAML::EndSeq;
|
||||
out << YAML::EndMap; // GPIO
|
||||
}
|
||||
|
||||
if (i2cdev != "") {
|
||||
out << YAML::Key << "I2C" << YAML::Value << YAML::BeginMap;
|
||||
out << YAML::Key << "I2CDevice" << YAML::Value << i2cdev;
|
||||
|
||||
Reference in New Issue
Block a user