Changes done in ECG and BT

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Committer:
nikitateggi
Date:
Fri Jun 09 17:12:21 2017 +0000
Revision:
19:1650bbc923cc
Parent:
14:f5c62d30c6fc
Child:
22:ffa88619551d
integrated code with bluetooth

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nidhinvarghese 14:f5c62d30c6fc 1 #ifndef STRUCT_H_
nidhinvarghese 14:f5c62d30c6fc 2 #define STRUCT_H_
nidhinvarghese 14:f5c62d30c6fc 3
nidhinvarghese 14:f5c62d30c6fc 4 #include "bp.h"
nidhinvarghese 14:f5c62d30c6fc 5 #include "glc.h"
nidhinvarghese 14:f5c62d30c6fc 6 #include "ecg_dec.h"
nikitateggi 19:1650bbc923cc 7 //#include "test_type.h"
nidhinvarghese 14:f5c62d30c6fc 8
nidhinvarghese 14:f5c62d30c6fc 9
nidhinvarghese 14:f5c62d30c6fc 10 typedef struct __attribute__((__packed__))
nidhinvarghese 14:f5c62d30c6fc 11 {
nidhinvarghese 14:f5c62d30c6fc 12 uint8_t date;
nidhinvarghese 14:f5c62d30c6fc 13 uint8_t month;
nidhinvarghese 14:f5c62d30c6fc 14 uint8_t year;
nidhinvarghese 14:f5c62d30c6fc 15 uint8_t hour;
nidhinvarghese 14:f5c62d30c6fc 16 uint8_t mins;
nidhinvarghese 14:f5c62d30c6fc 17 uint8_t sec;
nidhinvarghese 14:f5c62d30c6fc 18 }DateTime_info;
nidhinvarghese 14:f5c62d30c6fc 19
nidhinvarghese 14:f5c62d30c6fc 20 typedef struct __attribute__((__packed__))
nidhinvarghese 14:f5c62d30c6fc 21 {
nidhinvarghese 14:f5c62d30c6fc 22 uint16_t num_sample_ppg_dummy;
nidhinvarghese 14:f5c62d30c6fc 23 uint16_t num_sample_ecg_OTtyp;
nidhinvarghese 14:f5c62d30c6fc 24 }NumSamples_info;
nidhinvarghese 14:f5c62d30c6fc 25
nidhinvarghese 14:f5c62d30c6fc 26
nidhinvarghese 14:f5c62d30c6fc 27 typedef struct __attribute__((__packed__))
nidhinvarghese 14:f5c62d30c6fc 28 {
nidhinvarghese 14:f5c62d30c6fc 29 uint16_t cal_sbp_dummy;
nidhinvarghese 14:f5c62d30c6fc 30 uint16_t cal_dbp_OTtyp;
nidhinvarghese 14:f5c62d30c6fc 31 }CalData_info;
nidhinvarghese 14:f5c62d30c6fc 32
nikitateggi 19:1650bbc923cc 33 typedef enum
nikitateggi 19:1650bbc923cc 34 {
nikitateggi 19:1650bbc923cc 35 ACK = (uint8_t)0x00,
nikitateggi 19:1650bbc923cc 36 start_of_file,
nikitateggi 19:1650bbc923cc 37 end_of_file,
nikitateggi 19:1650bbc923cc 38 data_trfr,
nikitateggi 19:1650bbc923cc 39 NACK=0xff,
nikitateggi 19:1650bbc923cc 40 }bt_st;
nikitateggi 19:1650bbc923cc 41
nikitateggi 19:1650bbc923cc 42 typedef enum
nikitateggi 19:1650bbc923cc 43 {
nikitateggi 19:1650bbc923cc 44 BP_Test = (uint8_t )0x00, // removed Semi Colon and replaced with comma
nikitateggi 19:1650bbc923cc 45 BG_Test ,
nikitateggi 19:1650bbc923cc 46 ECG_Test,
nikitateggi 19:1650bbc923cc 47 }test_type_info;
nidhinvarghese 14:f5c62d30c6fc 48
nidhinvarghese 14:f5c62d30c6fc 49
nidhinvarghese 14:f5c62d30c6fc 50 typedef struct __attribute__((__packed__))
nidhinvarghese 14:f5c62d30c6fc 51 {
nidhinvarghese 14:f5c62d30c6fc 52 uint32_t length;
nidhinvarghese 14:f5c62d30c6fc 53 uint8_t device_id;
nidhinvarghese 14:f5c62d30c6fc 54 uint32_t patient_id;
nidhinvarghese 14:f5c62d30c6fc 55 DateTime_info date_time;
nidhinvarghese 14:f5c62d30c6fc 56 test_type_info test_type;
nidhinvarghese 14:f5c62d30c6fc 57 uint16_t sampling_freq;
nidhinvarghese 14:f5c62d30c6fc 58 NumSamples_info num_samples;
nidhinvarghese 14:f5c62d30c6fc 59 CalData_info cal_data;
nidhinvarghese 14:f5c62d30c6fc 60 }BLEMsg_info;
nidhinvarghese 14:f5c62d30c6fc 61
nikitateggi 19:1650bbc923cc 62 typedef enum
nikitateggi 19:1650bbc923cc 63 {
nikitateggi 19:1650bbc923cc 64 sos= (uint8_t)0xc0,
nikitateggi 19:1650bbc923cc 65 eos= (uint8_t)0xc0,
nikitateggi 19:1650bbc923cc 66 }file_st;
nikitateggi 19:1650bbc923cc 67
nikitateggi 19:1650bbc923cc 68
nikitateggi 19:1650bbc923cc 69
nikitateggi 19:1650bbc923cc 70 typedef struct __attribute__((__packed__))
nikitateggi 19:1650bbc923cc 71 {
nikitateggi 19:1650bbc923cc 72
nikitateggi 19:1650bbc923cc 73 file_st start_end_of_string;
nikitateggi 19:1650bbc923cc 74 uint32_t length_file;
nikitateggi 19:1650bbc923cc 75 bt_st proto;
nikitateggi 19:1650bbc923cc 76 BLEMsg_info bt_msg;
nikitateggi 19:1650bbc923cc 77 uint8_t chk_sum;
nikitateggi 19:1650bbc923cc 78
nikitateggi 19:1650bbc923cc 79 }Point;
nikitateggi 19:1650bbc923cc 80
nikitateggi 19:1650bbc923cc 81
nikitateggi 19:1650bbc923cc 82 uint8_t bt_send( uint8_t send_tx);
nikitateggi 19:1650bbc923cc 83 uint8_t bt_receive(uint8_t send_rx);
nikitateggi 19:1650bbc923cc 84 void send();
nikitateggi 19:1650bbc923cc 85 void sendinit();
nikitateggi 19:1650bbc923cc 86 void send_data_str1();
nikitateggi 19:1650bbc923cc 87 void send_data_str2();
nikitateggi 19:1650bbc923cc 88
nidhinvarghese 14:f5c62d30c6fc 89 #endif