From 9bd667720dd296912f99ed550fe162d81a3e73a8 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 28 Jan 2021 14:27:09 +0100 Subject: [PATCH] targets/ecpix5: add LedChaser with red leds. Fits nicely LambdaConcept colors and Blue/Green leds are too bright and would need to be controlled through a PWM. --- litex_boards/targets/ecpix5.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/litex_boards/targets/ecpix5.py b/litex_boards/targets/ecpix5.py index 5305053..1e2dc8b 100755 --- a/litex_boards/targets/ecpix5.py +++ b/litex_boards/targets/ecpix5.py @@ -20,6 +20,7 @@ from litex.build.lattice.trellis import trellis_args, trellis_argdict from litex.soc.cores.clock import * from litex.soc.integration.soc_core import * from litex.soc.integration.builder import * +from litex.soc.cores.led import LedChaser from litedram.modules import MT41K256M16 from litedram.phy import ECP5DDRPHY @@ -116,11 +117,16 @@ class BaseSoC(SoCCore): self.add_csr("ethphy") self.add_ethernet(phy=self.ethphy) - # Leds (Disable...) ------------------------------------------------------------------------ + # Leds ------------------------------------------------------------------------------------- + leds_pads = [] for i in range(4): rgb_led_pads = platform.request("rgb_led", i) - for c in "rgb": - self.comb += getattr(rgb_led_pads, c).eq(1) + self.comb += [getattr(rgb_led_pads, n).eq(1) for n in "gb"] # Disable Green/Blue Leds. + leds_pads += [getattr(rgb_led_pads, n) for n in "r"] + self.submodules.leds = LedChaser( + pads = Cat(leds_pads), + sys_clk_freq = sys_clk_freq) + self.add_csr("leds") # Build --------------------------------------------------------------------------------------------