comparison Common/Inc/data_exchange.h @ 696:cc542448fb28

Merge
author heinrichsweikamp
date Fri, 19 Aug 2022 11:30:24 +0200
parents 52d68cf9994c
children 6d7c812fc173
comparison
equal deleted inserted replaced
661:87bee7cc77b3 696:cc542448fb28
28 #define DATA_EXCHANGE_H 28 #define DATA_EXCHANGE_H
29 29
30 #include "data_central.h" 30 #include "data_central.h"
31 #include "settings.h" 31 #include "settings.h"
32 #include "stm32f4xx_hal.h" 32 #include "stm32f4xx_hal.h"
33
34 /* Command definitions for control of external interface */
35 /* 1st nibble binary on/off states */
36 /* 2nd nibble UART protocol selection */
37 /* 3rd nibble reserve */
38 /* 4th nibble command channel */
39 #define EXT_INTERFACE_33V_ON (0x8000u) /* Bit set to enable 3.3V power interface */
40 #define EXT_INTERFACE_ADC_ON (0x4000u) /* Bit set to enable ADC conversion */
41 #define EXT_INTERFACE_UART_MASK (0x0700u) /* Reserve 3 bits for UART protocol selection */
42 #define EXT_INTERFACE_UART_CO2 (0x0100u) /* Activate protocol for CO2 sensor */
43 #define EXT_INTERFACE_UART_SENTINEL (0x0200u) /* Activate Sentinel Backup monitor protocol */
44 #define EXT_INTERFACE_CO2_CALIB (0x0001u) /* Request calibration of CO2Sensor */
45
46 #define DATA_BUFFER_ADC (0x01u)
47 #define DATA_BUFFER_CO2 (0x02u)
33 48
34 enum MODE 49 enum MODE
35 { 50 {
36 MODE_SURFACE = 0, 51 MODE_SURFACE = 0,
37 MODE_DIVE = 1, 52 MODE_DIVE = 1,
78 93
79 94
80 #define CRBUTTON (0x01) 95 #define CRBUTTON (0x01)
81 #define CRDATE (0x02) 96 #define CRDATE (0x02)
82 #define CRTIME (0x04) 97 #define CRTIME (0x04)
83 #define CRCLEARDECO (0x08) 98 #define CRCLEARDECO (0x08)
84 #define CRCOMPASS (0x10) 99 #define CRCOMPASS (0x10)
85 #define CRDEVICEDATA (0x20) 100 #define CRDEVICEDATA (0x20)
101 #define CRBATTERY (0x40)
102 #define CRACCIDENT (0x80)
86 103
87 typedef union{ 104 typedef union{
88 confirmbit8_t ub; 105 confirmbit8_t ub;
89 uint8_t uw; 106 uint8_t uw;
90 } confirmbit8_Type; 107 } confirmbit8_Type;
146 float battery_charge; 163 float battery_charge;
147 //ambient light 164 //ambient light
148 uint16_t ambient_light_level; 165 uint16_t ambient_light_level;
149 uint16_t SPARE_ALIGN32; 166 uint16_t SPARE_ALIGN32;
150 float extADC_voltage[3]; 167 float extADC_voltage[3];
151 uint8_t SPARE_OldWireless[50]; /* 64 - 12 for extADC */ 168 uint16_t CO2_ppm;
169 uint16_t CO2_signalStrength;
170 uint16_t externalInterface_CmdAnswer;
171 uint8_t SPARE_OldWireless[44]; /* 64 - 12 for extADC - 6 for CO2 */
152 // PIC data 172 // PIC data
153 uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */ 173 uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */
154 uint8_t SPARE1; 174 uint8_t SPARE1;
155 //debug 175 //debug
156 uint32_t pressure_uTick; 176 uint32_t pressure_uTick;
164 SGas actualGas; 184 SGas actualGas;
165 185
166 int8_t offsetPressureSensor_mbar; 186 int8_t offsetPressureSensor_mbar;
167 int8_t offsetTemperatureSensor_centiDegree; 187 int8_t offsetTemperatureSensor_centiDegree;
168 188
169 uint8_t SPARE1; 189 uint16_t externalInterface_Cmd;
170 uint8_t SPARE2;
171 190
172 float UNUSED1[16-1];//VPM_adjusted_critical_radius_he[16]; 191 float UNUSED1[16-1];//VPM_adjusted_critical_radius_he[16];
173 float UNUSED2[16];//VPM_adjusted_critical_radius_n2[16]; 192 float UNUSED2[16];//VPM_adjusted_critical_radius_n2[16];
174 float UNUSED3[16];//VPM_adjusted_crushing_pressure_he[16]; 193 float UNUSED3[16];//VPM_adjusted_crushing_pressure_he[16];
175 float UNUSED4[16];//VPM_adjusted_crushing_pressure_n2[16]; 194 float UNUSED4[16];//VPM_adjusted_crushing_pressure_n2[16];
206 uint8_t RTE_VERSION_low; 225 uint8_t RTE_VERSION_low;
207 226
208 uint8_t chargeStatus; 227 uint8_t chargeStatus;
209 uint8_t boolPICdata; 228 uint8_t boolPICdata;
210 confirmbit8_Type confirmRequest; // confirmbit8_Type 229 confirmbit8_Type confirmRequest; // confirmbit8_Type
211 uint8_t boolWirelessData; 230 uint8_t boolADCO2Data;
212 231
213 uint8_t boolPressureData; 232 uint8_t boolPressureData;
214 uint8_t boolCompassData; 233 uint8_t boolCompassData;
215 uint8_t boolTisssueData; 234 uint8_t boolTisssueData;
216 uint8_t boolCrushingData; 235 uint8_t boolCrushingData;