Start working on RF95 attached to Raspberry Pi

This commit is contained in:
Thomas Göttgens
2022-12-30 21:44:51 +01:00
parent 9a04aaa811
commit 8c20fe5ec4
5 changed files with 64 additions and 5 deletions

View File

@@ -14,7 +14,7 @@
RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi)
: RadioLibInterface(cs, irq, rst, RADIOLIB_NC, spi)
{
// FIXME - we assume devices never get destroyed
LOG_WARN("RF95Interface(cs=%d, irq=%d, rst=%d)\n", cs, irq, rst);
}
/** Some boards require GPIO control of tx vs rx paths */

View File

@@ -88,7 +88,31 @@ void portduinoSetup()
{
printf("Setting up Meshtastic on Portduino...\n");
#ifdef PORTDUINO_LINUX_HARDWARE
#ifdef ARCH_RASPBERRY_PI
printf("using GPIOD Version: %s\n", gpiod_version_string());
// 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->setSilent();
gpioBind(loraIrq);
#if (RF95_NSS != RADIOLIB_NC)
auto loraCs = new LinuxGPIOPin(RF95_NSS, GPIOD_CHIP_LABEL, RF95_NSS_LABEL, "loraCs");
loraCs->setSilent();
gpioBind(loraCs);
#endif
auto loraReset = new LinuxGPIOPin(LORA_RESET, GPIOD_CHIP_LABEL, LORA_RESET_LABEL, "loraReset");
loraReset->setSilent();
gpioBind(loraReset);
}
else
#elif defined(PORTDUINO_LINUX_HARDWARE)
SPI.begin(); // We need to create SPI
bool usePineLora = !spiChip->isSimulated();
if(usePineLora) {