Skip to content

Commit ec81fda

Browse files
Merge pull request #95 from the-snowwhite/DE10_Nano_SoC_FB_DB25
De10 nano soc fb db25
2 parents 1904baf + 8dcf674 commit ec81fda

26 files changed

+5637
-602
lines changed

HW/QuartusProjects/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
*~
5555
*.tar.gz
5656
*.pin
57-
*.mif
5857
*.hex
5958
*.ddb
6059
#*.stp
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// --------------------------------------------------------------------
2-
// Copyright (c) 2005 by Terasic Technologies Inc.
2+
// Copyright (c) 2005 by Terasic Technologies Inc.
33
// --------------------------------------------------------------------
44
//
55
// Permission:
66
//
77
// Terasic grants permission to use and modify this code for use
8-
// in synthesis for all Terasic Development Boards and Altrea Development
9-
// Kits made by Terasic. Other use of this code, including the selling
8+
// in synthesis for all Terasic Development Boards and Altrea Development
9+
// Kits made by Terasic. Other use of this code, including the selling
1010
// ,duplication, or modification of any portion is strictly prohibited.
1111
//
1212
// Disclaimer:
@@ -15,11 +15,11 @@
1515
// which illustrates how these types of functions can be implemented.
1616
// It is the user's responsibility to verify their design for
1717
// consistency and functionality through the use of formal
18-
// verification methods. Terasic provides no warranty regarding the use
18+
// verification methods. Terasic provides no warranty regarding the use
1919
// or functionality of this code.
2020
//
2121
// --------------------------------------------------------------------
22-
//
22+
//
2323
// Terasic Technologies Inc
2424
// 356 Fu-Shin E. Rd Sec. 1. JhuBei City,
2525
// HsinChu County, Taiwan
@@ -40,36 +40,36 @@
4040
// V1.0 :| Joe Yang :| 05/07/10 :| Initial Revision
4141
// V2.0 :| Joe Yang :| 12/12/16 :| Initial Revision
4242
// --------------------------------------------------------------------
43-
module I2Cv2_Controller (
43+
module I2C_Controller (
4444
input CLOCK,
45-
input [23:0]I2C_DATA,
45+
input [23:0]I2C_DATA,
4646
input GO,
47-
input RESET,
47+
input RESET,
4848
input W_R,
49-
inout I2C_SDAT,
49+
inout I2C_SDAT,
5050
output I2C_SCLK,
51-
output END,
51+
output END,
5252
output ACK
5353
);
5454

55-
wire SDAO ;
55+
wire SDAO ;
5656

57-
assign I2C_SDAT = SDAO?1'bz :0 ;
57+
assign I2C_SDAT = SDAO?1'bz :0 ;
5858

5959
I2C_WRITE_WDATA wrd(
6060
.RESET_N ( RESET),
6161
.PT_CK ( CLOCK),
6262
.GO ( GO ),
6363
.END_OK ( END ),
6464
.ACK_OK ( ACK ),
65-
.BYTE_NUM ( 2 ), //2byte
65+
.BYTE_NUM ( 2 ), //2byte
6666
.SDAI ( I2C_SDAT ),//IN
6767
.SDAO ( SDAO ),//OUT
68-
.SCLO ( I2C_SCLK ),
68+
.SCLO ( I2C_SCLK ),
6969
.SLAVE_ADDRESS( I2C_DATA[23:16] ),
70-
.REG_DATA ( I2C_DATA[15:0] )
71-
);
72-
73-
70+
.REG_DATA ( I2C_DATA[15:0] )
71+
);
72+
73+
7474

7575
endmodule

HW/QuartusProjects/DE10_Nano_FB_Cramps/I2C_HDMI_Config.v renamed to HW/QuartusProjects/Common/I2C_HDMI_Config.v

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ input iRST_N;
1414
output I2C_SCLK;
1515
inout I2C_SDAT;
1616
input HDMI_TX_INT;
17-
output READY ;
17+
output READY ;
1818

1919
// Internal Registers/Wires
2020
reg [15:0] mI2C_CLK_DIV;
@@ -26,7 +26,7 @@ wire mI2C_ACK;
2626
reg [15:0] LUT_DATA;
2727
reg [5:0] LUT_INDEX;
2828
reg [3:0] mSetup_ST;
29-
reg READY ;
29+
reg READY ;
3030

3131
// Clock Setting
3232
parameter CLK_Freq = 50000000; // 50 MHz
@@ -54,12 +54,12 @@ begin
5454
end
5555
end
5656
////////////////////////////////////////////////////////////////////
57-
I2Cv2_Controller u0 ( .CLOCK(mI2C_CTRL_CLK), // Controller Work Clock
57+
I2C_Controller u0 ( .CLOCK(mI2C_CTRL_CLK), // Controller Work Clock
5858
.I2C_SCLK(I2C_SCLK), // I2C CLOCK
5959
.I2C_SDAT(I2C_SDAT), // I2C DATA
6060
.I2C_DATA(mI2C_DATA), // DATA:[SLAVE_ADDR,SUB_ADDR,DATA]
6161
.GO(mI2C_GO), // GO transfor
62-
.END(mI2C_END), // END transfor
62+
.END(mI2C_END), // END transfor
6363
.ACK(mI2C_ACK), // ACK
6464
.RESET(iRST_N) );
6565
////////////////////////////////////////////////////////////////////
@@ -90,7 +90,7 @@ begin
9090
if(!mI2C_ACK)
9191
mSetup_ST <= 2;
9292
else
93-
mSetup_ST <= 0;
93+
mSetup_ST <= 0;
9494
mI2C_GO <= 0;
9595
end
9696
end
@@ -102,7 +102,7 @@ begin
102102
end
103103
else
104104
begin
105-
READY<=1;
105+
READY<=1;
106106
if(!HDMI_TX_INT)
107107
begin
108108
LUT_INDEX <= 0;
@@ -113,11 +113,11 @@ begin
113113
end
114114
end
115115
////////////////////////////////////////////////////////////////////
116-
///////////////////// Config Data LUT //////////////////////////
116+
///////////////////// Config Data LUT //////////////////////////
117117
always
118118
begin
119119
case(LUT_INDEX)
120-
120+
121121
// Video Config Data
122122
0 : LUT_DATA <= 16'h9803; //Must be set to 0x03 for proper operation
123123
1 : LUT_DATA <= 16'h0100; //Set 'N' value at 6144
@@ -155,4 +155,4 @@ begin
155155
endcase
156156
end
157157
////////////////////////////////////////////////////////////////////
158-
endmodule
158+
endmodule
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set_global_assignment -name VERILOG_FILE ../Common/I2C_Controller.v
2+
set_global_assignment -name VERILOG_FILE ../Common/I2C_HDMI_Config.v
3+
set_global_assignment -name VERILOG_FILE ../Common/I2C_WRITE_WDATA.v

0 commit comments

Comments
 (0)