System Management code
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Libs/LatchMonitor/LatchMonitor.h@30:91af74a299e1, 2014-11-13 (annotated)
- Committer:
- pspatel321
- Date:
- Thu Nov 13 10:53:10 2014 +0000
- Revision:
- 30:91af74a299e1
- Child:
- 36:0afc0fc8f86b
Parth's edits for the week.; DC-DC completed and fixed, IMD updated, LatchMonitor and Temperature added. Serial dashboard updated. File structure changed Everything tested. Compiles and runs.; Still need to write CAN in/out interface.
Who changed what in which revision?
User | Revision | Line number | New 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 | #include "LPCDigitalIn.h" |
pspatel321 | 30:91af74a299e1 | 6 | |
pspatel321 | 30:91af74a299e1 | 7 | enum LatchMon_Status_Bits { |
pspatel321 | 30:91af74a299e1 | 8 | okPinF=1, |
pspatel321 | 30:91af74a299e1 | 9 | faultPinF=2, |
pspatel321 | 30:91af74a299e1 | 10 | softwareF=4, |
pspatel321 | 30:91af74a299e1 | 11 | hardwareF=8, |
pspatel321 | 30:91af74a299e1 | 12 | }; |
pspatel321 | 30:91af74a299e1 | 13 | |
pspatel321 | 30:91af74a299e1 | 14 | class LatchMonitor { |
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 | 30:91af74a299e1 | 18 | LatchMonitor(LPC_pin _ok, LPC_pin _fault, unsigned int startupDelay_ms); |
pspatel321 | 30:91af74a299e1 | 19 | /* |
pspatel321 | 30:91af74a299e1 | 20 | char update() returns status encoded in a char |
pspatel321 | 30:91af74a299e1 | 21 | bit0 = okPinFault - equals 1 when the OK pin from the monitored device is LOW indicating device fault |
pspatel321 | 30:91af74a299e1 | 22 | bit1 = faultPinFault - equals 1 when the sys. mgmt. latch circuit is faulted with startup timer in hardware |
pspatel321 | 30:91af74a299e1 | 23 | bit2 = softwareFault - equals 1 when the LatchMonitor fault occurs with startup timer in software |
pspatel321 | 30:91af74a299e1 | 24 | bit3 = hardwareFault - the circuit is supposed to signal fault on the hardware pin but its not doing so! |
pspatel321 | 30:91af74a299e1 | 25 | */ |
pspatel321 | 30:91af74a299e1 | 26 | char update(); |
pspatel321 | 30:91af74a299e1 | 27 | private: |
pspatel321 | 30:91af74a299e1 | 28 | Timeout startup; |
pspatel321 | 30:91af74a299e1 | 29 | void startupDelay(); |
pspatel321 | 30:91af74a299e1 | 30 | bool started; |
pspatel321 | 30:91af74a299e1 | 31 | LPCDigitalIn okPin; |
pspatel321 | 30:91af74a299e1 | 32 | LPCDigitalIn faultPin; |
pspatel321 | 30:91af74a299e1 | 33 | }; |
pspatel321 | 30:91af74a299e1 | 34 | |
pspatel321 | 30:91af74a299e1 | 35 | #endif |