Test software for SatChat prototype hardware Platform - MAX32630FTHR

Dependencies:   USBDevice max32630fthr

Revision:
0:59c04ca89ae2
Child:
1:b8cb82927f33
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jun 18 03:41:55 2017 +0000
@@ -0,0 +1,47 @@
+
+#include "mbed.h"
+#include "max32630fthr.h"
+Serial pc(USBTX, USBRX);
+Serial uart(P5_3, P5_4, 9600);
+I2C i2c(P5_7,P6_0); // SDA, SCL
+
+DigitalOut pc_activity(LED1);
+DigitalOut uart_activity(LED2);
+ 
+int main() {
+    uart.format(8,Serial::None,1);
+    char    data[2]; 
+    data[0] = 0x1A;     //MAX14960 BootCfg register
+    data[1] = 0x30;     // Always-On Mode, off state via PWR_OFF_CMD
+    i2c.write( 0x50, data, 2 );
+
+    data[0] = 0x17;     //MAX14960 LDO3Vset register
+    data[1] = 0x19;     //3.3V
+    i2c.write( 0x50, data, 2 );
+    
+    data[0] = 0x16;     //MAX14960 LDO3cfg register
+    data[1] = 0xE2;     //Enable LDO3
+    i2c.write( 0x50, data, 2 );
+      
+    wait(1);
+    while(1) {
+        if(pc.readable()) {
+            uart.putc(pc.getc());
+            pc_activity = !pc_activity;
+        }
+        if(uart.readable()) {
+            pc.putc(uart.getc());
+            uart_activity = !uart_activity;
+        }
+    }
+}
+
+
+  
+  
+      
+      
+
+      
+
+      
\ No newline at end of file