4-10-2015 BAE_RTOS_TEST ACS_DATA_ACQ and I2C working
Fork of BAE_RTOS_TEST1 by
HK.h@1:b8c71afbe6e5, 2015-10-04 (annotated)
- Committer:
- gkumar
- Date:
- Sun Oct 04 07:06:22 2015 +0000
- Revision:
- 1:b8c71afbe6e5
4-10-2015 BAE_RTOS_TEST1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gkumar | 1:b8c71afbe6e5 | 1 | //to be saved as HK.h |
gkumar | 1:b8c71afbe6e5 | 2 | |
gkumar | 1:b8c71afbe6e5 | 3 | #include "mbed.h" |
gkumar | 1:b8c71afbe6e5 | 4 | #define tstart -40 |
gkumar | 1:b8c71afbe6e5 | 5 | #define tstep 8 |
gkumar | 1:b8c71afbe6e5 | 6 | #define tstep_thermistor 8//verify!! |
gkumar | 1:b8c71afbe6e5 | 7 | #define tstart_thermistor -40 |
gkumar | 1:b8c71afbe6e5 | 8 | #define vstart 3.3 |
gkumar | 1:b8c71afbe6e5 | 9 | #define vstep 0.84667 |
gkumar | 1:b8c71afbe6e5 | 10 | #define cstart 0.0691 |
gkumar | 1:b8c71afbe6e5 | 11 | #define cstep 0.09133 |
gkumar | 1:b8c71afbe6e5 | 12 | #define rsens 0.095 |
gkumar | 1:b8c71afbe6e5 | 13 | #define Bnewvalue_start -100//in microTesla...max possible field is .0001 T |
gkumar | 1:b8c71afbe6e5 | 14 | #define Bnewvalue_step 13.333 |
gkumar | 1:b8c71afbe6e5 | 15 | #define AngularSpeed_start -10//max possible ang. velocity in space is 10 deg/sec |
gkumar | 1:b8c71afbe6e5 | 16 | #define AngularSpeed_step 1.3333 |
gkumar | 1:b8c71afbe6e5 | 17 | |
gkumar | 1:b8c71afbe6e5 | 18 | |
gkumar | 1:b8c71afbe6e5 | 19 | |
gkumar | 1:b8c71afbe6e5 | 20 | typedef struct SensorData |
gkumar | 1:b8c71afbe6e5 | 21 | { |
gkumar | 1:b8c71afbe6e5 | 22 | float Voltage[16]; |
gkumar | 1:b8c71afbe6e5 | 23 | float Current[8]; |
gkumar | 1:b8c71afbe6e5 | 24 | float Temperature[1]; |
gkumar | 1:b8c71afbe6e5 | 25 | float PanelTemperature[4]; |
gkumar | 1:b8c71afbe6e5 | 26 | float BatteryTemperature; //to be populated |
gkumar | 1:b8c71afbe6e5 | 27 | char faultpoll; //polled faults |
gkumar | 1:b8c71afbe6e5 | 28 | char faultir; //interrupted faults |
gkumar | 1:b8c71afbe6e5 | 29 | char power_mode; //power modes |
gkumar | 1:b8c71afbe6e5 | 30 | |
gkumar | 1:b8c71afbe6e5 | 31 | float AngularSpeed[3]; //in order x,y,z |
gkumar | 1:b8c71afbe6e5 | 32 | float Bnewvalue[3]; //in order Bx,By,Bz |
gkumar | 1:b8c71afbe6e5 | 33 | |
gkumar | 1:b8c71afbe6e5 | 34 | |
gkumar | 1:b8c71afbe6e5 | 35 | } SensorData; |
gkumar | 1:b8c71afbe6e5 | 36 | |
gkumar | 1:b8c71afbe6e5 | 37 | |
gkumar | 1:b8c71afbe6e5 | 38 | typedef struct SensorDataQuantised { |
gkumar | 1:b8c71afbe6e5 | 39 | char Voltage[8]; |
gkumar | 1:b8c71afbe6e5 | 40 | char Current[4]; |
gkumar | 1:b8c71afbe6e5 | 41 | char Temperature[1]; |
gkumar | 1:b8c71afbe6e5 | 42 | char PanelTemperature[2];//read by the 4 thermistors on solar panels |
gkumar | 1:b8c71afbe6e5 | 43 | char BatteryTemperature; //to be populated |
gkumar | 1:b8c71afbe6e5 | 44 | char faultpoll; //polled faults |
gkumar | 1:b8c71afbe6e5 | 45 | char faultir; //interrupted faults |
gkumar | 1:b8c71afbe6e5 | 46 | char power_mode; //power modes |
gkumar | 1:b8c71afbe6e5 | 47 | char AngularSpeed[2]; |
gkumar | 1:b8c71afbe6e5 | 48 | char Bnewvalue[2]; |
gkumar | 1:b8c71afbe6e5 | 49 | |
gkumar | 1:b8c71afbe6e5 | 50 | //float magnetometer,gyro=>to be addes |
gkumar | 1:b8c71afbe6e5 | 51 | } SensorDataQuantised; |
gkumar | 1:b8c71afbe6e5 | 52 | |
gkumar | 1:b8c71afbe6e5 | 53 | |
gkumar | 1:b8c71afbe6e5 | 54 | typedef struct ShortBeacon |
gkumar | 1:b8c71afbe6e5 | 55 | { |
gkumar | 1:b8c71afbe6e5 | 56 | char Voltage[1]; //battery voltage from gauge, needs to be quantised |
gkumar | 1:b8c71afbe6e5 | 57 | char AngularSpeed[2]; //all the 3 data |
gkumar | 1:b8c71afbe6e5 | 58 | char SubsystemStatus[1]; //power modes |
gkumar | 1:b8c71afbe6e5 | 59 | char Temp[2]; //temp of solar panel |
gkumar | 1:b8c71afbe6e5 | 60 | //Temp[0]'s LSB=> PanelTemperature[0], Temp[0]'s MSB=> PanelTemperature[1], Temp[1]'s LSB=> PanelTemperature[2], Temp[1]'s MSB=> PanelTemperature[3] |
gkumar | 1:b8c71afbe6e5 | 61 | char ErrorFlag[1]; //fault |
gkumar | 1:b8c71afbe6e5 | 62 | }ShortBeacy; |
gkumar | 1:b8c71afbe6e5 | 63 | |
gkumar | 1:b8c71afbe6e5 | 64 | |
gkumar | 1:b8c71afbe6e5 | 65 | |
gkumar | 1:b8c71afbe6e5 | 66 | void FCTN_HK_MAIN(); |
gkumar | 1:b8c71afbe6e5 | 67 | |
gkumar | 1:b8c71afbe6e5 | 68 | int quantiz(float start,float step,float x); |
gkumar | 1:b8c71afbe6e5 | 69 | void init_beacon(ShortBeacy* x,SensorDataQuantised y); |