123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- module steuerung (
- bus.steuerung_port b, //b.dip[3:0], b.timer, b.clk, b.spi_read[1:0]
- led_if.led_port_top i //i.rgb[2:0], i.rgbn[2:0]
- );
-
- //dip[3:2] -> select colour, dip[1] -> read ~ 1/write ~ 0, dip[0] -> on ~ 1/off ~ 0
-
- //input wire clk12M, -> b.clk
- //input wire rst, -> b.dip[0]
- //input wire [1:0] color_sel, -> b.dip[3:2]
- //input wire rw, -> b.dip[1]
- //output reg REDn, -> i.rgbn[0]
- //output reg BLUn, -> i.rgbn[1]
- //output reg GRNn, -> i.rgbn[2]
- //output reg RED, -> i.rgb[0]
- //output reg BLU, -> i.rgb[1]
- //output reg GRN -> i.rgb[2]
-
-
- wire red_pwm;
- wire grn_pwm;
- wire blu_pwm;
-
-
- defparam U1.on_hi = 2'b10;
- defparam U1.on_lo = 2'b01;
- defparam U1.off = 2'b00;
- defparam U1.LED_OFF = 2'b00;
- defparam U1.RAMP_UP = 2'b01;
- defparam U1.LED_ON = 2'b10;
- defparam U1.RAMP_DOWN = 2'b11;
- defparam U1.on_max_cnt = 28'h16E35ED; // 1 sec steady
- defparam U1.Brightness = 4'b0111; // 50% Brightness
- defparam U1.BreatheRamp = 4'b0110; // 2x
- defparam U1.BlinkRate = 4'b0101; // 1 sec
- defparam U2.RGB0_CURRENT = "0b111111";
- defparam U2.RGB1_CURRENT = "0b111111";
- defparam U2.RGB2_CURRENT = "0b111111";
-
- LED_control1 U1 (.clk12M(b.clk),.rst(b.dip[0]),.color_sel(b.dip[3:2]),.rw(b.dip[1]),.red_pwm(red_pwm),.blu_pwm(blu_pwm),.grn_pwm(grn_pwm));
-
-
- RGB U2 (.CURREN('b1),.RGB0PWM(blu_pwm),.RGB1PWM(grn_pwm),.RGB2PWM(red_pwm),.RGBLEDEN('b1),.RGB0(i.rgbn[1]),.RGB1(i.rgbn[2]),.RGB2(rgbn[0]));
-
- assign i.rgb[0] = red_pwm;
- assign i.rgb[2] = grn_pwm;
- assign i.rgb[1] = blu_pwm;
-
- endmodule
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|