Projektdaten für das ESY1B Praktikum im Sommersemester 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rgb_led_top.sv 860B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module led_top (
  2. input wire clk12M,
  3. input wire rst,
  4. input wire [7:0] data_input,
  5. input wire data_valid,
  6. output reg RED,
  7. output reg GRN,
  8. output reg alarm
  9. );
  10. wire red_pwm;
  11. wire grn_pwm;
  12. reg REDn;
  13. reg GRNn;
  14. defparam U1.on_hi = 2'b10;
  15. defparam U1.on_lo = 2'b01;
  16. defparam U1.off = 2'b00;
  17. defparam U1.Brightness = 4'b0111; // 50% Brightness
  18. defparam U2.RGB0_CURRENT = "0b111111";
  19. defparam U2.RGB1_CURRENT = "0b111111";
  20. defparam U2.RGB2_CURRENT = "0b111111";
  21. LED_control1 U1 (.clk12M(clk12M),.enable(rst),.data_input(data_input),.data_valid(data_valid),.red_pwm(red_pwm),.grn_pwm(grn_pwm),.alarm(alarm));
  22. RGB U2 (.CURREN('b1),.RGB0PWM(),.RGB1PWM(grn_pwm),.RGB2PWM(red_pwm),.RGBLEDEN('b1),.RGB0(),.RGB1(GRNn),.RGB2(REDn));
  23. assign RED = red_pwm;
  24. assign GRN = grn_pwm;
  25. endmodule