Zimin Wang / Mbed 2 deprecated DDRO_Farrari

Dependencies:   mbed-rtos mbed

Fork of DDRO_Farrari by Liangzhen Lai

Revision:
1:6a820a0ca03b
Child:
10:95e9932f7990
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.h	Mon Oct 21 22:36:51 2013 +0000
@@ -0,0 +1,27 @@
+#ifndef MAIN_H
+#define MAIN_H
+
+extern "C" void mbed_reset();
+extern "C" void HardFault_Handler() { mbed_reset(); }
+class Watchdog {
+public:
+// Load timeout value in watchdog timer and enable
+    void kick(float s) {
+        LPC_WDT->WDCLKSEL = 0x1;                // Set CLK src to PCLK  
+        uint32_t clk = SystemCoreClock / 16;    // WD has a fixed /4 prescaler, PCLK default is /4
+        LPC_WDT->WDTC = s * (float)clk;
+        LPC_WDT->WDMOD = 0x3;                   // Enabled and Reset
+        kick();
+    }
+// "kick" or "feed" the dog - reset the watchdog timer
+// by writing this required bit pattern
+    void kick() {
+        LPC_WDT->WDFEED = 0xAA;
+        LPC_WDT->WDFEED = 0x55;
+    }
+};
+Watchdog wdt;
+
+void DDRO_Sensor(JTAG &jtag);
+int check_FFT_Freq(JTAG &jtag, int fMHz);
+#endif
\ No newline at end of file