Using SPI to talk to the MRF89X radio module (on an MRF89XAM9A board).

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
seanburford
Date:
Thu Oct 26 21:05:49 2017 +0000
Parent:
0:f443b182a97a
Commit message:
Changes

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f443b182a97a -r 17593e5a807e main.cpp
--- a/main.cpp	Tue Sep 19 06:03:20 2017 +0000
+++ b/main.cpp	Thu Oct 26 21:05:49 2017 +0000
@@ -13,6 +13,8 @@
 PwmOut gled(LED_GREEN);
 PwmOut bled(LED_BLUE);
 
+Serial pc(USBTX, USBRX);
+
 // Local copy of MTF89X register contents.
 unsigned char regs[32];
 unsigned char regs2[32];
@@ -26,7 +28,7 @@
     rled = 0.5;
     gled = 1;
     bled = 1;
-
+    
     // Setup the spi for 8 bit data mode 0.
     spi.format(8, 0);
     spi.frequency(1000000);
@@ -54,6 +56,10 @@
     }
     cs_conf = 1;
 
+    for (unsigned char addr = 0; addr < 32; addr++) {
+      pc.printf("%02X A %02X B %02X\r\n", addr, regs[addr], regs2[addr]);
+    }
+
     // RGB: green.
     rled = 1;
     gled = 1;