The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
170:e95d10626187
Parent:
165:d1b4690b3f8b
Child:
171:3a7713b1edbc
diff -r a7c7b631e539 -r e95d10626187 drivers/SPI.h
--- a/drivers/SPI.h	Fri Jun 22 15:38:59 2018 +0100
+++ b/drivers/SPI.h	Thu Sep 06 13:39:34 2018 +0100
@@ -86,7 +86,7 @@
      *  @param sclk SPI Clock pin
      *  @param ssel SPI chip select pin
      */
-    SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel=NC);
+    SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel = NC);
 
     /** Configure the data transmission format
      *
@@ -157,7 +157,7 @@
     /** Start non-blocking SPI transfer using 8bit buffers.
      *
      * This function locks the deep sleep until any event has occurred
-     * 
+     *
      * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
      *                  the default SPI value is sent
      * @param tx_length The length of TX buffer in bytes
@@ -169,11 +169,12 @@
      * @return Zero if the transfer has started, or -1 if SPI peripheral is busy
      */
     template<typename Type>
-    int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
+    int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t &callback, int event = SPI_EVENT_COMPLETE)
+    {
         if (spi_active(&_spi)) {
-            return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
+            return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type) * 8, callback, event);
         }
-        start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
+        start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type) * 8, callback, event);
         return 0;
     }
 
@@ -215,7 +216,7 @@
      * @param event     The logical OR of events to modify
      * @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full
     */
-    int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+    int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event);
 
     /**
      *
@@ -230,7 +231,7 @@
      * @param event     The logical OR of events to modify
      * @return Zero if a transfer was added to the queue, or -1 if the queue is full
     */
-    int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+    int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event);
 
     /** Configures a callback, spi peripheral and initiate a new transfer
      *
@@ -244,7 +245,7 @@
      * @param callback  The event callback function
      * @param event     The logical OR of events to modify
     */
-    void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+    void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event);
 
 private:
     /** Lock deep sleep only if it is not yet locked */
@@ -272,7 +273,8 @@
 #endif
 
 public:
-    virtual ~SPI() {
+    virtual ~SPI()
+    {
     }
 
 protected: