37 lines
825 B
Verilog
37 lines
825 B
Verilog
module main ();
|
|
|
|
wire clk;
|
|
wire led_blue;
|
|
wire led_green;
|
|
wire led_red;
|
|
|
|
SB_HFOSC inthosc(
|
|
.CLKHFPU(1'b1), // power up
|
|
.CLKHFEN(1'b1), // enable
|
|
.CLKHF(clk)); // drive the clk signal
|
|
|
|
blinky blinky_inst(
|
|
.clk(clk),
|
|
.led_blue(led_blue),
|
|
.led_green(led_green),
|
|
.led_red(led_red)
|
|
);
|
|
|
|
SB_RGBA_DRV rgb (
|
|
.RGBLEDEN (1'b1),
|
|
.RGB0PWM (counter[N]),
|
|
.RGB1PWM (counter[N-1]),
|
|
.RGB2PWM (counter[N-2]),
|
|
.CURREN (1'b1),
|
|
.RGB0 (led_blue),
|
|
.RGB1 (led_green),
|
|
.RGB2 (led_red)
|
|
);
|
|
defparam rgb.CURRENT_MODE = "0b1";
|
|
defparam rgb.RGB0_CURRENT = "0b000001";
|
|
defparam rgb.RGB1_CURRENT = "0b000001";
|
|
defparam rgb.RGB2_CURRENT = "0b000001";
|
|
|
|
endmodule
|
|
|