comparison Common/Inc/data_exchange.h @ 691:52d68cf9994c Betatest

Improvment external interface usage: The previous implementation of the external interface was straight forward for ADC and Co2 UART usage. The new implementation provides the possibility to configurate the behavior of the external interface. e.g. Switching of external3,3V and ADC separatly and selection of UART protocol.
author Ideenmodellierer
date Fri, 05 Aug 2022 15:26:28 +0200
parents 1b995079c045
children 6d7c812fc173
comparison
equal deleted inserted replaced
690:fca2bd25e6e2 691:52d68cf9994c
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 33
34 /* Command definitions for contral of external interface */ 34 /* Command definitions for control of external interface */
35 #define EXT_INTERFACE_33V_ON (0x8000u) /* Bit set to enable 3.3V power interface */ 35 /* 1st nibble binary on/off states */
36 #define EXT_INTERFACE_CO2_CALIB (0x0001u) /* Request calibration of CO2Sensor */ 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)
37 48
38 enum MODE 49 enum MODE
39 { 50 {
40 MODE_SURFACE = 0, 51 MODE_SURFACE = 0,
41 MODE_DIVE = 1, 52 MODE_DIVE = 1,
214 uint8_t RTE_VERSION_low; 225 uint8_t RTE_VERSION_low;
215 226
216 uint8_t chargeStatus; 227 uint8_t chargeStatus;
217 uint8_t boolPICdata; 228 uint8_t boolPICdata;
218 confirmbit8_Type confirmRequest; // confirmbit8_Type 229 confirmbit8_Type confirmRequest; // confirmbit8_Type
219 uint8_t boolWirelessData; 230 uint8_t boolADCO2Data;
220 231
221 uint8_t boolPressureData; 232 uint8_t boolPressureData;
222 uint8_t boolCompassData; 233 uint8_t boolCompassData;
223 uint8_t boolTisssueData; 234 uint8_t boolTisssueData;
224 uint8_t boolCrushingData; 235 uint8_t boolCrushingData;