comparison Common/Inc/data_exchange.h @ 714:045ff7800501

Added customizable data area for specific sensor data: In future smart sensors will be connected via UART interface. These sensor provide additional data like diagnostics or id numbers which may vary from sensor to sensor. That's why a byte array has been added which stores up to 32 bytes. The layout of this array may be specific to sensor needs. As first example temperature and id number of the DiveO2 sensor are provided.
author Ideenmodellierer
date Sun, 20 Nov 2022 20:42:08 +0100
parents 6d7c812fc173
children 9b9ed5459d57
comparison
equal deleted inserted replaced
713:1fbcca5bdf5d 714:045ff7800501
50 #define EXT_INTERFACE_O2_INDICATE (0x0001u) /* Request LED to blink*/ 50 #define EXT_INTERFACE_O2_INDICATE (0x0001u) /* Request LED to blink*/
51 51
52 #define DATA_BUFFER_ADC (0x01u) 52 #define DATA_BUFFER_ADC (0x01u)
53 #define DATA_BUFFER_CO2 (0x02u) 53 #define DATA_BUFFER_CO2 (0x02u)
54 54
55 #define EXTIF_SENSOR_INFO_SIZE (32u) /* size of data array reserved for extended sensor data from external interface */
56
55 enum MODE 57 enum MODE
56 { 58 {
57 MODE_SURFACE = 0, 59 MODE_SURFACE = 0,
58 MODE_DIVE = 1, 60 MODE_DIVE = 1,
59 MODE_CALIB = 2, 61 MODE_CALIB = 2,
127 typedef struct 129 typedef struct
128 { 130 {
129 SDataExchangeHeader header; 131 SDataExchangeHeader header;
130 SLifeData lifeData; 132 SLifeData lifeData;
131 } SDataExchangeMasterToSlave; 133 } SDataExchangeMasterToSlave;
134
135 typedef struct
136 {
137 int32_t temperature;
138 uint32_t status;
139 uint64_t sensorId;
140 } SSensorDataDiveO2;
132 141
133 typedef struct 142 typedef struct
134 { 143 {
135 //pressure 144 //pressure
136 float temperature; 145 float temperature;
172 uint16_t SPARE_ALIGN32; 181 uint16_t SPARE_ALIGN32;
173 float extADC_voltage[3]; 182 float extADC_voltage[3];
174 uint16_t CO2_ppm; 183 uint16_t CO2_ppm;
175 uint16_t CO2_signalStrength; 184 uint16_t CO2_signalStrength;
176 uint16_t externalInterface_CmdAnswer; 185 uint16_t externalInterface_CmdAnswer;
177 uint8_t SPARE_OldWireless[44]; /* 64 - 12 for extADC - 6 for CO2 */ 186 uint8_t alignmentdummy;
187 uint8_t externalInterface_SensorID; /* Used to identify how to read the sensor data array */
188 uint8_t sensor_data[EXTIF_SENSOR_INFO_SIZE]; /* sensor specific data array. Content may vary from sensor type to sensor type */
189 uint8_t SPARE_OldWireless[10]; /* 64 - 12 for extADC - 6 for CO2 - 34 for sensor (+dummmy)*/
178 // PIC data 190 // PIC data
179 uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */ 191 uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */
180 uint8_t SPARE1; 192 uint8_t SPARE1;
181 //debug 193 //debug
182 uint32_t pressure_uTick; 194 uint32_t pressure_uTick;