-
Notifications
You must be signed in to change notification settings - Fork 9
/
vga_dirver_define.v
111 lines (98 loc) · 3.22 KB
/
vga_dirver_define.v
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//定义颜色变量RGB--5|6|5
//define colors RGB--5|6|5
//`define RED 16'hF800 /*111110,000000,000000 F800 红*/
//`define GREEN 16'h07E0 /*000000,111111,000000 07E0 绿*/
//`define BLUE 16'h001F /*000000,000000,111110 001F 蓝*/
//`define WHITE 16'hFFFF /*111110,111111,111110 FFFF 白*/
//`define BLACK 16'h0000 /*000000,000000,000000 0000 黑*/
//`define YELLOW 16'hFFE0 /*111110,111111,000000 FFE0 黄*/
//`define CYAN 16'hF81F /*111110,000000,111110 F81F 青*/
//`define ROYAL 16'h07FF /*000000,111111,111110 07FF 品*/
/*****************************************************************/
/* | 显示 |前沿|同步|后沿| 显示 |前沿|同步|后沿|
* |____| | |____| |
* ______________ ______________ ______________ ______________
* | 显示 | 不显示 | 显示 | 不显示 |
* _____________________________ ______________ ______________
* | 显示一行帧长 | 显示一行帧长 |
http://tinyvga.com/vga-timing
*****************************************************************/
//---------------------------------
`define SYNC_POLARITY 1'b0
//------------------------------------
//vga parameter define
`define VGA_640_480_60FPS_25MHz
//`define VGA_800_600_72FPS_50MHz
//`define VGA_1024_768_60FPS_65MHz
//`define VGA_1440_900_60FPS_105MHz
//`define VGA_1280_1024_60FPS_105MHz
//---------------------------------
// 640 * 480
`ifdef VGA_640_480_60FPS_25MHz
`define H_FRONT 11'd16
`define H_SYNC 11'd96
`define H_BACK 11'd48
`define H_DISP 11'd640
`define H_TOTAL 11'd800
`define V_FRONT 11'd10
`define V_SYNC 11'd2
`define V_BACK 11'd33
`define V_DISP 11'd480
`define V_TOTAL 11'd525
`endif
//---------------------------------
// 800 * 600
`ifdef VGA_800_600_72FPS_50MHz
`define H_FRONT 11'd56
`define H_SYNC 11'd120
`define H_BACK 11'd64
`define H_DISP 11'd800
`define H_TOTAL 11'd1040
`define V_FRONT 11'd37
`define V_SYNC 11'd6
`define V_BACK 11'd23
`define V_DISP 11'd600
`define V_TOTAL 11'd666
`endif
//---------------------------------
// 1024 * 768
`ifdef VGA_1024_768_60FPS_65MHz
`define H_FRONT 11'd24
`define H_SYNC 11'd136
`define H_BACK 11'd160
`define H_DISP 11'd1024
`define H_TOTAL 11'd1344
`define V_FRONT 11'd3
`define V_SYNC 11'd6
`define V_BACK 11'd29
`define V_DISP 11'd768
`define V_TOTAL 11'd806
`endif
//---------------------------------
// 1440 * 900
`ifdef VGA_1440_900_60FPS_105MHz
`define H_FRONT 11'd80
`define H_SYNC 11'd152
`define H_BACK 11'd252
`define H_DISP 11'd1440
`define H_TOTAL 11'd1904
`define V_FRONT 11'd1
`define V_SYNC 11'd3
`define V_BACK 11'd28
`define V_DISP 11'd900
`define V_TOTAL 11'd932
`endif
//---------------------------------
// 1280 * 1024
`ifdef VGA_1280_1024_60FPS_105MHz
`define H_FRONT 11'd48
`define H_SYNC 11'd112
`define H_BACK 11'd248
`define H_DISP 11'd1280
`define H_TOTAL 11'd1688
`define V_FRONT 11'd1
`define V_SYNC 11'd3
`define V_BACK 11'd38
`define V_DISP 11'd1024
`define V_TOTAL 11'd1066
`endif