System Management code

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Committer:
pspatel321
Date:
Wed Feb 11 23:09:57 2015 +0000
Revision:
39:ddf38df9699e
Parent:
38:8efacce315ae
Updated CAN IDs for datalogging.  Changed profile encoding.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pspatel321 30:91af74a299e1 1 #ifndef __LATCH_MONITOR_H
pspatel321 30:91af74a299e1 2 #define __LATCH_MONITOR_H
pspatel321 30:91af74a299e1 3
pspatel321 30:91af74a299e1 4 #include "mbed.h"
pspatel321 30:91af74a299e1 5
pspatel321 30:91af74a299e1 6 enum LatchMon_Status_Bits {
pspatel321 38:8efacce315ae 7 OK_FAULT = 1<<0, // Device OK pin is low
pspatel321 38:8efacce315ae 8 LATCHED_HARD = 1<<1, // Circuit is in the tripped state
pspatel321 38:8efacce315ae 9 LATCHED_SOFT = 1<<2, // Software-timer has expired and decided to tag the fault
pspatel321 38:8efacce315ae 10 HARD_FAULT = 1<<3, // The circuit should have latched open, but it did not
pspatel321 30:91af74a299e1 11 };
pspatel321 30:91af74a299e1 12
pspatel321 38:8efacce315ae 13 class LatchMonitor
pspatel321 38:8efacce315ae 14 {
pspatel321 30:91af74a299e1 15
pspatel321 30:91af74a299e1 16 public:
pspatel321 30:91af74a299e1 17 // Make this startup delay longer than the actual hardware circuit delay so that it can catch errors in the circuit
pspatel321 38:8efacce315ae 18 LatchMonitor(PinName _ok, PinName _fault);
pspatel321 38:8efacce315ae 19 void setup(float* startDelay);
pspatel321 38:8efacce315ae 20 void delayStart();
pspatel321 38:8efacce315ae 21
pspatel321 30:91af74a299e1 22 char update();
pspatel321 30:91af74a299e1 23 private:
pspatel321 38:8efacce315ae 24 float* startDelay;
pspatel321 30:91af74a299e1 25 Timeout startup;
pspatel321 30:91af74a299e1 26 void startupDelay();
pspatel321 30:91af74a299e1 27 bool started;
pspatel321 36:0afc0fc8f86b 28 DigitalIn okPin;
pspatel321 36:0afc0fc8f86b 29 DigitalIn faultPin;
pspatel321 30:91af74a299e1 30 };
pspatel321 30:91af74a299e1 31
pspatel321 30:91af74a299e1 32 #endif