annotate Common/Inc/data_exchange.h @ 555:573a2bc796c8

Added HW_Info to Discovery <=> RTE data exchange: The information if an external ADC is supported and the type of the compass is forwarded to the Firmware software. This is especially needed to enable the menu structure to support calibration of external sensors
author Ideenmodellierer
date Thu, 12 Nov 2020 19:48:28 +0100
parents 8f8ea3a32e82
children 84a4e1200726
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_exchange.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Data exchange between RTE and Discovery processors.
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_EXCHANGE_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 #define DATA_EXCHANGE_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "data_central.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #include "settings.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "stm32f4xx_hal.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 enum MODE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 MODE_SURFACE = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 MODE_DIVE = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 MODE_CALIB = 2,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 MODE_SLEEP = 3,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 MODE_SHUTDOWN = 4,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 MODE_ENDDIVE = 5,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 MODE_BOOT = 6,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 MODE_CHARGESTART = 7,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 MODE_TEST = 8,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 MODE_POWERUP = 9,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 enum ACCIDENT_BITS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 ACCIDENT_DECOSTOP = 0x01,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 ACCIDENT_CNS = 0x02,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 ACCIDENT_CNSLVL2 = 0x02 + 0x04,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 ACCIDENT_SPARE2 = 0x08,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 ACCIDENT_SPARE3 = 0x10,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 ACCIDENT_SPARE4 = 0x20,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 ACCIDENT_SPARE5 = 0x40,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 ACCIDENT_SPARE6 = 0x80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 typedef struct{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint8_t button:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t date:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 uint8_t time:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 uint8_t clearDeco:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t compass:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint8_t devicedata:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t batterygauge:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t accident:1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 } confirmbit8_t;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70
555
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
71 typedef struct{
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
72 uint8_t reserve:7;
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
73 uint8_t extADC:1;
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
74 uint8_t compass:8;
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
75 } hw_Info_t;
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
76
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
77
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 #define CRBUTTON (0x01)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 #define CRDATE (0x02)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 #define CRTIME (0x04)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 #define CRCLEARDECO (0x08)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 #define CRCOMPASS (0x10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 #define CRDEVICEDATA (0x20)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 typedef union{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 confirmbit8_t ub;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 uint8_t uw;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 } confirmbit8_Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint8_t checkCode[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 } SDataExchangeHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 uint8_t checkCode[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 } SDataExchangeFooter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 SDataExchangeHeader header;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 SLifeData lifeData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 } SDataExchangeMasterToSlave;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 //pressure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 float temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 float pressure_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 float surface_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 float ascent_rate_meter_per_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 //toxic
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 float otu;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 float cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 uint16_t desaturation_time_minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 uint16_t no_fly_time_minutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 //tisssue
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 float tissue_nitrogen_bar[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 float tissue_helium_bar[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 //maxcrushingpressure
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 float max_crushing_pressure_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 float max_crushing_pressure_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 float adjusted_critical_radius_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 float adjusted_critical_radius_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 // Compass
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 float compass_heading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 float compass_roll;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 float compass_pitch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 int16_t compass_DX_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 int16_t compass_DY_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 int16_t compass_DZ_f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 //time
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 uint16_t counterSecondsShallowDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 uint32_t localtime_rtc_tr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 uint32_t localtime_rtc_dr;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 uint32_t divetime_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 uint32_t surfacetime_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 uint32_t dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 //battery /* take care of uint8_t count to be in multiplies of 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 float battery_voltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 float battery_charge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 //ambient light
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 uint16_t ambient_light_level;
555
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
147 uint16_t SPARE_ALIGN32;
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
148 float extADC_voltage[3];
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
149 uint8_t SPARE_OldWireless[50]; /* 64 - 12 for extADC */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 // PIC data
51
8f8ea3a32e82 Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents: 38
diff changeset
151 uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 uint8_t SPARE1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 //debug
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 uint32_t pressure_uTick;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 uint32_t compass_uTick;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 } SExchangeData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 uint8_t VPMconservatism;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 SGas actualGas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 int8_t offsetPressureSensor_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 int8_t offsetTemperatureSensor_centiDegree;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 uint8_t SPARE1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 uint8_t SPARE2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 float UNUSED1[16-1];//VPM_adjusted_critical_radius_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 float UNUSED2[16];//VPM_adjusted_critical_radius_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 float UNUSED3[16];//VPM_adjusted_crushing_pressure_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 float UNUSED4[16];//VPM_adjusted_crushing_pressure_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 float UNUSED5[16];//VPM_initial_allowable_gradient_he[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 float UNUSED6[16];//VPM_initial_allowable_gradient_n2[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 float UNUSED7[16];//VPM_max_actual_gradient[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 RTC_TimeTypeDef newTime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 RTC_DateTypeDef newDate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 float ambient_pressure_mbar_ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 float descend_rate_bar_per_minute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 float ascend_rate_bar_per_minute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 uint16_t timeoutDiveReachedZeroDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 uint16_t divetimeToCreateLogbook;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 uint8_t buttonResponsiveness[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 SDevice DeviceData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 float newBatteryGaugePercentageFloat;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 } SReceiveData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 SDataExchangeHeader header;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 uint8_t mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 uint8_t power_on_reset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 uint8_t RTE_VERSION_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 uint8_t RTE_VERSION_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 uint8_t chargeStatus;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 uint8_t boolPICdata;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 confirmbit8_Type confirmRequest; // confirmbit8_Type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 uint8_t boolWirelessData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 uint8_t boolPressureData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 uint8_t boolCompassData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 uint8_t boolTisssueData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 uint8_t boolCrushingData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 uint8_t boolToxicData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 uint8_t boolTimeData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 uint8_t boolBatteryData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 uint8_t boolAmbientLightData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 uint8_t accidentFlags;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 uint8_t sensorErrors;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 uint8_t spare2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 uint8_t spare3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 SExchangeData data[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 SDataExchangeFooter footer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 uint8_t CRC_feature_by_SPI[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 } SDataExchangeSlaveToMaster;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 SDataExchangeHeader header;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 uint8_t mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 uint8_t power_on_reset;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 uint8_t RTE_VERSION_high;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 uint8_t RTE_VERSION_low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 uint8_t chargeStatus;
555
573a2bc796c8 Added HW_Info to Discovery <=> RTE data exchange:
Ideenmodellierer
parents: 51
diff changeset
242 hw_Info_t hw_Info;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 uint8_t spare1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 uint8_t boolDeviceData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 uint8_t boolVpmRepetitiveDataValid;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 uint8_t bool3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 uint8_t bool4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 uint8_t spare1_1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 uint8_t spare1_2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 uint8_t spare1_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 uint8_t spare1_4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 uint8_t spare2_1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 uint8_t spare2_2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 uint8_t spare2_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 uint8_t spare2_4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 SDevice DeviceData[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 SVpmRepetitiveData VpmRepetitiveData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 uint8_t arraySizeOfMinimumSExChangeDate[(2 * sizeof(SExchangeData)) - ((2 * sizeof(SDevice)) + sizeof(SVpmRepetitiveData))];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 SDataExchangeFooter footer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 uint8_t CRC_feature_by_SPI[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 } SDataExchangeSlaveToMasterDeviceData;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 SDataExchangeHeader header;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 uint8_t mode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 uint8_t getDeviceDataNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 uint8_t diveModeInfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 uint8_t setEndDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 uint8_t bool4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 uint8_t setButtonSensitivityNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 uint8_t setDateNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 uint8_t setTimeNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 uint8_t calibrateCompassNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 uint8_t clearDecoNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 uint8_t setBatteryGaugeNow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 uint8_t bool9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 uint8_t revisionHardware;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 uint8_t revisionCRCx0x7A;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 uint8_t spare1_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 uint8_t spare1_4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 uint8_t setAccidentFlag;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 uint8_t spare2_1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 uint8_t spare2_2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 uint8_t spare2_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 SReceiveData data;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 uint8_t arraySizeOfMinimumSExChangeDate[(2 * sizeof(SExchangeData)) - sizeof(SReceiveData)];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 SDataExchangeFooter footer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 uint8_t CRC_feature_by_SPI[4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 } SDataReceiveFromMaster;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 /* Size of Transmission buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 #define EXCHANGE_BUFFERSIZE (sizeof(SDataExchangeSlaveToMaster) - 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 #define EXCHANGE_BUFFERSIZE2 (sizeof(SDataReceiveFromMaster) - 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 // header: 5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 // mode+bool: 5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 // data 552 ( 69 * float/4 * 2 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 // footer: 4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 // ______________
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 // SUM 566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 // CRC_feature does not count into BUFFERSIZE!
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 //(COUNTOF(struct SDataExchangeSlaveToMaster) + 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 //#define COUNTOF(__BUFFER__) (sizeof(__BUFFER__) / sizeof(*(__BUFFER__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #endif /* DATA_EXCHANGE_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322