Is there a way to set the MOSI/MISO pins?
I know i can do it for IRQ, SCK and CS:
RFM69 radio(rfmCsPin, rfmIrqPin, isRFM69HW, rfmIrqNum);
Is there a documentation of all the settings because the code above is from the forum?
I'm not really a coder but this are two answers from Teensy users:
While working on the T3.6 beta I made a version of the Radiohead library that allows me to support SPI1.
I added SPI transaction support to the library.
I then made a copy of the HardwareSPI code to make it possible to use SPI1.
#include <SPI.h>
#include <RH_RF95.h>
#define TRY_SPI1
#ifdef TRY_SPI1
#include <RHHardwareSPI1.h>
// MISO 1, MOSI 0, SCK 20
#define RFM95_CS 31
#define RFM95_RST 37
#define RFM95_INT 2
// SPI1 Miso=D5, Mosi=21, sck=20, CS=31
RH_RF95 rf95(RFM95_CS, RFM95_INT, hardware_spi1);
// Singleton instance of the radio driver
#else
// RH_RF95(uint8_t slaveSelectPin = SS, uint8_t interruptPin = 2, RHGenericSPI& spi = hardware_spi);
#define RFM95_CS 10
#define RFM95_RST 9
#define RFM95_INT 2
I recently changed the Arducam library to use SPI2 rather than SPI0 on the T3.6, and all it took was a simple SPIx callout change to the Arducam library similar to what Kurt mentions. However, the RFM69 radio also uses interrupts to the host processor, so that also needs to be looked at. Possible modification of the ISR of the Moteino AVR code, etc. ???
Great, if that works - more power to you.
I would just watch for these statements that save and restore SPCR and SPSR - they may not be defined for Teensy or could translate differently to SPI1/SPI2 etc:
#if defined (SPCR) && defined (SPSR)
// save current SPI settings
_SPCR = SPCR;
_SPSR = SPSR;
#endif