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

Dependencies:   SWSPI

Fork of SWSPI by Dave Van Wagner

Revision:
2:4612564007c0
Parent:
1:98a9d6fc60ae
--- a/ADNS5090.h	Thu May 08 19:10:37 2014 +0000
+++ b/ADNS5090.h	Mon Jun 16 10:45:10 2014 +0000
@@ -4,6 +4,7 @@
 #include "stdint.h"
 #include "mbed.h"
 #include "SWSPI.h"
+#include "rtos.h"
 
 #define ADNS5090_WRITE_VAL          (0x80)
 #define ADNS5090_MOTION_ST_REG      (0x02)
@@ -18,12 +19,13 @@
 {
 private:
 
-    SWSPI spi;
+    SWSPI& spi;
+    Mutex& spi_mutex;
     DigitalOut ncs;
     
 public:
 
-    ADNS5090(PinName mosi_pin, PinName miso_pin, PinName sclk_pin, PinName ncs_pin, float pxPerMM_);
+    ADNS5090(SWSPI&, Mutex&, PinName ncs_pin, float pxPerMM_);
     
     int8_t dx_px, dy_px;
     uint8_t sq;  //surface quality, higher better, ~30 is good, 0= no surface