Versão sem FFT e aquisição por DMA. 256 amostras.

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed

Committer:
rebonatto
Date:
Tue Jan 05 11:45:44 2016 +0000
Revision:
0:e57bc370d339
Vers?o est?vel sem calculo de FFT. Aquisi??o por DMA. Usa 256 amostras.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebonatto 0:e57bc370d339 1 // Simon's Watchdog code from
rebonatto 0:e57bc370d339 2 // http://mbed.org/forum/mbed/topic/508/
rebonatto 0:e57bc370d339 3 class Watchdog {
rebonatto 0:e57bc370d339 4 public:
rebonatto 0:e57bc370d339 5 // Load timeout value in watchdog timer and enable
rebonatto 0:e57bc370d339 6 void kick(float s) {
rebonatto 0:e57bc370d339 7 LPC_WDT->WDCLKSEL = 0x1; // Set CLK src to PCLK
rebonatto 0:e57bc370d339 8 uint32_t clk = SystemCoreClock / 16; // WD has a fixed /4 prescaler, PCLK default is /4
rebonatto 0:e57bc370d339 9 LPC_WDT->WDTC = s * (float)clk;
rebonatto 0:e57bc370d339 10 LPC_WDT->WDMOD = 0x3; // Enabled and Reset
rebonatto 0:e57bc370d339 11 kick();
rebonatto 0:e57bc370d339 12 }
rebonatto 0:e57bc370d339 13 // "kick" or "feed" the dog - reset the watchdog timer
rebonatto 0:e57bc370d339 14 // by writing this required bit pattern
rebonatto 0:e57bc370d339 15 void kick() {
rebonatto 0:e57bc370d339 16 LPC_WDT->WDFEED = 0xAA;
rebonatto 0:e57bc370d339 17 LPC_WDT->WDFEED = 0x55;
rebonatto 0:e57bc370d339 18 }
rebonatto 0:e57bc370d339 19 };