Skip to main content
5 of 5
edited body

This interface is perhaps not as well documented as it should be.

As it turns out, the actual SPI data and clock pins (SCK, MOSI, and MISO) are not specified in the struct; instead they are assumed to be wired consistent with the hardware SPI engine.

The arguments that are specified in the struct are limited to things which are configurable. That includes the slave select (NSS) and reset pins.

To clarify two points of apparent confusion:

  • rxtx: this is a transmit/receive mode control for the RF stage, not a data pin

  • dio: this vector of 3 pins represents the first three of the five sx127x DIO pins, which provide mode-dependent discrete functions. Typically for LoRa purposes DIO0 and DIO1 are used, while DIO2 is useful in some FSK modes. If a pin is not available, set it to LMIC_UNUSED_PIN.

For purposes of this library, packet buffer data is written and read over the SPI bus, rather than on discrete pins. It is possible to configure two of the DIO pins to be a data output and slicer clock, but that is not used here.

Some of this information can be gleaned from the README.md of the Arduino-LMIC library, but some of it is only clear in the code. Reading the Semtech data sheet is also useful.