comparison Common/Inc/data_exchange.h @ 981:c6c781a2e85b default

Merge into default
author heinrichsweikamp
date Tue, 11 Feb 2025 18:12:00 +0100 (3 months ago)
parents 3420e3ba698d
children c317130aaafc
comparison
equal deleted inserted replaced
871:f7318457df4d 981:c6c781a2e85b
31 #include "settings.h" 31 #include "settings.h"
32 #include "stm32f4xx_hal.h" 32 #include "stm32f4xx_hal.h"
33 33
34 /* Command definitions for control of external interface */ 34 /* Command definitions for control of external interface */
35 /* 1st nibble binary on/off states */ 35 /* 1st nibble binary on/off states */
36 /* 2nd nibble UART protocol selection */ 36 /* 2nd nibble target sensor ID (if sensor command is active) */
37 /* 3rd nibble reserve */ 37 /* 3rd nibble sensor commands */
38 /* 4th nibble command channel */ 38 /* 4th nibble control channel */
39 #define EXT_INTERFACE_33V_ON (0x8000u) /* Bit set to enable 3.3V power interface */ 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 */ 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 */ 41 #define EXT_INTERFACE_BUZZER_ON (0x2000u) /* Bit set to enable the buzzer */
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_UART_O2 (0x0400u) /* Activate digital o2 sensor protocol (DiveO2) */
45 42
46 /* Command subset */ 43 /* Command subset */
47 #define EXT_INTERFACE_AUTODETECT (0x0001u) /* Start auto detection of connected sensors */ 44 #define EXT_INTERFACE_AUTODETECT (0x0001u) /* Start auto detection of connected sensors */
48 #define EXT_INTERFACE_COPY_SENSORMAP (0x0002u) /* Use the sensor map provided by master for internal operations */ 45 #define EXT_INTERFACE_COPY_SENSORMAP (0x0002u) /* Use the sensor map provided by master for internal operations */
49 #define EXT_INTERFACE_CO2_CALIB (0x0010u) /* Request calibration of CO2Sensor */ 46 #define EXT_INTERFACE_CO2_CALIB (0x0010u) /* Request calibration of CO2Sensor */
54 51
55 #define EXTIF_SENSOR_INFO_SIZE (32u) /* size of data array reserved for extended sensor data from external interface */ 52 #define EXTIF_SENSOR_INFO_SIZE (32u) /* size of data array reserved for extended sensor data from external interface */
56 53
57 #define CO2_WARNING_LEVEL_PPM (2000u) /* Early warning to indicate unexpected high co2 concentration (yellow) */ 54 #define CO2_WARNING_LEVEL_PPM (2000u) /* Early warning to indicate unexpected high co2 concentration (yellow) */
58 #define CO2_ALARM_LEVEL_PPM (5000u) /* starting by this level CO2 has a negative impact on health (long exposure) */ 55 #define CO2_ALARM_LEVEL_PPM (5000u) /* starting by this level CO2 has a negative impact on health (long exposure) */
56
57 #define GNSS_ALIVE_STATE_ALIVE (0x01u) /* Communication to module active */
58 #define GNSS_ALIVE_STATE_TIME (0x02u) /* Time information valid */
59 #define GNSS_ALIVE_BACKUP_POS (0x04u) /* Backup position not older than x hours */
59 60
60 enum MODE 61 enum MODE
61 { 62 {
62 MODE_SURFACE = 0, 63 MODE_SURFACE = 0,
63 MODE_DIVE = 1, 64 MODE_DIVE = 1,
200 uint8_t button_setting[4]; /* see dependency to SlaveData->buttonPICdata */ 201 uint8_t button_setting[4]; /* see dependency to SlaveData->buttonPICdata */
201 uint8_t SPARE1; 202 uint8_t SPARE1;
202 //debug 203 //debug
203 uint32_t pressure_uTick; 204 uint32_t pressure_uTick;
204 uint32_t compass_uTick; 205 uint32_t compass_uTick;
206 SGnssInfo gnssInfo;
205 207
206 } SExchangeData; 208 } SExchangeData;
207 209
208 typedef struct 210 typedef struct
209 { 211 {