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