hkstore
Dependencies: SDFileSystem mbed-rtos mbed
Fork of rtcfinalcodeyuppie by
rtsc.h@4:374c51671a69, 2014-12-22 (annotated)
- Committer:
- pradeepvk2208
- Date:
- Mon Dec 22 14:33:30 2014 +0000
- Revision:
- 4:374c51671a69
- Parent:
- 3:6cde88f8c50f
- Child:
- 5:3979ca24777a
final rtcsd
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pradeepvk2208 | 3:6cde88f8c50f | 1 | #include "mbed.h" |
pradeepvk2208 | 4:374c51671a69 | 2 | #include "SDFileSystem.h" |
pradeepvk2208 | 4:374c51671a69 | 3 | #include "string.h" |
pradeepvk2208 | 4:374c51671a69 | 4 | typedef struct SensorData { |
pradeepvk2208 | 4:374c51671a69 | 5 | char Voltage[8]; |
pradeepvk2208 | 4:374c51671a69 | 6 | char Current[4]; |
pradeepvk2208 | 4:374c51671a69 | 7 | char Temperature[1]; |
pradeepvk2208 | 4:374c51671a69 | 8 | char PanelTemperature[2];//read by the 4 thermistors on solar panels |
pradeepvk2208 | 4:374c51671a69 | 9 | char Vcell_soc;//MSBs correspond to Vcell, LSBs to Soc |
pradeepvk2208 | 4:374c51671a69 | 10 | char alerts;//UNQUANTISED |
pradeepvk2208 | 4:374c51671a69 | 11 | //(alerts[0]=1)-> reset indicator=>dont care |
pradeepvk2208 | 4:374c51671a69 | 12 | //(alerts[1]=1)-> Vcell>ValrtMax(5.1V)->will always be high->dont care |
pradeepvk2208 | 4:374c51671a69 | 13 | //(alerts[2]=1)-> Vcell<ValrtMin(5.1V)->indicates deep discharge |
pradeepvk2208 | 4:374c51671a69 | 14 | //(alerts[3]=1)-> Vcell<Vreset(2.5V) |
pradeepvk2208 | 4:374c51671a69 | 15 | //(alerts[5]=1)-> Soc CROSSES the threshold value |
pradeepvk2208 | 4:374c51671a69 | 16 | //(alerts[6]=1)-> alert on (alerts[3]) enabled when Vcell<Vreset(here we set it to be 2.5V) |
pradeepvk2208 | 4:374c51671a69 | 17 | char crate; |
pradeepvk2208 | 4:374c51671a69 | 18 | char BatteryTemperature; //to be populated |
pradeepvk2208 | 4:374c51671a69 | 19 | char faultpoll; //polled faults |
pradeepvk2208 | 4:374c51671a69 | 20 | char faultir; //interrupted faults |
pradeepvk2208 | 4:374c51671a69 | 21 | char power_mode; //power modes |
pradeepvk2208 | 4:374c51671a69 | 22 | char AngularSpeed[2]; |
pradeepvk2208 | 4:374c51671a69 | 23 | char Bnewvalue[2]; |
pradeepvk2208 | 4:374c51671a69 | 24 | |
pradeepvk2208 | 4:374c51671a69 | 25 | //float magnetometer,gyro=>to be addes |
pradeepvk2208 | 4:374c51671a69 | 26 | } SensorData; |
pradeepvk2208 | 3:6cde88f8c50f | 27 | |
pradeepvk2208 | 3:6cde88f8c50f | 28 | void spiwrite(int); |
pradeepvk2208 | 3:6cde88f8c50f | 29 | int spiread(int); |
pradeepvk2208 | 3:6cde88f8c50f | 30 | int hexint(int); |
pradeepvk2208 | 3:6cde88f8c50f | 31 | char* getname(int,int,int,int,int,int,int); |
pradeepvk2208 | 4:374c51671a69 | 32 | char* getts(void); |
pradeepvk2208 | 4:374c51671a69 | 33 | void storedata(char*,SensorData*); |