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)
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/>.
23 #include "drivers/display.h"
28 OSD_ELEMENT_TYPE_1
= 0,
34 typedef struct osdElementParms_s
{
38 osdElementType_e type
;
40 displayPort_t
*osdDisplayPort
;
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
);
64 void osdResetAlarms(void);
65 void osdUpdateAlarms(void);
66 bool osdElementsNeedAccelerometer(void);