Skip to content

Commit

Permalink
artiq_ddb_template: add support for user LEDs
Browse files Browse the repository at this point in the history
Add LEDs to device_db.py for satellite and master
variants in Kasli v2.0 and Kasli-SoC.
  • Loading branch information
SimonRenblad committed Oct 18, 2023
1 parent b0bde21 commit b27fa93
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions artiq/frontend/artiq_ddb_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,9 @@ def process(output, primary_description, satellites):
if drtio_role == "standalone" and satellites:
raise ValueError("A standalone system cannot have satellites")

hw_rev = primary_description["hw_rev"]
target = primary_description["target"]

process_header(output, primary_description)

pm = PeripheralManager(output, primary_description)
Expand All @@ -747,7 +750,13 @@ def process(output, primary_description, satellites):
for peripheral in local_peripherals:
n_channels = pm.process(rtio_offset, peripheral)
rtio_offset += n_channels
if drtio_role == "standalone":

support_user_led = \
target == "kasli_soc" or \
hw_rev == "v2.0" or \
(drtio_role == "standalone" and hw_rev in ("v1.1", "v1.0"))

if support_user_led:
n_channels = pm.add_board_leds(rtio_offset)
rtio_offset += n_channels

Expand All @@ -768,7 +777,15 @@ def process(output, primary_description, satellites):
for peripheral in peripherals:
n_channels = pm.process(rtio_offset, peripheral)
rtio_offset += n_channels


support_user_led = \
description["target"] == "kasli_soc" or \
description["hw_rev"] == "v2.0"

if support_user_led:
n_channels = pm.add_board_leds(rtio_offset)
rtio_offset += n_channels

for peripheral in drtio_peripherals:
print(textwrap.dedent("""
# DEST#{dest} peripherals
Expand Down

0 comments on commit b27fa93

Please sign in to comment.