-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdisplay.h
66 lines (65 loc) · 1.67 KB
/
display.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef DISPLAY_H
#define DISPLAY_H
//-----------------------------------------------------------------------------
#include "OSD.h"
//-----------------------------------------------------------------------------
enum PowerMode
{
POWER_MODE_FULL,
POWER_MODE_SAVING,
POWER_MODE_DOWN,
POWER_MODE_OFF
};
//-----------------------------------------------------------------------------
enum VideoSource
{
VS_AV0,
VS_AV1,
VS_AV2,
VS_AV3,
VS_VGA0,
VS_VGA1,
VS_HDMI0,
VS_HDMI1,
};
//-----------------------------------------------------------------------------
enum ADC_index
{
_ADC0 = 1,
_ADC1 = 2
};
//-----------------------------------------------------------------------------
struct DisplayConfig
{
RGB_color backgroundColor = 0x000080;
BYTE videoBrightness = 128;
BYTE videoContrast = 128;
BYTE videoHue = 0;
BYTE videoSaturation = 180;
};
//-----------------------------------------------------------------------------
class CDisplay
{
private:
void chipSoftwareReset();
void videoSoftwareReset();
void configurePins();
void configurePanel();
void setupColorConversions(const WORD* RGB2YUV_table, const WORD* YUV2RGB_table);
void setupDithering();
public:
void init(DisplayConfig& config);
void setPowerMode(PowerMode mode);
void on();
void off();
void hideVideo();
void showVideo(VideoSource source);
void setVideoBrightness(BYTE value);
void setVideoContrast(BYTE value);
void setVideoHue(BYTE value);
void setVideoSaturation(BYTE value);
};
//-----------------------------------------------------------------------------
#endif
extern CDisplay display;
extern COSD OSD;