Ver código fonte

project/rgb_panel: Add support for two single-led PMODs on 1A & 1B

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut 5 anos atrás
pai
commit
7b3851315a

+ 3 - 0
projects/rgb_panel/README.md

@@ -112,3 +112,6 @@ have more free PMODs slots). To build the project with this option, use
 The `pcf` is by default configured to have this PMOD on slot P1A, but you can
 edit `icebreaker-single.pcf` to change the pin assignements if it's plugged
 somewhere else.
+
+If you happen to have two of those PMODs, you can plug them on slot P1A and
+P1B and use `make BOARD=icebreaker-single2x`.

+ 61 - 0
projects/rgb_panel/data/top-icebreaker-single2x.pcf

@@ -0,0 +1,61 @@
+# RBG panel single-pmod (on P1A)
+
+ # Data for panels with Red on pin 1/5 and Blue on pin 3/7
+#set_io -nowarn hub75_data[5] 2		# P1A2 Red
+#set_io -nowarn hub75_data[4] 3		# P1A7 Green
+#set_io -nowarn hub75_data[3] 4		# P1A1 Blue
+
+ # Data for panels with Red on pin 3/7 and Blue on pin 1/5
+set_io -nowarn hub75_data[5] 4		# P1A1 Red
+set_io -nowarn hub75_data[4] 3		# P1A7 Green
+set_io -nowarn hub75_data[3] 2		# P1A2 Blue
+
+ # Row address
+set_io -nowarn hub75_addr_inc[0] 47	# P1A3
+set_io -nowarn hub75_addr_rst[0] 48	# P1A8
+
+ # Control
+set_io -nowarn hub75_clk[0] 46		# P1A9
+set_io -nowarn hub75_le[0] 44		# P1A10
+set_io -nowarn hub75_blank[0] 45	# P1A4
+
+# RBG panel single-pmod (on P1B)
+
+ # Data for panels with Red on pin 1/5 and Blue on pin 3/7
+#set_io -nowarn hub75_data[2] 38	# P1B2 Red
+#set_io -nowarn hub75_data[1] 42	# P1B7 Green
+#set_io -nowarn hub75_data[0] 43	# P1B1 Blue
+
+ # Data for panels with Red on pin 3/7 and Blue on pin 1/5
+set_io -nowarn hub75_data[2] 43		# P1B1 Red
+set_io -nowarn hub75_data[1] 42		# P1B7 Green
+set_io -nowarn hub75_data[0] 38		# P1B2 Blue
+
+ # Row address
+set_io -nowarn hub75_addr_inc[1] 34	# P1B3
+set_io -nowarn hub75_addr_rst[1] 36	# P1B8
+
+ # Control
+set_io -nowarn hub75_clk[1] 32		# P1B9
+set_io -nowarn hub75_le[1] 28		# P1B10
+set_io -nowarn hub75_blank[1] 31	# P1B4
+
+# SPI Flash
+set_io -nowarn flash_mosi 14
+set_io -nowarn flash_miso 17
+set_io -nowarn flash_cs_n 16
+set_io -nowarn flash_clk 15
+
+# SPI Slave
+set_io -nowarn slave_mosi 14
+set_io -nowarn slave_miso 17
+set_io -nowarn slave_cs_n 11
+set_io -nowarn slave_clk 15
+
+# PMOD2 buttons
+set_io -nowarn pmod_btn[0] 20
+set_io -nowarn pmod_btn[1] 19
+set_io -nowarn pmod_btn[2] 18
+
+# Clock
+set_io -nowarn clk_12m 35

+ 23 - 1
projects/rgb_panel/rtl/top.v

@@ -43,13 +43,23 @@ module top (
 	output wire hub75_addr_inc,
 	output wire hub75_addr_rst,
 	output wire [2:0] hub75_data,
+	output wire hub75_clk,
+	output wire hub75_le,
+	output wire hub75_blank,
+`elsif BOARD_ICEBREAKER_SINGLE2X
+	output wire [1:0] hub75_addr_inc,
+	output wire [1:0] hub75_addr_rst,
+	output wire [5:0] hub75_data,
+	output wire [1:0] hub75_clk,
+	output wire [1:0] hub75_le,
+	output wire [1:0] hub75_blank,
 `else
 	output wire [4:0] hub75_addr,
 	output wire [5:0] hub75_data,
-`endif
 	output wire hub75_clk,
 	output wire hub75_le,
 	output wire hub75_blank,
+`endif
 
 	// SPI Flash interface
 `ifdef VIDEO
@@ -75,7 +85,11 @@ module top (
 );
 
 	// Params
+`ifdef BOARD_ICEBREAKER_SINGLE2X
+	localparam integer N_BANKS  = 4;
+`else
 	localparam integer N_BANKS  = 2;
+`endif
 	localparam integer N_ROWS   = 32;
 	localparam integer N_COLS   = 64;
 	localparam integer N_CHANS  = 3;
@@ -133,6 +147,11 @@ module top (
 		.PHY_DDR(2),	// DDR data with early edge
 		.PHY_AIR(3),	// Enabled and invert INC
 		.SCAN_MODE("LINEAR")
+`elsif BOARD_ICEBREAKER_SINGLE2X
+		.PHY_N(2),
+		.PHY_DDR(2),	// DDR data with early edge
+		.PHY_AIR(3),	// Enabled and invert INC
+		.SCAN_MODE("LINEAR")
 `else
 		.SCAN_MODE("ZIGZAG")
 `endif
@@ -140,6 +159,9 @@ module top (
 `ifdef BOARD_ICEBREAKER_SINGLE
 		.hub75_addr_inc(hub75_addr_inc),
 		.hub75_addr_rst(hub75_addr_rst),
+`elsif BOARD_ICEBREAKER_SINGLE2X
+		.hub75_addr_inc(hub75_addr_inc),
+		.hub75_addr_rst(hub75_addr_rst),
 `else
 		.hub75_addr(hub75_addr),
 `endif