Add LedChaser to iCEBreaker-bitsy.

Signed-off-by: Tim Callahan <tcal@google.com>
This commit is contained in:
Tim Callahan 2022-12-04 17:58:20 -08:00
parent b030630237
commit 6e205be83b
1 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,8 @@ from litex.soc.cores.clock import iCE40PLL
from litex.soc.integration.soc_core import *
from litex.soc.integration.soc import SoCRegion
from litex.soc.integration.builder import *
from litex.soc.cores.led import LedChaser
kB = 1024
mB = 1024*kB
@ -98,7 +100,7 @@ class _CRG(LiteXModule):
# BaseSoC ------------------------------------------------------------------------------------------
class BaseSoC(SoCCore):
def __init__(self, bios_flash_offset, sys_clk_freq=24e6, revision="v1", **kwargs):
def __init__(self, bios_flash_offset, sys_clk_freq=24e6, revision="v1", with_led_chaser=True, **kwargs):
platform = icebreaker_bitsy.Platform(revision=revision)
# CRG --------------------------------------------------------------------------------------
@ -128,6 +130,13 @@ class BaseSoC(SoCCore):
linker = True)
)
# LED Chaser --------------------------------------------------------------------------------
if with_led_chaser:
self.leds = LedChaser(
pads = platform.request_all("user_led_n"),
sys_clk_freq = sys_clk_freq,
polarity = 1)
# SPI Flash --------------------------------------------------------------------------------
from litespi.modules import W25Q128JV
from litespi.opcodes import SpiNorFlashOpCodes as Codes