Changes done in ECG and BT
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_20sept_2017_4th_oct_2017 by
struct.h@31:0f67acfc6236, 2017-07-15 (annotated)
- Committer:
- nikitateggi
- Date:
- Sat Jul 15 05:39:45 2017 +0000
- Revision:
- 31:0f67acfc6236
- Parent:
- 22:ffa88619551d
- Child:
- 44:05dbea558c9a
new display code 15/07/17
Who changed what in which revision?
User | Revision | Line number | New 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 | 22:ffa88619551d | 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 | 22:ffa88619551d | 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 | 22:ffa88619551d | 62 | /*typedef enum |
nikitateggi | 19:1650bbc923cc | 63 | { |
nikitateggi | 19:1650bbc923cc | 64 | sos= (uint8_t)0xc0, |
nikitateggi | 19:1650bbc923cc | 65 | eos= (uint8_t)0xc0, |
nikitateggi | 22:ffa88619551d | 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 | 22:ffa88619551d | 73 | uint8_t start_of_string; |
nikitateggi | 19:1650bbc923cc | 74 | uint32_t length_file; |
nikitateggi | 22:ffa88619551d | 75 | uint8_t proto; |
nikitateggi | 19:1650bbc923cc | 76 | BLEMsg_info bt_msg; |
nikitateggi | 22:ffa88619551d | 77 | uint8_t end_of_string; |
nikitateggi | 19:1650bbc923cc | 78 | uint8_t chk_sum; |
nikitateggi | 19:1650bbc923cc | 79 | |
nikitateggi | 19:1650bbc923cc | 80 | }Point; |
nikitateggi | 19:1650bbc923cc | 81 | |
nikitateggi | 19:1650bbc923cc | 82 | |
nikitateggi | 19:1650bbc923cc | 83 | uint8_t bt_send( uint8_t send_tx); |
nikitateggi | 19:1650bbc923cc | 84 | uint8_t bt_receive(uint8_t send_rx); |
nikitateggi | 19:1650bbc923cc | 85 | void send(); |
nikitateggi | 19:1650bbc923cc | 86 | void sendinit(); |
nikitateggi | 22:ffa88619551d | 87 | void sendlast(); |
nikitateggi | 19:1650bbc923cc | 88 | void send_data_str1(); |
nikitateggi | 22:ffa88619551d | 89 | void send_data_str2(uint8_t check_sum); |
nikitateggi | 31:0f67acfc6236 | 90 | //uint8_t checksum(uint32_t *v1); |
nikitateggi | 22:ffa88619551d | 91 | uint8_t checksum_init();; |
nikitateggi | 22:ffa88619551d | 92 | uint8_t checksum_last(); |
nikitateggi | 31:0f67acfc6236 | 93 | //uint8_t checksum_struct(); |
nikitateggi | 31:0f67acfc6236 | 94 | |
nikitateggi | 31:0f67acfc6236 | 95 | uint8_t checksum_struct(const uint8_t data[], uint16_t numBytes) ; |
nikitateggi | 31:0f67acfc6236 | 96 | uint8_t checksum(const uint8_t data[], uint32_t numBytes) ; |
nidhinvarghese | 14:f5c62d30c6fc | 97 | #endif |