aboutsummaryrefslogtreecommitdiff
path: root/nmigen_boards/mercury.py
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2019-10-03 02:56:47 +0000
committerwhitequark <whitequark@whitequark.org>2019-10-03 02:59:20 +0000
commit5f30a7890a60824ac0a76c409d10b5df0e3c043f (patch)
treead122181a047dde390d9985608a27802ad41e2b0 /nmigen_boards/mercury.py
parent1da974cdacebc0d4e5e9f0864b374afe3c6b8102 (diff)
[breaking-change] Factor out "display_7seg" resource.
With the expectation that "display_9seg", "display_14seg" and "display_16seg" will be forthcoming. There are no provisions in this resource itself for multiplexing the display. It is expected that on boards with multiplexed displays, an additional resource "display_7seg_ctrl" will be provided, and it would have either an n-bit signal "sel" (binary encoded) or an n-bit signal "en" (one-hot encoded). (This may be revisited in the future.) Fixes #17.
Diffstat (limited to 'nmigen_boards/mercury.py')
-rw-r--r--nmigen_boards/mercury.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/nmigen_boards/mercury.py b/nmigen_boards/mercury.py
index c14e85c..5395fba 100644
--- a/nmigen_boards/mercury.py
+++ b/nmigen_boards/mercury.py
@@ -4,6 +4,7 @@ import subprocess
from nmigen.build import *
from nmigen.vendor.xilinx_spartan_3_6 import *
from .dev import *
+from .dev.user import Display7SegResource
__all__ = ["MercuryPlatform"]
@@ -176,18 +177,14 @@ class MercuryPlatform(XilinxSpartan3APlatform):
]
_sevenseg = [
- Resource("sevenseg", 0,
- Subsignal("a", PinsN("13", dir="o", conn=("gpio", 0))),
- Subsignal("b", PinsN("14", dir="o", conn=("gpio", 0))),
- Subsignal("c", PinsN("15", dir="o", conn=("gpio", 0))),
- Subsignal("d", PinsN("16", dir="o", conn=("gpio", 0))),
- Subsignal("e", PinsN("17", dir="o", conn=("gpio", 0))),
- Subsignal("f", PinsN("18", dir="o", conn=("gpio", 0))),
- Subsignal("g", PinsN("19", dir="o", conn=("gpio", 0))),
- Subsignal("dp", PinsN("20", dir="o", conn=("gpio", 0))),
- Subsignal("en", Pins("9 10 11 12", dir="o",
- conn=("gpio", 0))),
- Attrs(IOSTANDARD="LVTTL")
+ Display7SegResource(0,
+ a="gpio_0:13", b="gpio_0:14", c="gpio_0:15", d="gpio_0:16",
+ e="gpio_0:17", f="gpio_0:18", g="gpio_0:19", dp="gpio_0:20",
+ invert=True, attrs=Attrs(IOSTANDARD="LVTTL")
+ ),
+ Resource("display_7seg_ctrl", 0,
+ Subsignal("en", Pins("9 10 11 12", dir="o", conn=("gpio", 0))),
+ Attrs(IOSTANDARD="LVTTL")
)
]