dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
charosd.h
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  *
28  * Additional note on redistribution: The copyright and license notices above
29  * must be maintained in each individual source file that is a derivative work
30  * of this source file; otherwise redistribution is prohibited.
31  */
32 
33 #ifndef _CHAROSD_H
34 #define _CHAROSD_H
35 
36 #include "pios_max7456.h"
37 #include "charonscreendisplaysettings.h"
38 
39 #include "attitudeactual.h"
40 #include "flightbatterystate.h"
41 #include "flightstatus.h"
42 #include "gpsposition.h"
43 #include "positionactual.h"
44 #include "velocityactual.h"
45 
46 typedef struct {
47  FlightBatteryStateData battery;
48  AttitudeActualData attitude_actual;
49  PositionActualData position_actual;
50  VelocityActualData velocity_actual;
51  GPSPositionData gps_position;
52  struct {
53  int16_t rssi;
54  float thrust;
55  } manual;
56  struct {
57  FlightStatusArmedOptions arm_status;
58  SharedDefsFlightModeOptions mode;
59  } flight_status;
60  struct {
61  uint32_t flight_time;
62  } system;
63 } telemetry_t;
64 
65 typedef struct {
67 
69  char *custom_text;
70  uint8_t prev_font;
71  uint8_t video_standard;
72 
73  int available;
74 } * charosd_state_t;
75 
76 typedef void (*update_t) (charosd_state_t state, uint8_t x, uint8_t y);
77 
78 typedef struct
79 {
82 } panel_t;
83 
84 #define HAS_GPS (1 << 0)
85 #define HAS_BATT (1 << 1)
86 #define HAS_PITOT (1 << 2)
87 #define HAS_ALT (1 << 3)
88 #define HAS_TEMP (1 << 4)
89 #define HAS_RSSI (1 << 5)
90 #define HAS_NAV (1 << 6)
91 #define HAS_COMPASS (1 << 7)
92 
93 #define HAS_SENSOR(available, required) ((available & required) == required)
94 
95 // panels collection
96 extern const panel_t panels [];
97 extern const uint8_t panels_count;
98 
99 #define CHAROSD_CHAR_GPS_2D 0x01
100 #define CHAROSD_CHAR_GPS_3D 0x02
101 #define CHAROSD_CHAR_VARIO_DOWN1 0x03
102 #define CHAROSD_CHAR_VARIO_DOWN2 0x04
103 #define CHAROSD_CHAR_VARIO_DOWN3 0x05
104 #define CHAROSD_CHAR_VARIO_UP1 0x06
105 #define CHAROSD_CHAR_VARIO_UP2 0x07
106 #define CHAROSD_CHAR_VARIO_UP3 0x08
107 #define CHAROSD_CHAR_BULLET 0x09
108 #define CHAROSD_CHAR_CROSSHAIR 0x0a
109 #define CHAROSD_CHAR_GPS_SATL 0x10
110 #define CHAROSD_CHAR_GPS_SATR 0x11
111 #define CHAROSD_CHAR_HOME 0x12
112 #define CHAROSD_CHAR_BAR0 0x16
113 #define CHAROSD_CHAR_BAR1 0x17
114 #define CHAROSD_CHAR_BAR2 0x18
115 #define CHAROSD_CHAR_BAR3 0x19
116 #define CHAROSD_CHAR_BAR4 0x1a
117 #define CHAROSD_CHAR_BAR5 0x1b
118 #define CHAROSD_CHAR_BAR6 0x1c
119 #define CHAROSD_CHAR_BAR7 0x1d
120 #define CHAROSD_CHAR_BAR8 0x1e
121 #define CHAROSD_CHAR_FLAG 0x7f
122 #define CHAROSD_CHAR_GS 0x80
123 #define CHAROSD_CHAR_KMH 0x81
124 #define CHAROSD_CHAR_MAH 0x82
125 #define CHAROSD_CHAR_LAT 0x83
126 #define CHAROSD_CHAR_LON 0x84
127 #define CHAROSD_CHAR_ALT 0x85
128 #define CHAROSD_CHAR_VEL 0x86
129 #define CHAROSD_CHAR_THR 0x87
130 #define CHAROSD_CHAR_AIR 0x88
131 #define CHAROSD_CHAR_DEGC 0x8a
132 #define CHAROSD_CHAR_KM 0x8b
133 #define CHAROSD_CHAR_MS 0x8c
134 #define CHAROSD_CHAR_M 0x8d
135 #define CHAROSD_CHAR_V 0x8e
136 #define CHAROSD_CHAR_A 0x8f
137 #define CHAROSD_CHAR_ARROW_NL 0x90
138 #define CHAROSD_CHAR_ARROW_NR 0x91
139 #define CHAROSD_CHAR_ARROW_NNEL 0x92
140 #define CHAROSD_CHAR_ARROW_NNER 0x93
141 #define CHAROSD_CHAR_ARROW_NEL 0x94
142 #define CHAROSD_CHAR_ARROW_NER 0x95
143 #define CHAROSD_CHAR_ARROW_ENEL 0x96
144 #define CHAROSD_CHAR_ARROW_ENER 0x97
145 #define CHAROSD_CHAR_ARROW_EL 0x98
146 #define CHAROSD_CHAR_ARROW_ER 0x99
147 #define CHAROSD_CHAR_ARROW_ESEL 0x9a
148 #define CHAROSD_CHAR_ARROW_ESER 0x9b
149 #define CHAROSD_CHAR_ARROW_SEL 0x9c
150 #define CHAROSD_CHAR_ARROW_SER 0x9d
151 #define CHAROSD_CHAR_ARROW_SSEL 0x9e
152 #define CHAROSD_CHAR_ARROW_SSER 0x9f
153 #define CHAROSD_CHAR_ARROW_SL 0xa0
154 #define CHAROSD_CHAR_ARROW_SR 0xa1
155 #define CHAROSD_CHAR_ARROW_SSWL 0xa2
156 #define CHAROSD_CHAR_ARROW_SSWR 0xa3
157 #define CHAROSD_CHAR_ARROW_SWL 0xa4
158 #define CHAROSD_CHAR_ARROW_SWR 0xa5
159 #define CHAROSD_CHAR_ARROW_WSWL 0xa6
160 #define CHAROSD_CHAR_ARROW_WSWR 0xa7
161 #define CHAROSD_CHAR_ARROW_WL 0xa8
162 #define CHAROSD_CHAR_ARROW_WR 0xa9
163 #define CHAROSD_CHAR_ARROW_WNWL 0xaa
164 #define CHAROSD_CHAR_ARROW_WNWR 0xab
165 #define CHAROSD_CHAR_ARROW_NWL 0xac
166 #define CHAROSD_CHAR_ARROW_NWR 0xad
167 #define CHAROSD_CHAR_ARROW_NNWL 0xae
168 #define CHAROSD_CHAR_ARROW_NNWR 0xaf
169 #define CHAROSD_CHAR_DEG 0xb0
170 #define CHAROSD_CHAR_PITCH 0xb1
171 #define CHAROSD_CHAR_ROLL 0xb2
172 #define CHAROSD_CHAR_TIME 0xb3
173 #define CHAROSD_CHAR_RSSI 0xb4
174 #define CHAROSD_CHAR_YAW 0xb5
175 #define CHAROSD_CHAR_AHI_HUDL 0xb8
176 #define CHAROSD_CHAR_AHI_HUDR 0xb9
177 #define CHAROSD_CHAR_AHI_CENL 0xc8
178 #define CHAROSD_CHAR_AHI_CENR 0xc9
179 #define CHAROSD_CHAR_WINGL 0xbd
180 #define CHAROSD_CHAR_WINGM 0xbe
181 #define CHAROSD_CHAR_WINGR 0xbf
182 #define CHAROSD_CHAR_COMPASS_RULER_LOW 0xc0
183 #define CHAROSD_CHAR_COMPASS_RULER_HIGH 0xc1
184 #define CHAROSD_CHAR_COMPASS_NORTH 0xc2
185 #define CHAROSD_CHAR_COMPASS_SOUTH 0xc3
186 #define CHAROSD_CHAR_COMPASS_EAST 0xc4
187 #define CHAROSD_CHAR_COMPASS_WEST 0xc5
188 #define CHAROSD_CHAR_COMPASS_POINT 0xc6
189 #define CHAROSD_CHAR_COMPASS_INTERNAL 0xc7
190 #define CHAROSD_CHAR_COMPASS_GPS 0xb6
191 #define CHAROSD_CHAR_BOX_TL 0xd0
192 #define CHAROSD_CHAR_BOX_T 0xd1
193 #define CHAROSD_CHAR_BOX_TR 0xd2
194 #define CHAROSD_CHAR_BOX_R 0xd3
195 #define CHAROSD_CHAR_BOX_BL 0xd4
196 #define CHAROSD_CHAR_BOX_B 0xd5
197 #define CHAROSD_CHAR_BOX_BR 0xd6
198 #define CHAROSD_CHAR_BOX_L 0xd7
199 #define CHAROSD_CHAR_FILL_TL 0xd8
200 #define CHAROSD_CHAR_FILL_T 0xd9
201 #define CHAROSD_CHAR_FILL_TR 0xda
202 #define CHAROSD_CHAR_FILL_R 0xdb
203 #define CHAROSD_CHAR_FILL_BL 0xdc
204 #define CHAROSD_CHAR_FILL_B 0xdd
205 #define CHAROSD_CHAR_FILL_BR 0xde
206 #define CHAROSD_CHAR_FILL_L 0xdf
207 #define CHAROSD_CHAR_ARMED 0xe0
208 #define CHAROSD_CHAR_BIGC 0xe1
209 #define CHAROSD_CHAR_SIG1_H 0xe2
210 #define CHAROSD_CHAR_SIG2_HH 0xe3
211 #define CHAROSD_CHAR_SIG3_HH 0xe4
212 #define CHAROSD_CHAR_SIG1_L 0xe5
213 #define CHAROSD_CHAR_SIG2_HL 0xe6
214 #define CHAROSD_CHAR_SIG3_HL 0xe7
215 #define CHAROSD_CHAR_SIG23_LL 0xe8
216 #define CHAROSD_CHAR_POWER2 0xec
217 #define CHAROSD_CHAR_ENERGY2 0xed
218 #define CHAROSD_CHAR_BAT_CRIT 0xee
219 #define CHAROSD_CHAR_BAT_EMPTY 0xef
220 #define CHAROSD_CHAR_BAT_LOW 0xf0
221 #define CHAROSD_CHAR_BAT_MID 0xf1
222 #define CHAROSD_CHAR_BAT_HIGH 0xf2
223 #define CHAROSD_CHAR_BAT_FULL 0xf3
224 #define CHAROSD_CHAR_BAT2_CRIT 0xf4
225 #define CHAROSD_CHAR_BAT2_EMPTY 0xf5
226 #define CHAROSD_CHAR_BAT2_LOW 0xf6
227 #define CHAROSD_CHAR_BAT2_MID 0xf7
228 #define CHAROSD_CHAR_BAT2_HIGH 0xf8
229 #define CHAROSD_CHAR_BAT2_FULL 0xf9
230 #define CHAROSD_CHAR_POWER 0xfa
231 #define CHAROSD_CHAR_ENERGY 0xfb
232 #define CHAROSD_CHAR_LEFTRIGHT 0xfc
233 #define CHAROSD_CHAR_TEMP 0xfd
234 #define CHAROSD_CHAR_ROUTE 0xfe
235 
236 #endif // _CHAROSD_H
237 
update_t update
Definition: charosd.h:80
telemetry_t telemetry
Definition: charosd.h:68
const uint8_t panels_count
VelocityActualData velocity_actual
Definition: charosd.h:50
max7456_dev_t dev
Definition: charosd.h:66
AttitudeActualData attitude_actual
Definition: charosd.h:48
GPSPositionData gps_position
Definition: charosd.h:51
FlightStatusArmedOptions arm_status
Definition: charosd.h:57
struct max7456_dev_s * max7456_dev_t
Definition: pios_max7456.h:65
uint32_t flight_time
Definition: charosd.h:61
uint8_t video_standard
Definition: charosd.h:71
uint8_t prev_font
Definition: charosd.h:70
PositionActualData position_actual
Definition: charosd.h:49
float thrust
Definition: charosd.h:54
int16_t rssi
Definition: charosd.h:53
const panel_t panels[]
Definition: panel.c:485
SharedDefsFlightModeOptions mode
Definition: charosd.h:58
char * custom_text
Definition: charosd.h:69
FlightBatteryStateData battery
Definition: charosd.h:47
enum arena_state state
void(* update_t)(charosd_state_t state, uint8_t x, uint8_t y)
Definition: charosd.h:76
int requirements
Definition: charosd.h:81