teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Committer:
brunofgc
Date:
Thu Mar 30 19:54:09 2017 +0000
Revision:
1:0e0967c88590
Parent:
0:1c0a769988ee
Child:
2:55b7b466e742
Antes de corrigir Aloca??o Din?mica Mal feita

Who changed what in which revision?

UserRevisionLine numberNew contents of line
brunofgc 0:1c0a769988ee 1 #ifndef _main_h_
brunofgc 0:1c0a769988ee 2 #define _main_h_
brunofgc 0:1c0a769988ee 3 #include "mbed.h"
brunofgc 0:1c0a769988ee 4 #include "modem.h"
brunofgc 0:1c0a769988ee 5 #include "devices.h"
brunofgc 0:1c0a769988ee 6 #include "CircularBuffer.h"
brunofgc 0:1c0a769988ee 7 #include "mediaMovel.h"
brunofgc 0:1c0a769988ee 8 #include "math.h"
brunofgc 0:1c0a769988ee 9 #include "IOs.h"
brunofgc 0:1c0a769988ee 10 #include "IRPack.h"
brunofgc 0:1c0a769988ee 11 #include "HighSpeedAnalogIn.h"
brunofgc 1:0e0967c88590 12 #include "DS18B20_SensorTemperatura.h"
brunofgc 0:1c0a769988ee 13
brunofgc 0:1c0a769988ee 14 //#define xereta_modem
brunofgc 0:1c0a769988ee 15
brunofgc 0:1c0a769988ee 16 //Inicializações de máquina;
brunofgc 0:1c0a769988ee 17 /*
brunofgc 0:1c0a769988ee 18 typedef struct _typeConfig{
brunofgc 0:1c0a769988ee 19 //Guarda todos os parametros de configuração do aparelho.
brunofgc 0:1c0a769988ee 20 //Sequencia Claro, Vivo, Tim, Oi
brunofgc 0:1c0a769988ee 21 char apnList[4][30]; //Endereço de APN para cada operadora. No caso Claro, Vivo, Tim, Oi
brunofgc 0:1c0a769988ee 22 char login[4][11]; //Login para cada operadora
brunofgc 0:1c0a769988ee 23 char senha[4][11]; //Senha para cada operadora
brunofgc 0:1c0a769988ee 24 char serverAddress[50]; //Dns para o servidor ex. norsulengenharia.com.br
brunofgc 0:1c0a769988ee 25 char numeroReportSMS[16];
brunofgc 0:1c0a769988ee 26 char serverPort[7]; //Porta para conexão entrante ex 44000
brunofgc 0:1c0a769988ee 27 uint16_t periodoDeEnvioDeDadosMinutos;
brunofgc 0:1c0a769988ee 28 char ultimoEstadoLigadoDesligado;
brunofgc 0:1c0a769988ee 29 uint16_t CRC;
brunofgc 0:1c0a769988ee 30 }typeConfig;
brunofgc 0:1c0a769988ee 31
brunofgc 0:1c0a769988ee 32 extern typeConfig flashConfig;
brunofgc 0:1c0a769988ee 33 */
brunofgc 0:1c0a769988ee 34
brunofgc 0:1c0a769988ee 35 //Definições de hardware
brunofgc 0:1c0a769988ee 36 extern DigitalOut led1;
brunofgc 0:1c0a769988ee 37 extern DigitalOut led2;
brunofgc 0:1c0a769988ee 38 extern DigitalOut led3;
brunofgc 0:1c0a769988ee 39 extern DigitalOut led4;
brunofgc 0:1c0a769988ee 40 extern bool hardwareReset;
brunofgc 0:1c0a769988ee 41
brunofgc 0:1c0a769988ee 42 extern DigitalOut ESP_CH_PD;
brunofgc 0:1c0a769988ee 43 extern DigitalOut ESP_RESET;
brunofgc 0:1c0a769988ee 44 extern DigitalOut ESP_ESPGPIO_2;
brunofgc 0:1c0a769988ee 45
brunofgc 0:1c0a769988ee 46 /*extern AnalogIn ai4;
brunofgc 0:1c0a769988ee 47 extern AnalogIn ai3;
brunofgc 0:1c0a769988ee 48 extern AnalogIn ai2;
brunofgc 0:1c0a769988ee 49 extern AnalogIn ai1;*/
brunofgc 0:1c0a769988ee 50
brunofgc 0:1c0a769988ee 51 extern MediaMovel FiltroAI4;
brunofgc 0:1c0a769988ee 52 extern MediaMovel FiltroAI3;
brunofgc 0:1c0a769988ee 53 extern MediaMovel FiltroAI2;
brunofgc 0:1c0a769988ee 54 extern MediaMovel FiltroAI1;
brunofgc 0:1c0a769988ee 55
brunofgc 0:1c0a769988ee 56 extern uint16_t aiFiltrada[4];
brunofgc 0:1c0a769988ee 57 extern bool entradasDigitais[9];
brunofgc 0:1c0a769988ee 58 extern uint32_t pwmPeriod;
brunofgc 0:1c0a769988ee 59
brunofgc 0:1c0a769988ee 60
brunofgc 0:1c0a769988ee 61 extern Serial pc; //Instancia de recurso Serial uart pc
brunofgc 0:1c0a769988ee 62 extern Serial modem; //Instancia de recurso Serial uart Modem
brunofgc 0:1c0a769988ee 63 extern Serial m200_Serial; //Instancia de recurso serial para medidor m200 modbus
brunofgc 0:1c0a769988ee 64
brunofgc 0:1c0a769988ee 65 extern CircularBuffer bufModem;
brunofgc 0:1c0a769988ee 66 extern CircularBuffer bufPC;
brunofgc 0:1c0a769988ee 67 extern CircularBuffer sdCardBuf;
brunofgc 0:1c0a769988ee 68
brunofgc 0:1c0a769988ee 69 extern bool reportaMudancaAoServer;
brunofgc 0:1c0a769988ee 70 extern bool executaComandoServer;
brunofgc 0:1c0a769988ee 71 extern bool envioDadosAoServer;
brunofgc 0:1c0a769988ee 72 extern uint8_t enviaDadosPorAlarme;
brunofgc 0:1c0a769988ee 73 extern DigitalOut max_de;
brunofgc 0:1c0a769988ee 74
brunofgc 0:1c0a769988ee 75 void loadStandardConfig(void);
brunofgc 0:1c0a769988ee 76 void RTC_POR_MINUTO(void);
brunofgc 0:1c0a769988ee 77 void inicializaMaquina(void);
brunofgc 0:1c0a769988ee 78 void chamaProcessaPacotePeloTimeOut(void);
brunofgc 0:1c0a769988ee 79
brunofgc 0:1c0a769988ee 80 extern arquivoSD *arquivoEnvioPointer;
brunofgc 0:1c0a769988ee 81
brunofgc 0:1c0a769988ee 82
brunofgc 0:1c0a769988ee 83 //Threads
brunofgc 0:1c0a769988ee 84 //Timers
brunofgc 0:1c0a769988ee 85 extern osThreadId idThreadTimers;
brunofgc 0:1c0a769988ee 86 void threadTimers(void const *);
brunofgc 0:1c0a769988ee 87
brunofgc 0:1c0a769988ee 88 //Comunicacões
brunofgc 0:1c0a769988ee 89 extern osThreadId idThreadComunicacoes;
brunofgc 0:1c0a769988ee 90 void threadComunicacoes(void const *);
brunofgc 0:1c0a769988ee 91
brunofgc 0:1c0a769988ee 92 //ProcessaPacote
brunofgc 0:1c0a769988ee 93 extern osThreadId idThreadProcessaPacote;
brunofgc 0:1c0a769988ee 94 void threadProcessaPacote(void const *);
brunofgc 0:1c0a769988ee 95 //Threads
brunofgc 0:1c0a769988ee 96
brunofgc 0:1c0a769988ee 97 //Devices
brunofgc 0:1c0a769988ee 98 extern device ** dispositivos;
brunofgc 0:1c0a769988ee 99 extern uint8_t devices;
brunofgc 0:1c0a769988ee 100 extern uint8_t alarmes;
brunofgc 0:1c0a769988ee 101 extern uint8_t qtdSchedules;
brunofgc 0:1c0a769988ee 102 void loadDevices();
brunofgc 0:1c0a769988ee 103 //Devices
brunofgc 0:1c0a769988ee 104
brunofgc 0:1c0a769988ee 105 #endif