Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

Revision:
48:bab9f747d9ed
Parent:
47:a68747642a7a
Child:
50:e89647e77fd5
--- a/xDotBridge/src/main.cpp	Fri Feb 10 07:41:16 2017 -0700
+++ b/xDotBridge/src/main.cpp	Mon Feb 13 17:10:59 2017 -0700
@@ -14,15 +14,17 @@
 
 mDot* dot = NULL; // Used by dot-utils
 
+DigitalOut gpio3(GPIO3, 1); // Flash ~hold signal
+
 int main() {
+    pc.baud(115200);
+
     CommProtocolPeerBrute protocol;
     BaseboardIO bbio;
     RadioEvent events;  // Custom event handler for automatically displaying RX data
     WinbondSPIFlash flash(SPI_MOSI, SPI_MISO, SPI_SCK, SPI_NSS);
 //    flash.frequency(48e6); // TODO try overridding for faster freq (Default 1MHz)
 
-    pc.baud(115200);
-
     mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL);
 
     dot = mDot::getInstance();
@@ -56,7 +58,26 @@
     logInfo("Programmable Voltage Detector set for level: %d", pvdConfig.PVDLevel);
     // HAL_PWR_PVDCallback need to define this I think this will override the current implementation
 
-    // TODO setup IO here
+    // Appears to work but do not have a good way to measure power
+    for (int i=0; i<8; i++) {
+        int data = flash.readByte(0x000000+i);
+        logInfo("Idx: %d: %02X", i, data);
+    }
+    logInfo("Powering Down");
+    flash.powerDown();
+    wait(1.0);
+    for (int i=0; i<8; i++) {
+        int data = flash.readByte(0x000000+i);
+        logInfo("Idx: %d: %02X", i, data);
+    }
+    flash.releaseFromPowerDown();
+    logInfo("Waking up");
+    wait(1.0);
+    for (int i=0; i<8; i++) {
+        int data = flash.readByte(0x000000+i);
+        logInfo("Idx: %d: %02X", i, data);
+    }
+    return 0;
 
 #if BRIDGE_TX_BRUTE
     protocol.setTx(true);