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 #include "IOobjects.h"
pspatel321 30:91af74a299e1 2
pspatel321 36:0afc0fc8f86b 3 Watchdog wdt; // Watchdog timer (TIMEOUT (sec))
pspatel321 36:0afc0fc8f86b 4 DigitalIn sw[]={ // Shutdown switch sense lines
pspatel321 36:0afc0fc8f86b 5 DigitalIn(P1_0, PullDown), // Sense0 - fuse power
pspatel321 36:0afc0fc8f86b 6 DigitalIn(P1_1, PullDown), // Sense1 - AMS latch
pspatel321 36:0afc0fc8f86b 7 DigitalIn(P1_4, PullDown), // Sense2 - IMD latch
pspatel321 36:0afc0fc8f86b 8 DigitalIn(P1_8, PullDown), // Sense3 - PCM relay
pspatel321 36:0afc0fc8f86b 9 DigitalIn(P1_9, PullDown), // Sense4 - Brake plausibility relay
pspatel321 36:0afc0fc8f86b 10 DigitalIn(P1_10, PullDown), // Sense5 - Left e-stop
pspatel321 36:0afc0fc8f86b 11 DigitalIn(P1_14, PullDown), // Sense6 - Brake over-travel
pspatel321 36:0afc0fc8f86b 12 DigitalIn(P1_15, PullDown), // Sense7 - Inertia switch
pspatel321 36:0afc0fc8f86b 13 DigitalIn(P1_16, PullDown), // Sense8 - Cockpit e-stop
pspatel321 36:0afc0fc8f86b 14 DigitalIn(P1_17, PullDown), // Sense9 - Right e-stop
pspatel321 36:0afc0fc8f86b 15 DigitalIn(P1_27, PullDown), // Sense10 - HVD/Charger
pspatel321 36:0afc0fc8f86b 16 DigitalIn(P1_28, PullDown), // Sense11 - TSMS/tractive enable
pspatel321 30:91af74a299e1 17 };
pspatel321 36:0afc0fc8f86b 18 PollSwitch switches(sw, sizeof(sw)/sizeof(sw[0])); // Shutdown switch sense pins (SWITCH PIN ARRAY, NUM PINS)
pspatel321 38:8efacce315ae 19 CANBuffer can(CAN2, MEDIUM, P4_28, 1, 1); // Buffered CAN interface (PORT, SPEED, SILENT PIN)
pspatel321 38:8efacce315ae 20 CoulombCounter glvBat(p19, FAST_LOOP*1000, 1); // Coulomb counter battery monitor for GLV Battery (CURRENT SENSE PIN, INTEGRATION TIME)
pspatel321 36:0afc0fc8f86b 21 IMD imd(P1_26); // IMD PWM sense channel to read status and resistance (IMD PWM PIN)
pspatel321 38:8efacce315ae 22 LatchMonitor AMSlatch(P0_18, P0_22); // Supervisor for AMS hardware latch/reset circuit (OK PIN, FAULT PIN, STARTUP DELAY (ms))
pspatel321 38:8efacce315ae 23 LatchMonitor IMDlatch(P0_17, P0_21); // Supervisor for IMD hardware latch/reset circuit (OK PIN, FAULT PIN, STARTUP DELAY (ms))
pspatel321 38:8efacce315ae 24 DC_DC dcdc(p18, p20, p26, p25, p24, p23, 0.01, 5, 1);// DC-DC converter & high-current load control (CONTROL PIN, CURRENT SENSE PIN, FAN1 PIN, FAN2 PIN, PUMP1 PIN, PUMP2 PIN, PWM PERIOD (sec), FULL-SCALE SLEW (sec))
pspatel321 30:91af74a299e1 25 Temperature internalTmp(&NXFT15XH103_TABLE, p15); // Temperature conversion look-up table for internal temperature on the GLV bat charger FET (TABLE PTR, PIN)
pspatel321 39:ddf38df9699e 26 //XbeeManager xbeeRelay(p9, p10, p13, p14, XBEE_BAUD, 1, 1);
pspatel321 39:ddf38df9699e 27 MODSERIAL pc(USBTX, USBRX, 1, RX_SIZE); // Software buffered serial
pspatel321 39:ddf38df9699e 28 XbeeRelay xbee;
pspatel321 30:91af74a299e1 29 DigitalOut extras[] = {(p16), (p17)}; // Unused analog pins driven low