EZR
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
alarm.h@19:1f623070b9dd, 2015-10-08 (annotated)
- Committer:
- tpadovani
- Date:
- Thu Oct 08 22:50:07 2015 +0000
- Revision:
- 19:1f623070b9dd
- Parent:
- 13:eed9484a89bc
- Child:
- 22:b66e36356dd4
Vers?o com comandos de leitura de PIMA ELO e Piminha, alarme de caixa e LEDs (ainda falta implementar LED de REDE e CARGA).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tpadovani | 19:1f623070b9dd | 1 | #ifndef ALARM_H |
tpadovani | 19:1f623070b9dd | 2 | #define ALARM_H |
tpadovani | 13:eed9484a89bc | 3 | |
tpadovani | 13:eed9484a89bc | 4 | #include "mbed.h" |
tpadovani | 13:eed9484a89bc | 5 | #include "queue.h" |
tpadovani | 13:eed9484a89bc | 6 | #include "appParameters.h" |
tpadovani | 13:eed9484a89bc | 7 | |
tpadovani | 13:eed9484a89bc | 8 | typedef struct{ |
tpadovani | 13:eed9484a89bc | 9 | unsigned int time; |
tpadovani | 13:eed9484a89bc | 10 | unsigned short int code; |
tpadovani | 13:eed9484a89bc | 11 | unsigned short int state; |
tpadovani | 13:eed9484a89bc | 12 | } AlarmEntry; |
tpadovani | 13:eed9484a89bc | 13 | |
tpadovani | 13:eed9484a89bc | 14 | class Alarm { |
tpadovani | 13:eed9484a89bc | 15 | |
tpadovani | 13:eed9484a89bc | 16 | PersistentCircularQueue alarmQueue; |
tpadovani | 13:eed9484a89bc | 17 | |
tpadovani | 13:eed9484a89bc | 18 | public: |
tpadovani | 13:eed9484a89bc | 19 | void loadQueue(int size, int sector); |
tpadovani | 13:eed9484a89bc | 20 | void writeAlarm(int code, bool state, bool previousState); |
tpadovani | 13:eed9484a89bc | 21 | char* getAllAlarms(); |
tpadovani | 13:eed9484a89bc | 22 | |
tpadovani | 13:eed9484a89bc | 23 | }; |
tpadovani | 13:eed9484a89bc | 24 | |
tpadovani | 13:eed9484a89bc | 25 | #endif |