green rosh
/
i2c_master
I2C master
Fork of i2c_master by
Diff: master.h
- Revision:
- 1:14b369c0f314
- Parent:
- 0:7811fb22b3de
diff -r 7811fb22b3de -r 14b369c0f314 master.h --- a/master.h Mon Jun 30 11:55:18 2014 +0000 +++ b/master.h Tue Jul 15 10:06:29 2014 +0000 @@ -1,25 +1,22 @@ #include "mbed.h" //library // -#define get_hk_data 1 //sample telecommands -#define telecommand2 2 -#define telecommand3 3 -#define telecommand4 4 -#define telecommand5 5 -#define telecommand6 6 -#define telecommand7 7 -#define telecommand8 8 -#define telecommand9 9 -#define telecommand10 10 -I2C master (p28,p27); //configure pins p27,p28 as master -Serial pc (USBTX,USBRX); +#define get_hk_data '1' //sample telecommands +#define telecommand2 '2' +#define telecommand3 '3' +#define telecommand4 '4' +#define telecommand5 '5' +#define telecommand6 '6' +#define telecommand7 '7' +#define telecommand8 '8' +#define telecommand9 '9' +#define telecommand10 '10' -const int addr = 0x20; //slave address -float receive_byte(); -void FUNC_I2C_MASTER_MAIN(); - -struct SensorData +char receive_byte(); //funtion to receive float data + + +struct SensorData //HK_data_structure { - float voltage[10]; - float current[10]; - float temp[10]; - //float Battery[2]; -} Sensor; \ No newline at end of file + char voltage[10]; + char current[10]; + char temp[10]; +} ; +void FUNC_I2C_MASTER_MAIN(int command, int slave_address, int iterations); \ No newline at end of file