KurtE
Senior Member+
I am playing around with of the Adafruit RFM95 LoRa Radio boards, that I am planning to use with some Teensy in my well monitoring system. I also have a couple of the Feather M0 with These radios also...
Following Adafruit's instructions they have you download V1.59 of the Radiohead library. Also I know that Teensyduino installs a copy of RADIOHEAD, which I believe is about version 1.24. Looks like the current version is 1.61
So my first question to myself is which version should I use?
The one thing that the version that Paul's version has, is an "ugly hack" to enable SPI transactions.
I assume I can obviously duplicate this hack into the later versions.
However I was also thinking about trying to see how hard it would be to allow me to maybe move the radio to SPI1 (TLC and beta T3.6) or SPI2 (T3.6)... WIll probably follow up on this part on Beta thread.
My thoughts are to duplicate the RHHardwareSPI.h/cpp and these versions have SPI1 or 2 in them.
Already the constructor for the Radio class allows you to pass in your own SPI class:
So it should just work...
However the Ugly hack as it is won't work properly as again it assumes SPI. I was thinking of changing the Generic SPI class to maybe have Block Start / Block End members, which hopefully the different implementations can do the right thing.
Does this make sense?
I forked a copy of Paul's library, but I am thinking of updating the code here to the latest and trying it out.
I also wonder if the library developer is interested in making it work with transactions or not?
Thoughts?
Following Adafruit's instructions they have you download V1.59 of the Radiohead library. Also I know that Teensyduino installs a copy of RADIOHEAD, which I believe is about version 1.24. Looks like the current version is 1.61
So my first question to myself is which version should I use?
The one thing that the version that Paul's version has, is an "ugly hack" to enable SPI transactions.
Code:
// Ugly hack for testing SPI.beginTransaction...
#if (RH_PLATFORM == RH_PLATFORM_ARDUINO) && defined(SPI_HAS_TRANSACTION)
#undef ATOMIC_BLOCK_START
#undef ATOMIC_BLOCK_END
#define ATOMIC_BLOCK_START SPI.beginTransaction(_spi._settings)
#define ATOMIC_BLOCK_END SPI.endTransaction()
#endif
I assume I can obviously duplicate this hack into the later versions.
However I was also thinking about trying to see how hard it would be to allow me to maybe move the radio to SPI1 (TLC and beta T3.6) or SPI2 (T3.6)... WIll probably follow up on this part on Beta thread.
My thoughts are to duplicate the RHHardwareSPI.h/cpp and these versions have SPI1 or 2 in them.
Already the constructor for the Radio class allows you to pass in your own SPI class:
Code:
RH_RF95(uint8_t slaveSelectPin = SS, uint8_t interruptPin = 2, RHGenericSPI& spi = hardware_spi);
However the Ugly hack as it is won't work properly as again it assumes SPI. I was thinking of changing the Generic SPI class to maybe have Block Start / Block End members, which hopefully the different implementations can do the right thing.
Does this make sense?
I forked a copy of Paul's library, but I am thinking of updating the code here to the latest and trying it out.
I also wonder if the library developer is interested in making it work with transactions or not?
Thoughts?