Add PiHal and get Waveshare SX1262 XXXM working

This commit is contained in:
Jonathan Bennett
2023-11-15 17:04:41 -06:00
parent 8df16ad6a6
commit b1b5bafdda
5 changed files with 207 additions and 23 deletions

View File

@@ -7,8 +7,11 @@
#include <Utility.h>
#include <assert.h>
#ifdef ARCH_RASPBERRY_PI
#include "pigpio.h"
#else
#include <linux/gpio/LinuxGPIOPin.h>
#endif
// FIXME - move setBluetoothEnable into a HALPlatform class
void setBluetoothEnable(bool on)
@@ -89,12 +92,15 @@ void portduinoSetup()
printf("Setting up Meshtastic on Portduino...\n");
#ifdef ARCH_RASPBERRY_PI
printf("using GPIOD Version: %s\n", gpiod_version_string());
return;
/*
//printf("using GPIOD Version: %s\n", gpiod_version_string());
gpioInitialise();
// We need to create SPI
SPI.begin();
if (!spiChip->isSimulated()) {
printf("Connecting to RFM95 board...\n");
loraIrq = new LinuxGPIOPin(LORA_DIO0, GPIOD_CHIP_LABEL, LORA_DIO0_LABEL, "loraIrq");
loraIrq = new LinuxGPIOPin(LORA_DIO0, "gpiochip0", LORA_DIO0_LABEL, "loraIrq");
loraIrq->setSilent();
gpioBind(loraIrq);
@@ -151,7 +157,8 @@ void portduinoSetup()
gpioBind(new SimGPIOPin(SX126X_RESET, "fakeLoraReset"));
gpioBind(new SimGPIOPin(LORA_DIO1, "fakeLoraIrq"));
}
*/
#endif
// gpioBind((new SimGPIOPin(LORA_RESET, "LORA_RESET")));
// gpioBind((new SimGPIOPin(RF95_NSS, "RF95_NSS"))->setSilent());
}
}