This has been tested with 128D EVB SPI connection is shown as following D3 -> 128D EVB pin 82 D4 -> 128D EVB pin 12 D5 -> 128D EVB pin 39

Files at this revision

API Documentation at this revision

Comitter:
tsungta
Date:
Mon Nov 06 06:07:02 2017 +0000
Commit message:
first commit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 01dbd5035212 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 06 06:07:02 2017 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+ 
+SPI spi(D3, D4, D5); // mosi, miso, sclk
+DigitalOut cs(D2);
+ 
+int main() {
+    // Chip must be deselected
+    cs = 1;
+ 
+    // Setup the spi for 8 bit data, high steady state clock,
+    // second edge capture, with a 1MHz clock rate
+    spi.format(8,3);
+    spi.frequency(1000000);
+
+    printf("Start application \r\n");   
+    // Select the device by seting chip select low
+    cs = 0;
+ 
+    spi.write(0x5);
+    spi.write(0x20);
+    spi.write(0x00);
+    spi.write('A');
+    spi.write('B');
+    spi.write('C');
+    
+    spi.write(0xFF);
+    spi.write(0xFE);
+    spi.write(0xFD);
+    spi.write(0xFC);
+          
+    wait_ms(100);
+
+    // Deselect the device
+    cs = 1;
+    printf("End of application \r\n");    
+}
\ No newline at end of file
diff -r 000000000000 -r 01dbd5035212 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Nov 06 06:07:02 2017 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#50b3418e45484ebf442b88cd935a2d5355402d7d
diff -r 000000000000 -r 01dbd5035212 mbed_app.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Mon Nov 06 06:07:02 2017 +0000
@@ -0,0 +1,17 @@
+{
+    "config": {
+        "lf_clock_rc_calib_timer_interval": {
+            "value": 16,
+            "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL"
+        },
+        "lf_clock_rc_calib_mode_config": {
+            "value": 0,
+            "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG"
+        },
+        "uart_hwfc": {
+            "help": "Value: 1 for enable, 0 for disable",
+            "value": 0,
+            "macro_name": "MBED_CONF_NORDIC_UART_HWFC"
+        }        
+    }
+}
\ No newline at end of file