SPI Test (Master)

Revision:
0:0c8fb6842c2a
Child:
1:b34b41d8a360
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 18 07:00:58 2017 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+SPI spiM(D11, D12, D13);
+DigitalOut cs(D10);
+
+int main()
+{
+    printf("SPIMaster Test\r\n");
+    
+    spiM.format(8, 0);
+    spiM.frequency(8000000);
+    
+    for (;;) {   
+        cs = 0;
+        int rdata = spiM.write(0x55);
+        cs = 1;
+        wait_ms(1);
+        printf("received: %x\r\n", rdata);
+    }
+}