Added isSPI3w API to DevSPI

Fork of X_NUCLEO_COMMON by ST

Files at this revision

API Documentation at this revision

Comitter:
mapellil
Date:
Fri Sep 22 09:23:53 2017 +0000
Parent:
22:21096473f63e
Commit message:
Added isSPI3w API to DevSPI

Changed in this revision

DevSPI/DevSPI.h Show annotated file Show diff for this revision Revisions of this file
diff -r 21096473f63e -r 5cd443e32f27 DevSPI/DevSPI.h
--- a/DevSPI/DevSPI.h	Tue Aug 08 14:37:26 2017 +0000
+++ b/DevSPI/DevSPI.h	Fri Sep 22 09:23:53 2017 +0000
@@ -65,6 +65,8 @@
      */
     DevSPI(PinName mosi, PinName miso, PinName sclk) : SPI(mosi, miso, sclk)
     {
+        if (miso == NC) is_spi3w = true;
+        else is_spi3w = false;        
         /* Set default configuration. */
         setup(8, 3, 1E6);
     }
@@ -285,6 +287,10 @@
         return 0;
     }
 
+    inline bool isSPI3w() {
+	    return is_spi3w;
+	}
+	
 protected:
     inline uint16_t htons(uint16_t x) {
 #ifndef __DEV_SPI_BIG_ENDIAN