Create release.yml
[betaflight.git] / src / main / osd / osd_elements.h
blobec09dec52e38733ce2a206b48741899c20f80496
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include "drivers/display.h"
25 #include "osd/osd.h"
27 typedef enum {
28 OSD_ELEMENT_TYPE_1 = 0,
29 OSD_ELEMENT_TYPE_2,
30 OSD_ELEMENT_TYPE_3,
31 OSD_ELEMENT_TYPE_4
32 } osdElementType_e;
34 typedef struct osdElementParms_s {
35 uint8_t item;
36 uint8_t elemPosX;
37 uint8_t elemPosY;
38 osdElementType_e type;
39 char *buff;
40 displayPort_t *osdDisplayPort;
41 bool drawElement;
42 uint8_t attr;
43 } osdElementParms_t;
45 typedef void (*osdElementDrawFn)(osdElementParms_t *element);
47 int osdConvertTemperatureToSelectedUnit(int tempInDegreesCelcius);
48 void osdFormatDistanceString(char *result, int distance, char leadingSymbol);
49 bool osdFormatRtcDateTime(char *buffer);
50 void osdFormatTime(char * buff, osd_timer_precision_e precision, timeUs_t time);
51 void osdFormatTimer(char *buff, bool showSymbol, bool usePrecision, int timerIndex);
52 float osdGetMetersToSelectedUnit(int32_t meters);
53 char osdGetMetersToSelectedUnitSymbol(void);
54 int32_t osdGetSpeedToSelectedUnit(int32_t value);
55 char osdGetSpeedToSelectedUnitSymbol(void);
56 char osdGetTemperatureSymbolForSelectedUnit(void);
57 void osdAddActiveElements(void);
58 uint8_t osdGetActiveElement();
59 uint8_t osdGetActiveElementCount();
60 bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort, timeUs_t currentTimeUs);
61 void osdDrawActiveElementsBackground(displayPort_t *osdDisplayPort);
62 void osdElementsInit(bool backgroundLayerFlag);
63 void osdSyncBlink();
64 void osdResetAlarms(void);
65 void osdUpdateAlarms(void);
66 bool osdElementsNeedAccelerometer(void);