Don't handle non-MSP characters on VTX MSP port (#14091)
[betaflight.git] / src / main / drivers / max7456.h
blob154fa9e20681a6abd9e06d318cdf93f19903612a
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 <stdint.h>
25 #include "drivers/display.h"
27 /** PAL or NTSC, value is number of chars total */
28 #define VIDEO_BUFFER_CHARS_NTSC 390
29 #define VIDEO_BUFFER_CHARS_PAL 480
31 typedef enum {
32 // IO defined and MAX7456 was detected
33 MAX7456_INIT_OK = 0,
34 // IO defined, but MAX7456 could not be detected (maybe not yet
35 // powered on)
36 MAX7456_INIT_NOT_FOUND = -1,
37 // No MAX7456 IO defined, which means either the we don't have it or
38 // it's not properly configured
39 MAX7456_INIT_NOT_CONFIGURED = -2,
40 } max7456InitStatus_e;
42 extern uint16_t maxScreenSize;
43 struct vcdProfile_s;
44 void max7456HardwareReset(void);
45 struct max7456Config_s;
46 void max7456PreInit(const struct max7456Config_s *max7456Config);
47 max7456InitStatus_e max7456Init(const struct max7456Config_s *max7456Config, const struct vcdProfile_s *vcdProfile, bool cpuOverclock);
48 void max7456Invert(bool invert);
49 void max7456Brightness(uint8_t black, uint8_t white);
50 bool max7456ReInitIfRequired(bool forceStallCheck);
51 bool max7456DrawScreen(void);
52 bool max7456WriteNvm(uint8_t char_address, const uint8_t *font_data);
53 uint8_t max7456GetRowsCount(void);
54 void max7456Write(uint8_t x, uint8_t y, const char *text);
55 void max7456WriteChar(uint8_t x, uint8_t y, uint8_t c);
56 void max7456ClearScreen(void);
57 void max7456RefreshAll(void);
58 bool max7456DmaInProgress(void);
59 bool max7456BuffersSynced(void);
60 bool max7456LayerSupported(displayPortLayer_e layer);
61 bool max7456LayerSelect(displayPortLayer_e layer);
62 bool max7456LayerCopy(displayPortLayer_e destLayer, displayPortLayer_e sourceLayer);
63 bool max7456IsDeviceDetected(void);
64 void max7456SetBackgroundType(displayPortBackground_e backgroundType);