Liangzhen Lai / Mbed 2 deprecated Orange_Ferrari_board_functional

Dependencies:   DDRO_Farrari mbed

Fork of DDRO_Farrari by Liangzhen Lai

Revision:
1:6a820a0ca03b
Parent:
0:84a8bcfbdec9
Child:
2:e94460b2149f
--- a/power.cpp	Mon Oct 07 22:58:19 2013 +0000
+++ b/power.cpp	Mon Oct 21 22:36:51 2013 +0000
@@ -21,17 +21,18 @@
 void power_core(float core_volt)
 {
     float periph_volt = core_volt;
-    
-    
-    if(core_volt > 1.1){
-        periph_volt = 1.1;
+    float mem_volt = periph_volt;
+    if(core_volt > 1){
+        periph_volt = 1;
+        core_volt = 1;
+        mem_volt = 1;
     }
     if(core_volt < 0.9){
         periph_volt = 0.9;
     }
-    
-    float mem_volt = core_volt;
-    
+    if(core_volt < 0.8){
+        mem_volt = core_volt + 0.05;
+    }
     power_chan(PADVDD, periph_volt);
     wait(POWER_UP_TIME);
 
@@ -48,6 +49,14 @@
     wait(POWER_UP_TIME);
     power_chan(PLLAVDD, periph_volt);
     wait(POWER_UP_TIME);
+    
+    // Sensor
+    power_chan(SENSORVDD, core_volt);//power_chan(SENSORVDD, 1.0);
+    wait(POWER_UP_TIME);
+    power_chan(SENSORLOWVDD, 0.35);
+    wait(POWER_UP_TIME);
+    power_chan(SENSORSTRESSVDD, periph_volt);//power_chan(SENSORSTRESSVDD, 1.0);
+    wait(POWER_UP_TIME);
 }
 
 
@@ -59,7 +68,18 @@
     power_chan(DVDD2, 1.8);
     wait(POWER_UP_TIME);
     
-    float new_power = core_volt;//////////////////////////////////////////////////////////
+    float periph_volt = core_volt;
+    
+    
+    if(core_volt > 1){
+        periph_volt = 1;
+        core_volt = 1;
+    }
+    if(core_volt < 0.95){
+        periph_volt = 0.95;
+    }
+    
+    float mem_volt = periph_volt;
     
     // Other padring
     power_chan(ADVDD, 3.3);
@@ -70,15 +90,15 @@
     wait(POWER_UP_TIME);
 
     // Core and Memory
-    power_chan(COREVDD, 1.0);
+    power_chan(COREVDD, core_volt);
     wait(POWER_UP_TIME);
-    power_chan(MEM1VDD, new_power);//power_chan(MEM1VDD, 1.0);
+    power_chan(MEM1VDD, mem_volt);//power_chan(MEM1VDD, 1.0);
     wait(POWER_UP_TIME);
-    power_chan(MEM2VDD, new_power);//power_chan(MEM2VDD, 1.0);
+    power_chan(MEM2VDD, mem_volt);//power_chan(MEM2VDD, 1.0);
     wait(POWER_UP_TIME);
 
     // Clock
-    power_chan(CLOCKVDD, 1.0);//power_chan(CLOCKVDD, 1.0);
+    power_chan(CLOCKVDD, periph_volt);//power_chan(CLOCKVDD, 1.0);
     wait(POWER_UP_TIME);
     power_chan(PLLAVDD, 1.0);//power_chan(PLLAVDD, 1.0);
     wait(POWER_UP_TIME);
@@ -86,7 +106,7 @@
     wait(POWER_UP_TIME);
 
     // Sensor Supplies
-    power_chan(SENSORVDD, 1.0);//power_chan(SENSORVDD, 1.0);
+    power_chan(SENSORVDD, core_volt);//power_chan(SENSORVDD, 1.0);
     wait(POWER_UP_TIME);
     power_chan(SENSORLOWVDD, 0.35);
     wait(POWER_UP_TIME);