annotate Common/Inc/data_central.h @ 1020:b0d3e8b84966 GasConsumption

Fix: Add Missing Compass Heading to the Logbook Reader. Fix: Add Missing Scrubber State to the Logbook Reader.
author heinrichsweikamp
date Fri, 20 Jun 2025 07:59:32 +0200
parents 8c0134a287da
children 677d293c669f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Common/Inc/data_central.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Common Dadatypes Declarations
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author Heinrichs Weikamp
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 2018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 #ifndef DATA_CENTRAL_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 #define DATA_CENTRAL_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include <stdint.h>
776
45b8f3c2acce Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents: 774
diff changeset
31 #include <stdbool.h>
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "settings.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "stm32f4xx_hal.h"
672
c00a80f26641 Added Charging view:
Ideenmodellierer
parents: 662
diff changeset
35 #include "configuration.h"
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #define BUEHLMANN_STRUCT_MAX_GASES 11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #define BUEHLMANN_STRUCT_MAX_ASCENDRATES 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #define DECOINFO_STRUCT_MAX_STOPS 50
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 #define false 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #define true 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
796
75ace7af8212 Expanded Sensor map structure:
Ideenmodellierer
parents: 788
diff changeset
44 #define EXT_INTERFACE_SENSOR_CNT (8u) /* 1 MUX + 7 sensors may be connected to the external interface (1 MUX + 3 ADC + 4 UART) */
75ace7af8212 Expanded Sensor map structure:
Ideenmodellierer
parents: 788
diff changeset
45 #define EXT_INTERFACE_MUX_OFFSET (3u) /* the sensor struct starts with 3 ADC sensors */
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
46
996
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
47 #define EXT_INTERFACE_BUZZER_ON_TIME_MS (2000u) /* max time the buzzer should be active without break (continuous Operation) */
8507a87f6401 Improve buzzer opreation:
Ideenmodellierer
parents: 951
diff changeset
48 #define EXT_INTERFACE_BUZZER_PING_TIME_MS (1000u) /* max time the buzzer should be active for single ping */
951
e9c37071933b Added vibration warning:
Ideenmodellierer
parents: 949
diff changeset
49 #define EXT_INTERFACE_BUZZER_STABLE_TIME_MS (500u) /* min time a state (ON / OFF) should be stable before it may be changed */
e9c37071933b Added vibration warning:
Ideenmodellierer
parents: 949
diff changeset
50
e9c37071933b Added vibration warning:
Ideenmodellierer
parents: 949
diff changeset
51
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 /* Helper structs ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 //struct SGas
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 //contains gasinfos of single gas for deco calculation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 uint8_t nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 uint8_t helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 uint8_t setPoint_cbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint8_t change_during_ascent_depth_meter_otherwise_zero;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t GasIdInSettings;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
63 uint8_t AppliedDiveMode;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
64 float pscr_factor;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 } SGas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 float use_from_depth_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 float rate_bar_per_minute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 } SAscentrate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 typedef struct{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 uint32_t date_rtc_dr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint32_t time_rtc_tr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 int32_t value_int32;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 } SDeviceLine;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 uint8_t numberOfBytes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 uint8_t status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 uint8_t data[12];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 } SDataWireless;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
89
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
90 typedef struct
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
91 {
748
be25ab2d902c Added display of co2 ppm values:
Ideenmodellierer
parents: 745
diff changeset
92 uint32_t CO2_ppm;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
93 uint16_t signalStrength;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
94 } SCO2Sensor;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
95
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 /* Main structs -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 //struct SDecoinfo
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 //contains result of deco calculation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 unsigned short output_stop_length_seconds[DECOINFO_STRUCT_MAX_STOPS];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 int output_time_to_surface_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 int output_ndl_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 float output_ceiling_meter;
247
3949781096d4 feature: Relative GF to Saturation renames
Jan Mulder <jlmulder@xs4all.nl>
parents: 225
diff changeset
107 float super_saturation;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 uint32_t tickstamp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 } SDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 //crushing pressure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 //in/out
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 float max_crushing_pressure_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 float max_crushing_pressure_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 //
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 float run_time_start_of_deco_zone_save;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 float depth_start_of_deco_zone_save;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 float max_first_stop_depth_save;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 short decomode_vpm_plus_conservatism_last_dive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 _Bool deco_zone_reached;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 //State variables for repetetive dives
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 _Bool repetitive_variables_not_valid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 float adjusted_crushing_pressure_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 float adjusted_crushing_pressure_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 float adjusted_critical_radius_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 float adjusted_critical_radius_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 float initial_allowable_gradient_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 float initial_allowable_gradient_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 float max_actual_gradient[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 } SVpm;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 _Bool repetitive_variables_not_valid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 _Bool is_data_from_RTE_CPU;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 _Bool spare2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 _Bool spare3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 float adjusted_crushing_pressure_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 float adjusted_crushing_pressure_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 float adjusted_critical_radius_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 float adjusted_critical_radius_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 float initial_allowable_gradient_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 float initial_allowable_gradient_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 float max_actual_gradient[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 } SVpmRepetitiveData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 //struct SDevice
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 //contains information about usage
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 SDeviceLine batteryChargeCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 SDeviceLine batteryChargeCompleteCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 SDeviceLine temperatureMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 SDeviceLine temperatureMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 SDeviceLine depthMaximum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 SDeviceLine diveCycles;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 SDeviceLine voltageMinimum;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 SDeviceLine hoursOfOperation;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 SDeviceLine diveAccident;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 } SDevice;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 SDevice device;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 SVpmRepetitiveData vpm;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 } SDeviceState;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
173 typedef struct
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
174 {
931
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
175 float fLat;
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
176 float fLon;
941
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
177 }SGnssCoord;
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
178
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
179
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
180 typedef struct
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
181 {
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
182 uint8_t year;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
183 uint8_t month;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
184 uint8_t day;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
185 uint8_t hour;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
186 uint8_t min;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
187 uint8_t sec;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
188 }SDateTime;
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
189
941
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
190 typedef struct
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
191 {
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
192 SGnssCoord coord;
940
4a406e873a95 GNSS improvments:
Ideenmodellierer
parents: 931
diff changeset
193 uint8_t alive;
931
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
194 uint8_t fixType;
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
195 uint8_t numSat; /* number of available satellites */
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
196 uint8_t signalQual[4]; /* signal quality indicator for x sats */
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
197 SDateTime DateTime; /* UTC time information */
931
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
198 } SGnssInfo;
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
199
945
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
200 typedef enum
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
201 {
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
202 SE_INIT = 0,
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
203 SE_REINIT,
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
204 SE_ACTIVE,
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
205 SE_END
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
206 } SSlowExitState;
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
207
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
208
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 /* struct SLifeData
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 * contains data all actual data (pressure, stuturation, etc. as received from second ship
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 * and has actualGas to be send to Small CPU (second chip)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 * contains data calculated from actual data after receiption from Small CPU
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 /* from Small CPU */
780
e40790a67165 Discovery<=>SmallCPU inferface update:
Ideenmodellierer
parents: 776
diff changeset
217 uint8_t extIf_sensor_data[3][32]; /* The external sensor may contain a 64 bit ID. It has been placed at the beginning of the structure to avoid problems in alignment */
752
4f19336a3f21 Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents: 748
diff changeset
218 uint8_t extIf_sensor_map[EXT_INTERFACE_SENSOR_CNT];
4f19336a3f21 Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents: 748
diff changeset
219
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 int32_t dive_time_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 int32_t dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 uint32_t surface_time_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 float pressure_ambient_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 float pressure_surface_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 float tissue_nitrogen_bar[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 float tissue_helium_bar[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 float cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 float otu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 uint16_t desaturation_time_minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 uint16_t no_fly_time_minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 float temperature_celsius;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 float compass_heading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 float compass_roll;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 float compass_pitch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 int16_t compass_DX_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 int16_t compass_DY_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 int16_t compass_DZ_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 uint16_t counterSecondsShallowDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 float ascent_rate_meter_per_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 uint32_t timeBinaryFormat;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 uint32_t dateBinaryFormat;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 float battery_voltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 float battery_charge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 uint16_t ambient_light_level;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 SDataWireless wireless_data[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 uint8_t buttonPICdata[4];
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
247 SCO2Sensor CO2_data;
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 672
diff changeset
248 uint8_t extIf_sensor_Id;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 /* by create DiveSettings() and by setActualGas()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 * is send to Small CPU2 for nitrogen calculation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 * includes setpoint information
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 SGas actualGas;
771
29d9b5bc7946 Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
heinrichsweikamp
parents: 752
diff changeset
255
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 uint8_t lastDiluent_GasIdInSettings;
771
29d9b5bc7946 Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
heinrichsweikamp
parents: 752
diff changeset
257 float lastSetpointChangeDepthM;
788
4abfb8a2a435 Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents: 780
diff changeset
258 bool setpointDecoActivated;
4abfb8a2a435 Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents: 780
diff changeset
259 bool setpointLowDelayed;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 /* calculated by DataEX_copy_to_LifeData()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 bottle_bar array size is made like this to have multiples of 32bit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 float ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 float depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 float max_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 float average_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 float apnea_total_max_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 float apnea_last_max_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 int32_t apnea_last_dive_time_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 uint16_t bottle_bar[2 * NUM_GASES +1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 uint16_t bottle_bar_age_MilliSeconds[2 * NUM_GASES + 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 uint16_t apnea_total_counter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 /* control of DataEX_copy_to_LifeData()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 uint8_t boolResetAverageDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 uint8_t bool_temp1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 uint8_t bool_temp2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 /* from local sensor or direct HUD communication */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 //pp O2 Sensor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 float ppO2Sensor_bar[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 float sensorVoltage_mV[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 float HUD_battery_voltage_V;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
286
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
287 /* for PSCR Mode */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
288 float ppo2Simulated_bar;
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
289 /* GNSS data */
931
5a9bc2e6112d Added Sat Status Overview:
Ideenmodellierer
parents: 929
diff changeset
290 SGnssInfo gnssData;
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents: 868
diff changeset
291
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 } SLifeData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 uint16_t tissue_nitrogen_desaturation_time_minutes[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 uint16_t tissue_helium_desaturation_time_minutes[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 } SLifeData2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 //warnings
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 int8_t decoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 int8_t aGf;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 int8_t ascentRateHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 int8_t ppO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 int8_t ppO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 int8_t cnsHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 int8_t slowWarning;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 int8_t lowBattery;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 int8_t numWarnings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 int8_t sensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 int8_t sensorOutOfBounds[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 int8_t betterGas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 int8_t fallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 int8_t betterSetpoint;
752
4f19336a3f21 Dev Bugfix: Alignment problem in lifedata structure:
Ideenmodellierer
parents: 748
diff changeset
319 int8_t co2High;
478
58200d756365 Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents: 309
diff changeset
320 #ifdef ENABLE_BOTTLE_SENSOR
58200d756365 Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents: 309
diff changeset
321 int8_t newPressure;
58200d756365 Development option only: Show Pressure update for a short time in the custom field (as warning)
ideenmodellierer
parents: 309
diff changeset
322 #endif
857
ba1aebc6d5af Developer feature debug warning:
Ideenmodellierer
parents: 842
diff changeset
323 #ifdef HAVE_DEBUG_WARNINGS
ba1aebc6d5af Developer feature debug warning:
Ideenmodellierer
parents: 842
diff changeset
324 int8_t debug;
ba1aebc6d5af Developer feature debug warning:
Ideenmodellierer
parents: 842
diff changeset
325 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 } SWarnings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 //Events logbook only
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 int16_t manualMarker;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 int16_t gasChange;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 int16_t info_GasChange;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 int16_t setpointChange;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 int16_t info_SetpointChange;
281
54d14bc2083c Fix typos (There are still many...)
heinrichsweikamp
parents: 271
diff changeset
337 int16_t manualGasSet;
54d14bc2083c Fix typos (There are still many...)
heinrichsweikamp
parents: 271
diff changeset
338 int16_t info_manualGasSetHe;
54d14bc2083c Fix typos (There are still many...)
heinrichsweikamp
parents: 271
diff changeset
339 int16_t info_manualGasSetO2;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 int16_t bailout;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 int16_t info_bailoutHe;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 int16_t info_bailoutO2;
929
63c340abd70e Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents: 925
diff changeset
343 int16_t compassHeadingUpdate;
63c340abd70e Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents: 925
diff changeset
344 uint16_t info_compassHeadingUpdate;
941
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
345 int16_t gnssPositionUpdate;
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 940
diff changeset
346 SGnssCoord info_gnssPosition;
1014
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 996
diff changeset
347 int16_t scrubberState;
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 996
diff changeset
348 uint16_t info_scrubberState;
929
63c340abd70e Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents: 925
diff changeset
349 } SEvents;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 //struct SDiveSettings
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 //contains settings necessary for deco calculation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 float last_stop_depth_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 float input_next_stop_increment_depth_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 float input_second_to_last_stop_depth_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 float ascentRate_meterperminute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 uint8_t diveMode; /* OC, CC, .. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 uint8_t CCR_Mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 uint8_t future_TTS_minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 /* If beginning of dive is CCR than ccrOption is set true
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 * true allows returning from bailout (OC) back to CCR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 * true activates CC gas and setpoint pages in dive menu
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 uint8_t ccrOption;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 uint8_t fallbackOption;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 uint8_t ppo2sensors_deactivated;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 split2x4_Type deco_type; /* GF or VPM for standard and alternative seperate */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 /* VPM conservatism, do not change during dive!!!
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 * do not change in between dives otherwise repetitve dive is not possible
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 uint8_t vpm_conservatism;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
902
d4622533271d VPM table mode:
Ideenmodellierer
parents: 899
diff changeset
380 /* VPM table mode, do not change during dive!!!
d4622533271d VPM table mode:
Ideenmodellierer
parents: 899
diff changeset
381 */
d4622533271d VPM table mode:
Ideenmodellierer
parents: 899
diff changeset
382 uint8_t vpm_tableMode;
d4622533271d VPM table mode:
Ideenmodellierer
parents: 899
diff changeset
383
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 /* B�hlmann GF
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 * and a variable that is used by Buehlmann during the dive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 * to remember the position of GF low during ascend
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 uint8_t gf_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 uint8_t gf_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 /* copy of the Settings GasList and SetpintList
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 * that can be modified during the dive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 * especially gases can be actived and deactivated
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 * gas[0] and setpoint[0] are the special ones configurable during the dive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 SGasLine gas[1 + (2*NUM_GASES)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 SSetpointLine setpoint[1 + NUM_GASES];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 /* List of GasChanges in the actual order
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 * this is necessary for VPM and Buehlmann and will be created on start of each calculation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 SGas decogaslist[BUEHLMANN_STRUCT_MAX_GASES]; // unused filled with 0xFF
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 float internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 uint16_t compassHeading;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
408
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
409 uint8_t pscr_o2_drop;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
410 uint8_t pscr_lung_ratio;
834
2a8af51ab04d Added event based display changes for big font view:
Ideenmodellierer
parents: 805
diff changeset
411
2a8af51ab04d Added event based display changes for big font view:
Ideenmodellierer
parents: 805
diff changeset
412 uint32_t activeAFViews;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 } SDiveSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 enum CHARGE_STATUS{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 CHARGER_off = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 CHARGER_running,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 CHARGER_complete,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 CHARGER_lostConnection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
422 typedef enum {
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
423 TIMER_STATE_OFF = 0,
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
424 TIMER_STATE_PRESTART,
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
425 TIMER_STATE_RUNNING,
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
426 TIMER_STATE_WAIT_FINISHED,
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
427 TIMER_STATE_FINISHED,
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
428 } timerState_e;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
429
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 SDiveSettings diveSettings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 SLifeData lifeData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 SVpm vpm;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 SEvents events;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 SWarnings warnings;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 SDecoinfo decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 SDecoinfo decolistFutureVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 SDecoinfo decolistBuehlmann; //
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 SDecoinfo decolistFutureBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 uint8_t mode; /* hw for sleep, surface, dive, .. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 uint8_t chargeStatus;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 uint8_t data_old__lost_connection_to_slave;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 uint32_t pressure_uTick_new;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 uint32_t compass_uTick_new;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 uint32_t pressure_uTick_old;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 uint32_t compass_uTick_old;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 uint32_t pressure_uTick_local_new;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 uint32_t compass_uTick_local_new;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 uint8_t cnsHigh_at_the_end_of_dive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 uint8_t decoMissed_at_the_end_of_dive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 uint8_t sensorErrorsRTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 uint8_t lastKnownBatteryPercentage;
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
460
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
461 timerState_e timerState;
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
462 int timerStartedS;
925
79c888f5d8d2 Bugfix scrubber time:
Ideenmodellierer
parents: 920
diff changeset
463
79c888f5d8d2 Bugfix scrubber time:
Ideenmodellierer
parents: 920
diff changeset
464 SScrubberData scrubberDataDive[2];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 } SDiveState;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 typedef struct{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 uint8_t bit0:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 uint8_t bit1:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 uint8_t bit2:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 uint8_t bit3:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 uint8_t bit4:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 uint8_t bit5:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 uint8_t bit6:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 uint8_t bit7:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 } ubit8_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 typedef union{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 ubit8_t ub;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 uint8_t uw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 } bit8_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 extern SDiveState stateSim;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 extern SDiveState stateDeco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 extern uint8_t decoLock;
271
1303747b5ba2 cleanup: also write gas and setpoint changes in simulator mode
Jan Mulder <jlmulder@xs4all.nl>
parents: 270
diff changeset
487 extern const SDiveState *stateUsed;
1303747b5ba2 cleanup: also write gas and setpoint changes in simulator mode
Jan Mulder <jlmulder@xs4all.nl>
parents: 270
diff changeset
488 extern SDiveState *stateUsedWrite;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 enum DECO_LOCK{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 DECO_CALC_running,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 DECO_CALC_ready,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 DECO_CALC_FINSHED_Buehlmann,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 DECO_CALC_FINSHED_vpm,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 DECO_CALC_FINSHED_FutureBuehlmann,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 DECO_CALC_FINSHED_Futurevpm,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 DECO_CALC_init_as_is_start_of_dive,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 DECO_CALC_undefined
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
501 typedef enum
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
502 {
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
503 SENSOR_NONE,
745
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
504 SENSOR_SEARCH,
733
7b0e020513e3 Optical sensor as default:
Ideenmodellierer
parents: 728
diff changeset
505 SENSOR_OPTIC,
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
506 SENSOR_ANALOG,
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
507 SENSOR_DIGO2,
796
75ace7af8212 Expanded Sensor map structure:
Ideenmodellierer
parents: 788
diff changeset
508 SENSOR_DIGO2M,
745
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
509 SENSOR_SENTINEL,
842
c3dd461ca3f9 Migrated Sentinel protocol to new UART structure:
Ideenmodellierer
parents: 834
diff changeset
510 SENSOR_SENTINELM,
745
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
511 SENSOR_TYPE_O2_END,
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
512 SENSOR_CO2,
799
1e3c12d772eb Added CO2 mirrow instance:
Ideenmodellierer
parents: 796
diff changeset
513 SENSOR_CO2M,
920
c4c9850a2039 Added view for position data:
Ideenmodellierer
parents: 902
diff changeset
514 SENSOR_GNSS,
c4c9850a2039 Added view for position data:
Ideenmodellierer
parents: 902
diff changeset
515 SENSOR_GNSSM,
780
e40790a67165 Discovery<=>SmallCPU inferface update:
Ideenmodellierer
parents: 776
diff changeset
516 SENSOR_MUX,
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
517 SENSOR_END
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
518 } externalInterfaceSensorType;
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
519
745
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
520 #define DVO2_FATAL_INTENSITY_LOW (0x00000001)
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
521 #define DVO2_FATAL_AMBIENT_HIGH (0x00000002)
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
522 #define DVO2_FATAL_REFINT_LOW (0x00000004)
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
523 #define DVO2_FATAL_REFAMB_HIGH (0x00000008)
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
524 #define DVO2_FATAL_TEMPERATURE (0x00000010)
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
525
b392524753fb Update Sentinel protocol:
Ideenmodellierer
parents: 733
diff changeset
526 #define DVO2_FATAL_ERROR (DVO2_FATAL_INTENSITY_LOW | DVO2_FATAL_AMBIENT_HIGH | DVO2_FATAL_REFINT_LOW | DVO2_FATAL_REFAMB_HIGH | DVO2_FATAL_TEMPERATURE)
728
5143e927219f Added sensor map to Firmware <=> RTE inferface:
Ideenmodellierer
parents: 714
diff changeset
527
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 uint32_t time_elapsed_ms(uint32_t ticksstart,uint32_t ticksnow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 void set_stateUsedToSim(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 void set_stateUsedToReal(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 _Bool is_stateUsedSetToSim(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 const SDiveState * stateRealGetPointer(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 const SDiveState * stateSimGetPointer(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 SDiveState * stateRealGetPointerWrite(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 SDiveState * stateSimGetPointerWrite(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 const SDevice * stateDeviceGetPointer(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 SDevice * stateDeviceGetPointerWrite(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 const SVpmRepetitiveData * stateVpmRepetitiveDataGetPointer(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 SVpmRepetitiveData * stateVpmRepetitiveDataGetPointerWrite(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 void UpdateLifeDataTest(SDiveState * diveState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 void setSimulationValues(int _ascent_rate_meter_per_min, int _descent_rate_meter_per_min, int _max_depth, int _bottom_time );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 void createDiveSettings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 void copyDiveSettingsToSim(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 void copyVpmRepetetiveDataToSim(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 //void fallbackToFixedSetpoints(SLifeData *lifeData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 void setActualGasFirst(SLifeData *lifeData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 void setActualGasAir(SLifeData *lifeData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 void setActualGas(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 void setActualGas_ExtraGas(SLifeData *lifeData, uint8_t oxygen, uint8_t helium, uint8_t setpoint_cbar);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 void setActualGas_DM(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 void setWeekday(RTC_DateTypeDef *sDate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 void setDate(RTC_DateTypeDef Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 void setTime(RTC_TimeTypeDef Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 void setBatteryPercentage(uint8_t newChargePercentage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 void setButtonResponsiveness(uint8_t *ButtonSensitivyList);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 void calibrateCompass(void);
539
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 478
diff changeset
563 void compass_Inertia(float newHeading);
d784f281833a Added inertia simulation for compass heading:
Ideenmodellierer
parents: 478
diff changeset
564 float compass_getCompensated();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 void clearDeco(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 void translateDate(uint32_t datetmpreg, RTC_DateTypeDef *sDate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 void translateTime(uint32_t tmpreg, RTC_TimeTypeDef *sTime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 void updateSetpointStateUsed(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 uint8_t calc_MOD(uint8_t gasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 uint8_t calc_MinOD(uint8_t gasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 //float calc_ppO2(float input_ambient_pressure_bar, SGas* pGas);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 int current_second(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 _Bool vpm_crush(SDiveState* pDiveState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 _Bool deco_zone_reached(void);
270
2e58a4094770 feature, debug: make simulator write a logbook entry
Jan Mulder <jlmulder@xs4all.nl>
parents: 247
diff changeset
576 void resetEvents(const SDiveState *pStateUsed);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 uint32_t crc32c_checksum(uint8_t* message, uint16_t length, uint8_t* message2, uint16_t length2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 uint32_t CRC_CalcBlockCRC(uint32_t *buffer, uint32_t words);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 uint32_t CRC_CalcBlockCRC_moreThan768000(uint32_t *buffer1, uint32_t *buffer2, uint32_t words);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 _Bool is_ambient_pressure_close_to_surface(SLifeData *lifeData);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
584 uint8_t isLoopMode(uint8_t Mode);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 539
diff changeset
585
776
45b8f3c2acce Add support for a configurable compass declination in a range of -99 to 99 degrees.
heinrichsweikamp
parents: 774
diff changeset
586 bool isCompassCalibrated(void);
929
63c340abd70e Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents: 925
diff changeset
587 void logCompassHeading(uint16_t heading);
63c340abd70e Add a line to the compass heading dive menu that shows the currently set heading to enable the
heinrichsweikamp
parents: 925
diff changeset
588 void clearCompassHeading(void);
774
6169309d6eb9 more menu items for the compass menu: Delete bearing, and reset to land based bearing. I have also re-enabled the real time bearing display in the menu - makes it easier to set the correct bearing. (mikeller)
heinrichsweikamp
parents: 771
diff changeset
589 void setCompassHeading(uint16_t heading);
788
4abfb8a2a435 Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents: 780
diff changeset
590
4abfb8a2a435 Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
heinrichsweikamp
parents: 780
diff changeset
591 const SDecoinfo *getDecoInfo(void);
805
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
592
dd7ce655db26 Adds a simple countdown timer, available as a custom view in surface and dive mode.
heinrichsweikamp
parents: 799
diff changeset
593 void disableTimer(void);
868
db92692c014f Introduce speed dependend coloring of depth:
Ideenmodellierer
parents: 857
diff changeset
594
db92692c014f Introduce speed dependend coloring of depth:
Ideenmodellierer
parents: 857
diff changeset
595 uint8_t drawingColor_from_ascentspeed(float speed);
db92692c014f Introduce speed dependend coloring of depth:
Ideenmodellierer
parents: 857
diff changeset
596
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 941
diff changeset
597 void convertStringOfDate_DDMMYY(char* pString, uint8_t strLen, uint8_t day, uint8_t month, uint8_t year);
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 941
diff changeset
598 void getStringOfFormat_DDMMYY(char* pString, uint8_t strLen);
949
c6b858f2e025 GNSS UTC in Date-Time menu:
Ideenmodellierer
parents: 945
diff changeset
599 void convertUTCToLocal(uint8_t utcHours, uint8_t utcMinutes, uint8_t* pLocalHours, uint8_t* pLocalMinutes);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 941
diff changeset
600
945
aad1a6b9aaec Added slow exit graph to t3 view:
Ideenmodellierer
parents: 944
diff changeset
601 uint8_t calculateSlowExit(uint16_t* pCountDownSec, float* pExitDepthMeter, uint8_t* pColor);
944
44599695df41 Restructure Date/Time menu:
Ideenmodellierer
parents: 941
diff changeset
602
1014
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 996
diff changeset
603 bool isScrubberTimerEnabled(const SSettings *settings);
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 996
diff changeset
604 bool isScrubberTimerRunning(const SDiveState *diveState, const SSettings *settings);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 #endif // DATA_CENTRAL_H