Up until the latest release, your only choice for connecting an MCU to an Afero device was through the SPI bus. SPI is a great interface but some of our customers were asking for a simple UART interface.
We heard you and now in the latest release you can do with two wires what used to take five. afLib has been extended to support the UART interface with very minor changes to your MCU code. Basically, you change a “define” to say you want to use UART, specify the UART pins, and you are up and running.
We use a slightly modified version of afPro protocol, using all the same messages to handle the communications over UART. This eliminates the need for the interrupt pin and associated interrupt service routine (needed with SPI), which simplifies the code on certain platforms.
For an example, check out: https://github.com/aferodeveloper/afLib/blob/master/examples/afBlink/afBlink.ino#L149
Search for USE_UART to find the relevant changes.