-
Notifications
You must be signed in to change notification settings - Fork 4
/
ov7670_top.v
65 lines (55 loc) · 1.68 KB
/
ov7670_top.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
module ov7670_top #(
parameter CAM_DATA_WIDTH = 12,
CAM_LINE = 9,
CAM_PIXEL = 10
)(
input clk, // 25MHz clk
output [CAM_DATA_WIDTH-1:0] o_data_wr,
output we,
output [CAM_LINE-1:0] o_line,
output [CAM_PIXEL-1:0] o_pixel,
output config_finished,
input btn,
input ov7670_pclk,
output ov7670_mclk,
input ov7670_vs,
input ov7670_hs,
input [7:0] ov7670_data,
output ov7670_scl,
inout ov7670_sda,
output ov7670_pwdn,
output ov7670_reset
);
//-----------internal regiters and wires-----------------
wire resend;
wire w_finished;
//---------------sub modules--------------------------
debounce_switch debounce_switch(
.clk(clk),
.i_switch(btn),
.o_switch(btn_db));
ov7670_capture #(
.CAM_DATA_WIDTH(CAM_DATA_WIDTH),
.CAM_LINE(CAM_LINE),
.CAM_PIXEL(CAM_PIXEL)
) ov7670_capture (
.we(we),
.reset(btn_db),
.o_data_wr(o_data_wr),
.o_line(o_line),
.o_pixel(o_pixel),
.ov7670_pclk(ov7670_pclk),
.ov7670_vs(ov7670_vs),
.ov7670_hs(ov7670_hs),
.ov7670_data(ov7670_data)
);
ov7670_controller ov7670_controller (
.clk(clk),
.ov7670_sda(ov7670_sda),
.ov7670_scl(ov7670_scl),
.resend(btn_db),
.config_finished(config_finished),
.ov7670_pwdn(ov7670_pwdn),
.ov7670_reset(ov7670_reset),
.ov7670_mclk(ov7670_mclk) );
endmodule