Basic blinky demo for MAX32630FTHR

Dependencies:   USBDevice pegasus_dev max32630fthr

Revision:
1:707376a2b1bc
Parent:
0:60a522ae2e35
Child:
2:6c7d3a687d35
diff -r 60a522ae2e35 -r 707376a2b1bc main.cpp
--- a/main.cpp	Fri Nov 11 21:08:36 2016 +0000
+++ b/main.cpp	Sun Nov 20 23:32:32 2016 +0000
@@ -1,26 +1,16 @@
 #include "mbed.h"
-
-#define MAX14690_I2C_ADDR    0x50
+#include "max32630fthr.h"
 
 DigitalOut led1(LED1);
-I2C i2cm2(P5_7, P6_0);
-
+MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
 
 // main() runs in its own thread in the OS
 // (note the calls to Thread::wait below for delays)
 int main()
 {
-    char data[5];
-    data[0] = 0x14; // I2C address for first register (LDO2 CFG)
-    data[1] = 0x00; // Dissable LDO2
-    data[2] = 0x19; // Set voltage to 3.3V
-    data[3] = 0x00; // Dissable LDO3
-    data[4] = 0x19; // Set voltage to 3.3V
-    i2cm2.write(MAX14690_I2C_ADDR, data, 5);
-    data[1] = 0x02; // Enable LDO2
-    data[3] = 0x02; // Enable LDO3
-    i2cm2.write(MAX14690_I2C_ADDR, data, 5);
-
+    // initialize power and I/O on MAX32630FTHR board
+    pegasus.init();
+    
     while (true) {
         led1 = !led1;
         Thread::wait(500);