Frederico Prado / smartRamalEZR

Dependencies:   CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04

Fork of smartRamalKW by Equipe Firmware V2COM

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers memoriaMassa.h Source File

memoriaMassa.h

00001 #ifndef MM_H
00002 #define MM_H
00003 
00004 #include "mbed.h"
00005 #include "queue.h"
00006 #include "sensor.h"
00007 #include "alarm.h"
00008 #include "appParameters.h"
00009 #include "debug.h"
00010 
00011 typedef struct{
00012     unsigned int time;
00013     union{
00014         float floatValue;
00015         unsigned char bytes[4];
00016     } value;
00017 } LeituraMM;
00018 
00019 extern Alarm alarm;
00020 extern DigitalOut ledLoad;
00021 
00022 class MemoriaMassa {
00023 
00024     Ticker leituraPeriodica;
00025     int mmPeriodoSec;
00026     bool lerAgora;
00027     
00028     PersistentCircularQueue queue[3];
00029     
00030   public:
00031     void iniciaLeituras(int periodoSec, int size, int sector1, int sector2, int sector3);
00032     void disparaLeitura();
00033     void executaLeitura();
00034     char* getMM(int channel);
00035     void checkAlarms(float ch1, float ch2, float ch3);
00036 
00037 };
00038 
00039 #endif