Linux: Add support for SPIDEV (#734)

RPi and Linux refactor.

Add GPIO Sysfs for GPIO operations.

Update configure script.

Fix some cppcheck warnings.

Add serial emulation that prints to stdout.

Fix some file headers.
This commit is contained in:
Marcelo Aquino
2017-01-14 23:50:21 +01:00
committed by Henrik Ekblad
parent aa5cecfca1
commit 2e0f6b6229
43 changed files with 1574 additions and 593 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ LOCAL uint8_t MY_RF24_NODE_ADDRESS = AUTO;
LOCAL RF24_receiveCallbackType RF24_receiveCallback = NULL;
#endif
#ifdef LINUX_ARCH_RASPBERRYPI
#ifdef LINUX_SPI_BCM
uint8_t spi_rxbuff[32+1] ; //SPI receive buffer (payload max 32 bytes)
uint8_t spi_txbuff[32+1] ; //SPI transmit buffer (payload max 32 bytes + 1 byte for the command)
#endif
@@ -56,7 +56,7 @@ LOCAL uint8_t RF24_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_t
RF24_csn(LOW);
// timing
delayMicroseconds(10);
#ifdef LINUX_ARCH_RASPBERRYPI
#ifdef LINUX_SPI_BCM
uint8_t * prx = spi_rxbuff;
uint8_t * ptx = spi_txbuff;
uint8_t size = len + 1; // Add register value to transmit buffer
+1 -1
View File
@@ -48,7 +48,7 @@ _SPI;
#define _BV(x) (1<<(x))
#if defined(__arm__)
#if defined(__arm__) || defined(__linux__)
#include <SPI.h>
#else
extern HardwareSPI SPI;