Software SPI allows non-standard SPI pins to be used for interfacing with SPI devices

Fork of SWSPI by Dave Van Wagner

Revision:
2:eafe3ec5fbf8
Parent:
0:6a500a08c7fd
Child:
3:8c19911bdb58
--- a/SWSPI.h	Fri May 08 08:05:29 2015 +0000
+++ b/SWSPI.h	Fri May 08 08:23:58 2015 +0000
@@ -49,21 +49,19 @@
 class SWSPI
 {
 private:
-    DigitalOut* mosi;
+    DigitalOut mosi;
     DigitalIn* miso;
-    DigitalOut* sclk;
-    int port;
-    int bits;
-    int mode;
-    int polarity; // idle clock value
-    int phase; // 0=sample on leading (first) clock edge, 1=trailing (second)
-    int freq;
+    DigitalOut sclk;
+    int8_t bits;
+    int8_t polarity; // idle clock value
+    int8_t phase; // 0=sample on leading (first) clock edge, 1=trailing (second)
+    float delay_s;
     
 public:
     /** Create SWSPI object
      *
      *  @param mosi_pin
-     *  @param miso_pin
+     *  @param miso_pin can be NC
      *  @param sclk_pin
      */
     SWSPI(PinName mosi_pin, PinName miso_pin, PinName sclk_pin);