teste de publish
Dependencies: DS1820 HighSpeedAnalogIn devices mbed
diversos.h@0:1c0a769988ee, 2017-03-24 (annotated)
- Committer:
- brunofgc
- Date:
- Fri Mar 24 15:54:41 2017 +0000
- Revision:
- 0:1c0a769988ee
- Child:
- 1:0e0967c88590
Saidas digitais com pwm ok, entradas analogicas ok
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
brunofgc | 0:1c0a769988ee | 1 | #ifndef _diversos_h_ |
brunofgc | 0:1c0a769988ee | 2 | #define _diversos_h_ |
brunofgc | 0:1c0a769988ee | 3 | #include "mbed.h" |
brunofgc | 0:1c0a769988ee | 4 | #include "serialPC.h" |
brunofgc | 0:1c0a769988ee | 5 | #include "funcoesSDCard.h" |
brunofgc | 0:1c0a769988ee | 6 | #define tamBufferCommands 192 |
brunofgc | 0:1c0a769988ee | 7 | #include <cstdlib> |
brunofgc | 0:1c0a769988ee | 8 | |
brunofgc | 0:1c0a769988ee | 9 | /* |
brunofgc | 0:1c0a769988ee | 10 | // On reset, indicate a watchdog reset or a pushbutton reset on LED 4 or 3 |
brunofgc | 0:1c0a769988ee | 11 | if ((LPC_WDT->WDMOD >> 2) & 1) |
brunofgc | 0:1c0a769988ee | 12 | myled4 = 1; else myled3 = 1; |
brunofgc | 0:1c0a769988ee | 13 | */ |
brunofgc | 0:1c0a769988ee | 14 | |
brunofgc | 0:1c0a769988ee | 15 | class WatchdogTimer { |
brunofgc | 0:1c0a769988ee | 16 | public: |
brunofgc | 0:1c0a769988ee | 17 | //void WatchdogTimer(void); |
brunofgc | 0:1c0a769988ee | 18 | |
brunofgc | 0:1c0a769988ee | 19 | // Load timeout value in watchdog timer and enable |
brunofgc | 0:1c0a769988ee | 20 | void kick(float); |
brunofgc | 0:1c0a769988ee | 21 | |
brunofgc | 0:1c0a769988ee | 22 | // "kick" or "feed" the dog - reset the watchdog timer |
brunofgc | 0:1c0a769988ee | 23 | // by writing this required bit pattern |
brunofgc | 0:1c0a769988ee | 24 | void kick(); |
brunofgc | 0:1c0a769988ee | 25 | }; |
brunofgc | 0:1c0a769988ee | 26 | |
brunofgc | 0:1c0a769988ee | 27 | |
brunofgc | 0:1c0a769988ee | 28 | |
brunofgc | 0:1c0a769988ee | 29 | namespace eventosRTC{ |
brunofgc | 0:1c0a769988ee | 30 | //Variaveis |
brunofgc | 0:1c0a769988ee | 31 | extern bool segundos; |
brunofgc | 0:1c0a769988ee | 32 | extern bool minutos; |
brunofgc | 0:1c0a769988ee | 33 | //extern bool hora_completa; |
brunofgc | 0:1c0a769988ee | 34 | extern bool rotina10Segundos; |
brunofgc | 0:1c0a769988ee | 35 | extern bool rotina15Minutos; |
brunofgc | 0:1c0a769988ee | 36 | extern bool rotina1hora; |
brunofgc | 0:1c0a769988ee | 37 | extern bool rotina1segundo; |
brunofgc | 0:1c0a769988ee | 38 | |
brunofgc | 0:1c0a769988ee | 39 | //Funções |
brunofgc | 0:1c0a769988ee | 40 | } |
brunofgc | 0:1c0a769988ee | 41 | |
brunofgc | 0:1c0a769988ee | 42 | namespace diversos{ |
brunofgc | 0:1c0a769988ee | 43 | //Variaveis |
brunofgc | 0:1c0a769988ee | 44 | extern WatchdogTimer wdt; |
brunofgc | 0:1c0a769988ee | 45 | extern char msg[200]; |
brunofgc | 0:1c0a769988ee | 46 | |
brunofgc | 0:1c0a769988ee | 47 | //Funções |
brunofgc | 0:1c0a769988ee | 48 | uint32_t memAvailable(); |
brunofgc | 0:1c0a769988ee | 49 | void progressBar(uint32_t,uint32_t); |
brunofgc | 0:1c0a769988ee | 50 | //double stringToFloat(char *,uint16_t); //Ponteiro pra string e max tam da string por segurança |
brunofgc | 0:1c0a769988ee | 51 | } |
brunofgc | 0:1c0a769988ee | 52 | |
brunofgc | 0:1c0a769988ee | 53 | namespace commands{ |
brunofgc | 0:1c0a769988ee | 54 | //Variaveis |
brunofgc | 0:1c0a769988ee | 55 | extern char buffer[tamBufferCommands]; |
brunofgc | 0:1c0a769988ee | 56 | |
brunofgc | 0:1c0a769988ee | 57 | //Funções |
brunofgc | 0:1c0a769988ee | 58 | void exec(uint8_t); |
brunofgc | 0:1c0a769988ee | 59 | } |
brunofgc | 0:1c0a769988ee | 60 | |
brunofgc | 0:1c0a769988ee | 61 | #endif |