CF/BF - SPRACINGF3 - Use slower MSP displayport data rate when disarmed
[betaflight.git] / src / main / io / osd.h
blob4ef01a3cecbdce674ee1af0de35e1c3068ca4b9b
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #ifdef OSD
21 #include "common/time.h"
22 #include "config/parameter_group.h"
24 #define VISIBLE_FLAG 0x0800
25 #define VISIBLE(x) (x & VISIBLE_FLAG)
26 #define OSD_POS_MAX 0x3FF
27 #define OSD_POSCFG_MAX (VISIBLE_FLAG|0x3FF) // For CLI values
29 typedef enum {
30 OSD_RSSI_VALUE,
31 OSD_MAIN_BATT_VOLTAGE,
32 OSD_CROSSHAIRS,
33 OSD_ARTIFICIAL_HORIZON,
34 OSD_HORIZON_SIDEBARS,
35 OSD_ONTIME,
36 OSD_FLYTIME,
37 OSD_FLYMODE,
38 OSD_CRAFT_NAME,
39 OSD_THROTTLE_POS,
40 OSD_VTX_CHANNEL,
41 OSD_CURRENT_DRAW,
42 OSD_MAH_DRAWN,
43 OSD_GPS_SPEED,
44 OSD_GPS_SATS,
45 OSD_ALTITUDE,
46 OSD_ROLL_PIDS,
47 OSD_PITCH_PIDS,
48 OSD_YAW_PIDS,
49 OSD_POWER,
50 OSD_PIDRATE_PROFILE,
51 OSD_MAIN_BATT_WARNING,
52 OSD_AVG_CELL_VOLTAGE,
53 OSD_GPS_LON,
54 OSD_GPS_LAT,
55 OSD_ITEM_COUNT // MUST BE LAST
56 } osd_items_e;
58 typedef enum {
59 OSD_UNIT_IMPERIAL,
60 OSD_UNIT_METRIC
61 } osd_unit_e;
63 typedef struct osdConfig_s {
64 uint16_t item_pos[OSD_ITEM_COUNT];
66 // Alarms
67 uint8_t rssi_alarm;
68 uint16_t cap_alarm;
69 uint16_t time_alarm;
70 uint16_t alt_alarm;
72 osd_unit_e units;
73 } osdConfig_t;
75 extern uint32_t resumeRefreshAt;
77 PG_DECLARE(osdConfig_t, osdConfig);
79 struct displayPort_s;
80 void osdInit(struct displayPort_s *osdDisplayPort);
81 void osdResetConfig(osdConfig_t *osdProfile);
82 void osdResetAlarms(void);
83 void osdUpdate(timeUs_t currentTimeUs);
85 #endif