Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Committer:
pspatel321
Date:
Thu Nov 13 10:53:10 2014 +0000
Revision:
30:91af74a299e1
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?

UserRevisionLine numberNew contents of line
pspatel321 30:91af74a299e1 1 /* Test Code
pspatel321 30:91af74a299e1 2 #include "Battery_Status.h"
pspatel321 30:91af74a299e1 3 #include"mbed.h"
pspatel321 30:91af74a299e1 4 BatteryStatus battery;
pspatel321 30:91af74a299e1 5
pspatel321 30:91af74a299e1 6 int main()
pspatel321 30:91af74a299e1 7 {
pspatel321 30:91af74a299e1 8 //battery.write(6.92,0);
pspatel321 30:91af74a299e1 9 printf("LPC_RTC->GPREG0:%f\n\r",battery.read(0));
pspatel321 30:91af74a299e1 10 //battery.write(7.92,1);
pspatel321 30:91af74a299e1 11 printf("LPC_RTC->GPREG1:%f\n\r",battery.read(1));
pspatel321 30:91af74a299e1 12 //battery.write(8.92,2);
pspatel321 30:91af74a299e1 13 printf("LPC_RTC->GPREG2:%f\n\r",battery.read(2));
pspatel321 30:91af74a299e1 14 //battery.write(9.92,3);
pspatel321 30:91af74a299e1 15 printf("LPC_RTC->GPREG3:%f\n\r",battery.read(3));
pspatel321 30:91af74a299e1 16 //battery.write(10.92,4);
pspatel321 30:91af74a299e1 17 printf("LPC_RTC->GPREG4:%f\n\r",battery.read(4));
pspatel321 30:91af74a299e1 18 }
pspatel321 30:91af74a299e1 19 */
pspatel321 30:91af74a299e1 20
pspatel321 30:91af74a299e1 21 #ifndef _RTC_STORE_H
pspatel321 30:91af74a299e1 22 #define _RTC_STORE_H
pspatel321 30:91af74a299e1 23 #include "mbed.h"
pspatel321 30:91af74a299e1 24
pspatel321 30:91af74a299e1 25 class RTCStore {
pspatel321 30:91af74a299e1 26 public:
pspatel321 30:91af74a299e1 27 RTCStore() {
pspatel321 30:91af74a299e1 28 LPC_SC->PCONP |= (1<<9); // Enable RTC Peripheral
pspatel321 30:91af74a299e1 29 }
pspatel321 30:91af74a299e1 30 void write(float data, int block) {
pspatel321 30:91af74a299e1 31 *((float*)(&LPC_RTC->GPREG0)+block) = data;
pspatel321 30:91af74a299e1 32 }
pspatel321 30:91af74a299e1 33 float read(int block) {
pspatel321 30:91af74a299e1 34 return *((float*)(&LPC_RTC->GPREG0)+block);
pspatel321 30:91af74a299e1 35 }
pspatel321 30:91af74a299e1 36 };
pspatel321 30:91af74a299e1 37 #endif
pspatel321 30:91af74a299e1 38