add SPI slave support

Set up SPI slave transactions for entries in the SPI send queue.
Add a header to each SPI datagram that includes a CRC16,
the type and the size of the message that follows.

Does not act on received bytes (yet).

Signed-off-by: Christian Ambach <christian.ambach@deutschebahn.com>
This commit is contained in:
Christian Ambach committed 2018-11-02 17:10:59 +01:00
1 parent bf3516bf45
commit a3750ef01b
10 files changed
+209 -73

No files matched your search

+5
View File
@@ -7,6 +7,11 @@
#define HAS_LORA 1 // comment out if device shall not send data via LoRa or has no LoRa
#define HAS_SPI 1 // comment out if device shall not send data via SPI
// pin definitions for SPI slave interface
#define SPI_MOSI GPIO_NUM_23
#define SPI_MISO GPIO_NUM_19
#define SPI_SCLK GPIO_NUM_18
#define SPI_CS GPIO_NUM_5
#define CFG_sx1276_radio 1 // select LoRa chip
//#define CFG_sx1272_radio 1 // select LoRa chip
+6
View File
@@ -7,6 +7,12 @@
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
#define HAS_SPI 1 // comment out if device shall not send data via SPI
// pin definitions for SPI slave interface
#define SPI_MOSI GPIO_NUM_22
#define SPI_MISO GPIO_NUM_33
#define SPI_SCLK GPIO_NUM_26
#define SPI_CS GPIO_NUM_36
#define CFG_sx1276_radio 1
//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED
#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0 (P2)