|
|
@ -27,7 +27,7 @@
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
|
|
template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>
|
|
|
|
template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>
|
|
|
|
class SPI {
|
|
|
|
class SPIclass {
|
|
|
|
static SoftSPI<MisoPin, MosiPin, SckPin> softSPI;
|
|
|
|
static SoftSPI<MisoPin, MosiPin, SckPin> softSPI;
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
FORCE_INLINE static void init() { softSPI.begin(); }
|
|
|
|
FORCE_INLINE static void init() { softSPI.begin(); }
|
|
|
@ -38,7 +38,7 @@ class SPI {
|
|
|
|
|
|
|
|
|
|
|
|
// Hardware SPI
|
|
|
|
// Hardware SPI
|
|
|
|
template<>
|
|
|
|
template<>
|
|
|
|
class SPI<MISO_PIN, MOSI_PIN, SCK_PIN> {
|
|
|
|
class SPIclass<MISO_PIN, MOSI_PIN, SCK_PIN> {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
FORCE_INLINE static void init() {
|
|
|
|
FORCE_INLINE static void init() {
|
|
|
|
OUT_WRITE(SCK_PIN, LOW);
|
|
|
|
OUT_WRITE(SCK_PIN, LOW);
|
|
|
|