Added mutex for multiple SPI devices on the same SPI bus

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Revision:
47:cc9a2501e29f
Parent:
45:50ab13d8f2dc
--- a/cc3000.h	Sun Nov 10 21:41:44 2013 +0100
+++ b/cc3000.h	Thu Oct 16 13:39:08 2014 +0000
@@ -42,6 +42,7 @@
 #define CC3000_H
 
 #include "mbed.h"
+#include "rtos.h"
 #include "cc3000_common.h"
 #include "cc3000_spi.h"
 #include "cc3000_simplelink.h"
@@ -1081,7 +1082,7 @@
      *  \param simple_link Reference to the simple link object.
      *  \return none
      */
-     cc3000_spi(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, cc3000_event &event, cc3000_simple_link &simple_link);
+     cc3000_spi(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, Mutex & mutex, cc3000_event &event, cc3000_simple_link &simple_link);
     /**
      *  \brief Dtor
      *  \param none
@@ -1175,6 +1176,7 @@
     DigitalOut          _wlan_en;
     DigitalOut          _wlan_cs;
     SPI                 _wlan_spi;
+    Mutex &             _mutex;
     cc3000_event        &_event;
     cc3000_simple_link  &_simple_link;
     bool                _process_irq;
@@ -1555,7 +1557,7 @@
      *  \param cc3000_cs  Chip select pin
      *  \param cc3000_spi SPI interface
      */
-    cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi);
+    cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, Mutex & mutex);
     /**
      *  \brief Dtor.
      */
@@ -1706,7 +1708,7 @@
      *  \param sec          Security of the AP
      *  \param smart_config Smart config selection
      */
-    cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, const char *ssid, const char *phrase, Security sec, bool smart_config);
+    cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, Mutex & mutex, const char *ssid, const char *phrase, Security sec, bool smart_config);
     /**
      *  \brief Disconnect wlan device.
      *  \param none