bleh

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sandwich
Date:
Sun Nov 15 00:51:39 2015 +0000
Commit message:
for debugging ak4396 fsm controller

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 256c7510d40e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Nov 15 00:51:39 2015 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+SPI spi(p5, p6, p7); // mosi, miso, sclk
+DigitalOut cs(p8);
+DigitalOut pdn(p9);
+DigitalOut myled(LED1);
+uint16_t control_2=0b0010000110011010;
+uint16_t control_1_rst=0b0010000010001110;
+uint16_t control_1_running=0b0010000010001111;
+int main() {
+    // Chip must be deselected
+    cs = 1;
+    pdn=0; //power down
+    wait_ms(1);
+    pdn=1;
+    wait_ms(1);
+ 
+    // Setup the spi for 16 bit data, high steady state clock,
+    // second edge capture, with a 1MHz clock rate
+    spi.format(16,3);
+    spi.frequency(9600);
+    //while (1)
+   // {
+    // Select the device by seting chip select low
+    cs = 0;
+    // turn on zero_detect
+    spi.write(control_2);
+    // Deselect the device
+    cs = 1;
+    wait_ms(1);
+    
+    cs=0;
+    spi.write(control_1_rst);
+    cs=1;
+    wait_ms(1);
+    
+    cs=0;
+    spi.write(control_1_running);
+    cs=1;
+    wait_ms(1);
+    //}
+     while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 256c7510d40e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Nov 15 00:51:39 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file