annotate Discovery/Inc/hud.h @ 1082:1aa45000f92c Icon_Integration tip

Added configuration menu for HUD functions: The V1 HUD has 4 functions (holes) which may be realized by one or two LEDs. The functions (like ppo2 monitoring or ascent speed) may be configurated by the diver using the HUD menu. The functions which may be selected depend on the HW configuration (e.g. the connected sensors) and the number of LEDs which are needed to realize the function. The previous HUD test implementation may still be activate usind the compile switch ENABLE_HUD_TESTING
author Ideenmodellierer
date Sun, 15 Mar 2026 21:40:35 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1082
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
3 ///
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
4 /// \file Discovery/Inc/hud.h
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
5 /// \brief
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
6 /// \author Heinrichs Weikamp
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
7 /// \date 2026
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
8 ///
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
9 /// $Id$
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
10 ///////////////////////////////////////////////////////////////////////////////
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
11 /// \par Copyright (c) 2014-2026 Heinrichs Weikamp gmbh
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
12 ///
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
13 /// This program is free software: you can redistribute it and/or modify
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
14 /// it under the terms of the GNU General Public License as published by
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
15 /// the Free Software Foundation, either version 3 of the License, or
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
16 /// (at your option) any later version.
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
17 ///
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
18 /// This program is distributed in the hope that it will be useful,
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
21 /// GNU General Public License for more details.
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
22 ///
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
23 /// You should have received a copy of the GNU General Public License
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
25 //////////////////////////////////////////////////////////////////////////////
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
26
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
27 #ifndef HUD_H
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
28 #define HUD_H
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
29
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
30 #include <stdint.h>
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
31 #include <stdio.h>
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
32 #include <string.h>
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
33
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
34 #include "text_multilanguage.h"
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
35
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
36 #define NUM_OF_HUD_FCT (4u) /* number of different functions which may be displayed at HUD at once */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
37 #define HUD_INFO_DATA_LENGTH (24u) /* expected number of received info data */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
38 #define HUD_INFO_INFOSTR_LENGTH (16u)
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
39
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
40
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
41 #define HUD_INFO_INFOSTR_OFFSET (3u) /* offset of info string */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
42 #define HUD_INFO_VERSION_OFFSET (19u) /* offset of version byte */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
43
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
44 enum hudFct
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
45 {
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
46 HUD_FCT_NONE = 0, /* Slot will not be used */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
47 HUD_FCT_WARNING, /* Show common warning indicator */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
48 HUD_FCT_PPO2SUM, /* Show combined PPO2 status */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
49 HUD_FCT_PPO2_0, /* Show individual PPO2 status (sensor 0) */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
50 HUD_FCT_PPO2_1, /* Show individual PPO2 status (sensor 1) */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
51 HUD_FCT_PPO2_2, /* Show individual PPO2 status (sensor 2) */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
52 HUD_FCT_ASCENT_SPEED, /* Show indicator for ascent speed */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
53 HUD_FCT_DECO, /* Show deco / depth indicator */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
54 HUD_FCT_END
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
55 };
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
56
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
57 void hud_Init(void);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
58 void hud_GetString(uint8_t id, uint8_t* pText);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
59 uint8_t hud_NextFct(uint8_t curFct, uint8_t fctId);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
60 void hud_UpdateStatus(void);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
61 uint8_t hud_IsActive(void);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
62 uint8_t hud_GetAddress(void);
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
63
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
64 #endif /* HUD_H */
1aa45000f92c Added configuration menu for HUD functions:
Ideenmodellierer
parents:
diff changeset
65