dRonin
adbada4
dRonin firmware
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
pios_max7456_priv.h
Go to the documentation of this file.
1
11
/*
12
* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 3 of the License, or
15
* (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful, but
18
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20
* for more details.
21
*
22
* You should have received a copy of the GNU General Public License along
23
* with this program; if not, see <http://www.gnu.org/licenses/>
24
*
25
* Additional note on redistribution: The copyright and license notices above
26
* must be maintained in each individual source file that is a derivative work
27
* of this source file; otherwise redistribution is prohibited.
28
*/
29
30
#ifndef PIOS_MAX7456_PRIV_H_
31
#define PIOS_MAX7456_PRIV_H_
32
33
enum
pios_max7456_reg
{
34
MAX7456_REG_VM0
= 0x00,
35
MAX7456_REG_VM1
= 0x01,
36
MAX7456_REG_HOS
= 0x02,
37
MAX7456_REG_VOS
= 0x03,
38
MAX7456_REG_DMM
= 0x04,
39
MAX7456_REG_DMAH
= 0x05,
40
MAX7456_REG_DMAL
= 0x06,
41
MAX7456_REG_DMDI
= 0x07,
42
MAX7456_REG_CMM
= 0x08,
43
MAX7456_REG_CMAH
= 0x09,
44
MAX7456_REG_CMAL
= 0x0A,
45
MAX7456_REG_CMDI
= 0x0B,
46
MAX7456_REG_OSDM
= 0x0C,
47
MAX7456_REG_RB0
= 0x10,
48
MAX7456_REG_RB1
= 0x11,
49
MAX7456_REG_RB2
= 0x12,
50
MAX7456_REG_RB3
= 0x13,
51
MAX7456_REG_RB4
= 0x14,
52
MAX7456_REG_RB5
= 0x15,
53
MAX7456_REG_RB6
= 0x16,
54
MAX7456_REG_RB7
= 0x17,
55
MAX7456_REG_RB8
= 0x18,
56
MAX7456_REG_RB9
= 0x19,
57
MAX7456_REG_RB10
= 0x1A,
58
MAX7456_REG_RB11
= 0x1B,
59
MAX7456_REG_RB12
= 0x1C,
60
MAX7456_REG_RB13
= 0x1D,
61
MAX7456_REG_RB14
= 0x1E,
62
MAX7456_REG_RB15
= 0x1F,
63
MAX7456_REG_STAT
= 0x20,
64
MAX7456_REG_DMDO
= 0x30,
65
MAX7456_REG_CMDO
= 0x40,
66
MAX7456_REG_OSDBL
= 0x6C,
67
};
68
69
70
/* Video Mode 0 Register */
71
#define MAX7456_VM0_VBE_MASK (0b1)
72
#define MAX7456_VM0_VBE_R(val) (val & MAX7456_VM0_VBE_MASK)
73
#define MAX7456_VM0_VBE_W(regval, val) ((regval & ~MAX7456_VM0_VBE_MASK) | (val & MAX7456_VM0_VBE_MASK))
74
#define MAX7456_VM0_VBE_ENABLE 0b0
75
#define MAX7456_VM0_VBE_DISABLE 0b1
76
77
#define MAX7456_VM0_SRB_MASK (0b1 << 1)
78
#define MAX7456_VM0_SRB_R(val) ((val & MAX7456_VM0_SRB_MASK) >> 1)
79
#define MAX7456_VM0_SRB_W(regval, val) ((regval & ~MAX7456_VM0_SRB_MASK) | (val << 1 & MAX7456_VM0_SRB_MASK))
80
#define MAX7456_VM0_SRB_RESET 0b1
81
#define MAX7456_VM0_SRB_CLEAR 0b0
82
83
#define MAX7456_VM0_VS_MASK (0b1 << 2)
84
#define MAX7456_VM0_VS_R(val) ((val & MAX7456_VM0_VS_MASK) >> 2)
85
#define MAX7456_VM0_VS_W(regval, val) ((regval & ~MAX7456_VM0_VS_MASK) | (val << 2 & MAX7456_VM0_VS_MASK))
86
#define MAX7456_VM0_VS_VSYNC 0b1
87
#define MAX7456_VM0_VS_IMMEDIATE 0b0
88
89
#define MAX7456_VM0_OSD_MASK (0b1 << 3)
90
#define MAX7456_VM0_OSD_R(val) ((val & MAX7456_VM0_OSD_MASK) >> 3)
91
#define MAX7456_VM0_OSD_W(regval, val) ((regval & ~MAX7456_VM0_OSD_MASK) | (val << 3 & MAX7456_VM0_OSD_MASK))
92
#define MAX7456_VM0_OSD_ENABLE 0b1
93
#define MAX7456_VM0_OSD_DISABLE 0b0
94
95
96
#define MAX7456_VM0_SYNC_MASK (0b11 << 4)
97
#define MAX7456_VM0_SYNC_R(val) ((val & MAX7456_VM0_SYNC_MASK) >> 4)
98
#define MAX7456_VM0_SYNC_W(regval, val) ((regval & ~MAX7456_VM0_SYNC_MASK) | (val << 4 & MAX7456_VM0_SYNC_MASK))
99
#define MAX7456_VM0_SYNC_AUTO 0b00
100
#define MAX7456_VM0_SYNC_EXT 0b10
101
#define MAX7456_VM0_SYNC_INT 0b11
102
103
#define MAX7456_VM0_VSS_MASK (0b1 << 6)
104
#define MAX7456_VM0_VSS_R(val) ((val & MAX7456_VM0_VSS_MASK) >> 6)
105
#define MAX7456_VM0_VSS_W(regval, val) ((regval & ~MAX7456_VM0_VSS_MASK) | (val << 6 & MAX7456_VM0_VSS_MASK))
106
#define MAX7456_VM0_VSS_PAL 0b1
107
#define MAX7456_VM0_VSS_NTSC 0b0
108
109
/* Video Mode 1 Register */
110
#define MAX7456_VM1_BDUTY_MASK (0b11)
111
#define MAX7456_VM1_BDUTY_R(val) (val & MAX7456_VM1_BDUTY_MASK)
112
#define MAX7456_VM1_BDUTY_W(regval, val) ((regval & ~MAX7456_VM1_BDUTY_MASK) | (val & MAX7456_VM1_BDUTY_MASK))
113
#define MAX7456_VM1_BDUTY_BT 0b00
114
#define MAX7456_VM1_BDUTY_2BT 0b01
115
#define MAX7456_VM1_BDUTY_3BT 0b10
116
#define MAX7456_VM1_BDUTY_13BT 0b11
117
118
#define MAX7456_VM1_BTIME_MASK (0b11 << 2)
119
#define MAX7456_VM1_BTIME_R(val) ((val & MAX7456_VM1_BTIME_MASK) >> 2)
120
#define MAX7456_VM1_BTIME_W(regval, val) ((regval & ~MAX7456_VM1_BTIME_MASK) | (val << 2 & MAX7456_VM1_BTIME_MASK))
121
#define MAX7456_VM1_BTIME_2FIELD 0b00
122
#define MAX7456_VM1_BTIME_4FIELD 0b01
123
#define MAX7456_VM1_BTIME_6FIELD 0b10
124
#define MAX7456_VM1_BTIME_8FIELD 0b11
125
126
#define MAX7456_VM1_BGLVL_MASK (0b111 << 4)
127
#define MAX7456_VM1_BGLVL_R(val) ((val & MAX7456_VM1_BGLVL_MASK) >> 4)
128
#define MAX7456_VM1_BGLVL_W(regval, val) ((regval & ~MAX7456_VM1_BGLVL_MASK) | (val << 4 & MAX7456_VM1_BGLVL_MASK))
129
#define MAX7456_VM1_BGLVL_0 0b000
130
#define MAX7456_VM1_BGLVL_7 0b001
131
#define MAX7456_VM1_BGLVL_14 0b010
132
#define MAX7456_VM1_BGLVL_21 0b011
133
#define MAX7456_VM1_BGLVL_28 0b100
134
#define MAX7456_VM1_BGLVL_35 0b101
135
#define MAX7456_VM1_BGLVL_42 0b110
136
#define MAX7456_VM1_BGLVL_49 0b111
137
138
#define MAX7456_VM1_BGMODE_MASK (0b1 << 7)
139
#define MAX7456_VM1_BGMODE_R(val) ((val & MAX7456_VM1_BGMODE_MASK) >> 7)
140
#define MAX7456_VM1_BGMODE_W(regval, val) ((regval & ~MAX7456_VM1_BGMODE_MASK) | (val << 7 & MAX7456_VM1_BGMODE_MASK))
141
#define MAX7456_VM1_BGMODE_LOCAL 0b0
142
#define MAX7456_VM1_BGMODE_GRAY 0b1
143
144
/* Horizontal Offset Register */
145
#define MAX7456_HOS_POS_MASK (0x3f)
146
#define MAX7456_HOS_POS_R(val) (val & MAX7456_HOS_POS_MASK)
147
#define MAX7456_HOS_POS_W(regval, val) (val & MAX7456_HOS_POS_MASK)
148
149
/* Vertical Offset Register */
150
#define MAX7456_VOS_POS_MASK (0x3f)
151
#define MAX7456_VOS_POS_R(val) (val & MAX7456_VOS_POS_MASK)
152
#define MAX7456_VOS_POS_W(regval, val) (val & MAX7456_VOS_POS_MASK)
153
154
/* Display Memory Mode Register */
155
#define MAX7456_DMM_CLR_MASK (0b1 << 2)
156
#define MAX7456_DMM_CLR_R(val) ((val & MAX7456_DMM_CLR_MASK) >> 2)
157
#define MAX7456_DMM_CLR_W(regval, val) ((regval & ~MAX7456_DMM_CLR_MASK) | (val << 2 & MAX7456_DMM_CLR_MASK))
158
#define MAX7456_DMM_CLR_CLEAR 0b1
159
#define MAX7456_DMM_CLR_READY 0b0
160
161
/* OSD Black Level Register */
162
#define MAX7456_OSDBL_CTL_MASK (0b1 << 4)
163
#define MAX7456_OSDBL_CTL_R(val) ((val & MAX7456_OSDBL_CTL_MASK) >> 4)
164
#define MAX7456_OSDBL_CTL_W(regval, val) ((regval & ~MAX7456_OSDBL_CTL_MASK) | (val << 4 & MAX7456_OSDBL_CTL_MASK))
165
#define MAX7456_OSDBL_CTL_ENABLE 0b0
166
#define MAX7456_OSDBL_CTL_DISABLE 0b1
167
168
/* Status Register */
169
#define MAX7456_STAT_PAL_R(val) (val & 0b1)
170
#define MAX7456_STAT_PAL_TRUE 0b1
171
#define MAX7456_STAT_PAL_FALSE 0b0
172
#define MAX7456_STAT_NTSC_R(val) ((val >> 1) & 0b1)
173
#define MAX7456_STAT_NTSC_TRUE 0b1
174
#define MAX7456_STAT_NTSC_FALSE 0b0
175
#define MAX7456_STAT_SYNC_R(val) ((val >> 2) & 0b1)
176
#define MAX7456_STAT_SYNC_FALSE 0b1
177
#define MAX7456_STAT_SYNC_TRUE 0b0
178
#define MAX7456_STAT_HSYNC_R(val) ((val >> 3) & 0b1)
179
#define MAX7456_STAT_HSYNC_FALSE 0b1
180
#define MAX7456_STAT_HSYNC_TRUE 0b0
181
#define MAX7456_STAT_VSYNC_R(val) ((val >> 4) & 0b1)
182
#define MAX7456_STAT_VSYNC_FALSE 0b1
183
#define MAX7456_STAT_VSYNC_TRUE 0b0
184
#define MAX7456_STAT_CHMEM_R(val) ((val >> 5) & 0b1)
185
#define MAX7456_STAT_CHMEM_RDY 0b0
186
#define MAX7456_STAT_CHMEM_BUSY 0b1
187
#define MAX7456_STAT_RESET_R(val) ((val >> 6) & 0b1)
188
#define MAX7456_STAT_RESET_DONE 0b0
189
#define MAX7456_STAT_RESET_BUSY 0b1
190
191
/* Display memory data register magical 'no autoincrement' value */
192
#define MAX7456_DMDI_AUTOINCREMENT_STOP 0xff
193
194
/* Magical "write to NVM array" command */
195
#define MAX7456_CMM_WRITE_NVM 0xa0
196
197
/* "read char from NVM array" command */
198
#define MAX7456_CMM_READ_NVM 0x50
199
200
#endif // PIOS_MAX7456_PRIV_H_
201
MAX7456_REG_CMM
Definition:
pios_max7456_priv.h:42
MAX7456_REG_CMDI
Definition:
pios_max7456_priv.h:45
MAX7456_REG_CMAL
Definition:
pios_max7456_priv.h:44
pios_max7456_reg
pios_max7456_reg
Definition:
pios_max7456_priv.h:33
MAX7456_REG_HOS
Definition:
pios_max7456_priv.h:36
MAX7456_REG_RB3
Definition:
pios_max7456_priv.h:50
MAX7456_REG_RB8
Definition:
pios_max7456_priv.h:55
MAX7456_REG_OSDBL
Definition:
pios_max7456_priv.h:66
MAX7456_REG_RB12
Definition:
pios_max7456_priv.h:59
MAX7456_REG_RB13
Definition:
pios_max7456_priv.h:60
MAX7456_REG_DMDO
Definition:
pios_max7456_priv.h:64
MAX7456_REG_RB0
Definition:
pios_max7456_priv.h:47
MAX7456_REG_CMAH
Definition:
pios_max7456_priv.h:43
MAX7456_REG_VM0
Definition:
pios_max7456_priv.h:34
MAX7456_REG_DMM
Definition:
pios_max7456_priv.h:38
MAX7456_REG_RB14
Definition:
pios_max7456_priv.h:61
MAX7456_REG_RB2
Definition:
pios_max7456_priv.h:49
MAX7456_REG_RB7
Definition:
pios_max7456_priv.h:54
MAX7456_REG_RB15
Definition:
pios_max7456_priv.h:62
MAX7456_REG_RB4
Definition:
pios_max7456_priv.h:51
MAX7456_REG_RB6
Definition:
pios_max7456_priv.h:53
MAX7456_REG_CMDO
Definition:
pios_max7456_priv.h:65
MAX7456_REG_RB11
Definition:
pios_max7456_priv.h:58
MAX7456_REG_RB1
Definition:
pios_max7456_priv.h:48
MAX7456_REG_OSDM
Definition:
pios_max7456_priv.h:46
MAX7456_REG_VM1
Definition:
pios_max7456_priv.h:35
MAX7456_REG_DMAH
Definition:
pios_max7456_priv.h:39
MAX7456_REG_DMDI
Definition:
pios_max7456_priv.h:41
MAX7456_REG_RB10
Definition:
pios_max7456_priv.h:57
MAX7456_REG_DMAL
Definition:
pios_max7456_priv.h:40
MAX7456_REG_RB9
Definition:
pios_max7456_priv.h:56
MAX7456_REG_VOS
Definition:
pios_max7456_priv.h:37
MAX7456_REG_RB5
Definition:
pios_max7456_priv.h:52
MAX7456_REG_STAT
Definition:
pios_max7456_priv.h:63
flight
PiOS
inc
pios_max7456_priv.h
Generated by
1.8.6