Skip to content

Commit

Permalink
[breaking-change] Factor out "led", "button" and "switch" resources.
Browse files Browse the repository at this point in the history
These resources were renamed as:
  * user_led → led
  * user_btn → button
  * user_sw → switch

Fixes amaranth-lang#13.
  • Loading branch information
whitequark committed Sep 23, 2019
1 parent cb0c2cd commit dd87f47
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 214 deletions.
2 changes: 1 addition & 1 deletion nmigen_boards/_blinky.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def elaborate(self, platform):
leds = []
for n in itertools.count():
try:
leds.append(platform.request("user_led", n))
leds.append(platform.request("led", n))
except ResourceError:
break
leds = Cat(led.o for led in leds)
Expand Down
50 changes: 9 additions & 41 deletions nmigen_boards/arty_a7.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,18 @@ class ArtyA7Platform(Xilinx7SeriesPlatform):
speed = "1L"
default_clk = "clk100"
resources = [
Resource("clk100", 0, Pins("E3", dir="i"), Clock(100e6), Attrs(IOSTANDARD="LVCMOS33")),
Resource("clk100", 0, Pins("E3", dir="i"),
Clock(100e6), Attrs(IOSTANDARD="LVCMOS33")),

Resource("user_led", 0, Pins("H5", dir="o"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_led", 1, Pins("J5", dir="o"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_led", 2, Pins("T9", dir="o"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_led", 3, Pins("T10", dir="o"), Attrs(IOSTANDARD="LVCMOS33")),
*LEDResources(pins="H5 J5 T9 T10", attrs=Attrs(IOSTANDARD="LVCMOS33")),

Resource("rgb_led", 0,
Subsignal("r", Pins("G6", dir="o")),
Subsignal("g", Pins("F6", dir="o")),
Subsignal("b", Pins("E1", dir="o")),
Attrs(IOSTANDARD="LVCMOS33")
),

Resource("rgb_led", 1,
Subsignal("r", Pins("G3", dir="o")),
Subsignal("g", Pins("J4", dir="o")),
Subsignal("b", Pins("G4", dir="o")),
Attrs(IOSTANDARD="LVCMOS33")
),

Resource("rgb_led", 2,
Subsignal("r", Pins("J3", dir="o")),
Subsignal("g", Pins("J2", dir="o")),
Subsignal("b", Pins("H4", dir="o")),
Attrs(IOSTANDARD="LVCMOS33")
),

Resource("rgb_led", 3,
Subsignal("r", Pins("K1", dir="o")),
Subsignal("g", Pins("H6", dir="o")),
Subsignal("b", Pins("K2", dir="o")),
Attrs(IOSTANDARD="LVCMOS33")
),

Resource("user_sw", 0, Pins("A8" , dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_sw", 1, Pins("C11", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_sw", 2, Pins("C10", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_sw", 3, Pins("A10", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
RGBLEDResource(0, r="G6", g="F6", b="E1", attrs=Attrs(IOSTANDARD="LVCMOS33")),
RGBLEDResource(1, r="G3", g="J4", b="G4", attrs=Attrs(IOSTANDARD="LVCMOS33")),
RGBLEDResource(2, r="J3", g="J2", b="H4", attrs=Attrs(IOSTANDARD="LVCMOS33")),
RGBLEDResource(3, r="K1", g="H6", b="K2", attrs=Attrs(IOSTANDARD="LVCMOS33")),

Resource("user_btn", 0, Pins("D9", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_btn", 1, Pins("C9", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_btn", 2, Pins("B9", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
Resource("user_btn", 3, Pins("B8", dir="i"), Attrs(IOSTANDARD="LVCMOS33")),
*ButtonResources(pins="D9 C9 B9 B8 ", attrs=Attrs(IOSTANDARD="LVCMOS33")),
*SwitchResources(pins="A8 C11 C10 A10", attrs=Attrs(IOSTANDARD="LVCMOS33")),

UARTResource(0,
rx="A9", tx="D10",
Expand Down
65 changes: 33 additions & 32 deletions nmigen_boards/atlys.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class AtlysPlatform(XilinxSpartan6Platform):
"""Platform file for Digilent Atlys Spartan 6 board.
https://reference.digilentinc.com/reference/programmable-logic/atlys/start"""

device = "xc6slx45"
package = "csg324"
speed = "3"
device = "xc6slx45"
package = "csg324"
speed = "3"

def __init__(self, *, JP12="2V5", **kwargs):
super().__init__(**kwargs)
Expand All @@ -28,35 +28,36 @@ def bank2_iostandard(self):

default_clk = "clk100"
resources = [
Resource("clk100" , 0, Pins("L15", dir="i"), Attrs(IOSTANDARD="LVCMOS33"), Clock(100e6)), # GCLK

Resource("user_led", 0, Pins("U18", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD0
Resource("user_led", 1, Pins("M14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD1
Resource("user_led", 2, Pins("N14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD2
Resource("user_led", 3, Pins("L14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD3
Resource("user_led", 4, Pins("M13", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD4
Resource("user_led", 5, Pins("D4", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD5
Resource("user_led", 6, Pins("P16", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD6
Resource("user_led", 7, Pins("N12", dir="o"), Attrs(IOSTANDARD=bank2_iostandard)), # LD7

Resource("user_btn", 0, PinsN("T15", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # RESET
Resource("reset" , 0, PinsN("T15", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # RESET
Resource("user_btn", 1, Pins("N4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNU
Resource("user_btn", 2, Pins("P4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNL
Resource("user_btn", 3, Pins("P3", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTND
Resource("user_btn", 4, Pins("F6", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNR
Resource("user_btn", 5, Pins("F5", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNC

Resource("user_sw" , 0, Pins("A10", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW0
Resource("user_sw" , 1, Pins("D14", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW1
Resource("user_sw" , 2, Pins("C14", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW2
Resource("user_sw" , 3, Pins("P15", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW3
Resource("user_sw" , 4, Pins("P12", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW4
Resource("user_sw" , 5, Pins("R5", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW5
Resource("user_sw" , 6, Pins("T5", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW6
Resource("user_sw" , 7, Pins("E4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # SW7

UARTResource(0, rx="A16", tx="B16", attrs=Attrs(IOSTANDARD="LVCMOS33")), # J17/UART
Resource("clk100", 0, Pins("L15", dir="i"),
Clock(100e6), Attrs(IOSTANDARD="LVCMOS33")), # GCLK

Resource("led", 0, Pins("U18", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD0
Resource("led", 1, Pins("M14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD1
Resource("led", 2, Pins("N14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD2
Resource("led", 3, Pins("L14", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD3
Resource("led", 4, Pins("M13", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD4
Resource("led", 5, Pins("D4", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD5
Resource("led", 6, Pins("P16", dir="o"), Attrs(IOSTANDARD="LVCMOS33")), # LD6
Resource("led", 7, Pins("N12", dir="o"), Attrs(IOSTANDARD=bank2_iostandard)), # LD7

Resource("button", 0, PinsN("T15", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # RESET
Resource("reset", 0, PinsN("T15", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # RESET
Resource("button", 1, Pins("N4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNU
Resource("button", 2, Pins("P4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNL
Resource("button", 3, Pins("P3", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTND
Resource("button", 4, Pins("F6", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNR
Resource("button", 5, Pins("F5", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # BTNC

Resource("switch", 0, Pins("A10", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW0
Resource("switch", 1, Pins("D14", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW1
Resource("switch", 2, Pins("C14", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW2
Resource("switch", 3, Pins("P15", dir="i"), Attrs(IOSTANDARD="LVCMOS33")), # SW3
Resource("switch", 4, Pins("P12", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW4
Resource("switch", 5, Pins("R5", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW5
Resource("switch", 6, Pins("T5", dir="i"), Attrs(IOSTANDARD=bank2_iostandard)), # SW6
Resource("switch", 7, Pins("E4", dir="i"), Attrs(IOSTANDARD="LVCMOS18")), # SW7

UARTResource(0, rx="A16", tx="B16", attrs=Attrs(IOSTANDARD="LVCMOS33")), # J17/UART

Resource("ps2", 0, # PS/2 keyboard interface converted from J13 "HOST" USB connector
Subsignal("clk", Pins("P17", dir="i")),
Expand Down
27 changes: 9 additions & 18 deletions nmigen_boards/blackice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,17 @@ class BlackIcePlatform(LatticeICE40Platform):
default_clk = "clk100"
resources = [
Resource("clk100", 0, Pins("129", dir="i"),
Clock(100e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")
),

Resource("user_led", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 1, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 2, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 3, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
# Color aliases
Resource("user_ledb", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledg", 0, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledo", 0, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledr", 0, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Clock(100e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_btn", 0, PinsN("63", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_btn", 1, PinsN("64", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
*LEDResources(pins="71 67 68 70", attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
# Semantic aliases
Resource("led_b", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_g", 0, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_o", 0, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_r", 0, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("user_sw", 0, PinsN("37", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 1, PinsN("38", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 2, PinsN("39", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 3, PinsN("41", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
*ButtonResources(pins="63 64", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
*SwitchResources(pins="37 38 39 41", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),

UARTResource(0,
rx="88", tx="85", rts="91", cts="94",
Expand Down
22 changes: 7 additions & 15 deletions nmigen_boards/blackice_ii.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,15 @@ class BlackIceIIPlatform(LatticeICE40Platform):
Clock(100e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")
),

Resource("user_led", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 1, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 2, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 3, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
*LEDResources(pins="71 67 68 70", attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
# Color aliases
Resource("user_ledb", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledg", 0, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledo", 0, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledr", 0, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_b", 0, Pins("71", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_g", 0, Pins("67", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_o", 0, Pins("68", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_r", 0, Pins("70", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("user_btn", 0, PinsN("63", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_btn", 1, PinsN("64", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("user_sw", 0, PinsN("37", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 1, PinsN("38", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 2, PinsN("39", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_sw", 3, PinsN("41", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
*ButtonResources(pins="63 64", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
*SwitchResources(pins="37 38 39 41", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),

UARTResource(0,
rx="88", tx="85", rts="91", cts="94",
Expand Down
3 changes: 2 additions & 1 deletion nmigen_boards/dev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .user import LEDResources, RGBLEDResource, ButtonResources, SwitchResources
from .uart import UARTResource
from .flash import SPIFlashResources
from .spi import SPIResource
from .flash import SPIFlashResources
from .sram import SRAMResource
43 changes: 43 additions & 0 deletions nmigen_boards/dev/user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from nmigen.build import *


__all__ = ["UserLEDResource"]


def _SplitResources(*args, pins, invert=False, attrs=None, default_name, dir):
assert isinstance(pins, (str, list, dict))

if isinstance(pins, str):
pins = pins.split()
if isinstance(pins, list):
pins = dict(enumerate(pins))

resources = []
for number, pin in pins.items():
ios = [PinsN(pin, dir=dir) if invert else Pins(pin, dir=dir)]
if attrs is not None:
ios.append(attrs)
resources.append(Resource.family(*args, number, default_name=default_name, ios=ios))
return resources


def LEDResources(*args, **kwargs):
return _SplitResources(*args, **kwargs, default_name="led", dir="o")


def RGBLEDResource(*args, r, g, b, invert=False, attrs=None):
ios = []
ios.append(Subsignal("r", Pins(r, dir="o", assert_width=1)))
ios.append(Subsignal("g", Pins(g, dir="o", assert_width=1)))
ios.append(Subsignal("b", Pins(b, dir="o", assert_width=1)))
if attrs is not None:
ios.append(attrs)
return Resource.family(*args, default_name="rgb_led", ios=ios)


def ButtonResources(*args, **kwargs):
return _SplitResources(*args, **kwargs, default_name="button", dir="i")


def SwitchResources(*args, **kwargs):
return _SplitResources(*args, **kwargs, default_name="switch", dir="i")
10 changes: 4 additions & 6 deletions nmigen_boards/fomu_hacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class FomuHackerPlatform(LatticeICE40Platform):
Resource("clk48", 0, Pins("F5", dir="i"),
Clock(48e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_led", 0, PinsN("A5", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("rgb_led", 0,
Subsignal("r", PinsN("C5")),
Subsignal("g", PinsN("B5")),
Subsignal("b", PinsN("A5")),
Attrs(IO_STANDARD="SB_LVCMOS"),
*LEDResources(pins="A5", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
RGBLEDResource(0,
r="C5", g="B5", b="A5", invert=True,
attrs=Attrs(IO_STANDARD="SB_LVCMOS")
),

Resource("usb", 0,
Expand Down
15 changes: 6 additions & 9 deletions nmigen_boards/ice40_hx1k_blink_evn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ class ICE40HX1KBlinkEVNPlatform(LatticeICE40Platform):
Resource("clk3p3", 0, Pins("13", dir="i"), Clock(3.3e6),
Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_led", 0, Pins("59", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 1, Pins("56", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 2, Pins("53", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 3, Pins("51", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("user_btn", 0, Pins("60"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_btn", 1, Pins("57"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_btn", 2, Pins("54"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_btn", 3, Pins("52"), Attrs(IO_STANDARD="SB_LVCMOS")),
*LEDResources(pins="59 56 53 51", attrs=Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("touch", 0, Pins("60"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("touch", 1, Pins("57"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("touch", 2, Pins("54"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("touch", 3, Pins("52"), Attrs(IO_STANDARD="SB_LVCMOS")),

*SPIFlashResources(0,
cs="49", clk="48", mosi="45", miso="46",
Expand Down
12 changes: 4 additions & 8 deletions nmigen_boards/ice40_hx8k_b_evn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ class ICE40HX8KBEVNPlatform(LatticeICE40Platform):
Resource("clk12", 0, Pins("J3", dir="i"),
Clock(12e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_led", 0, Pins("C3", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D2
Resource("user_led", 1, Pins("B3", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D3
Resource("user_led", 2, Pins("C4", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D4
Resource("user_led", 3, Pins("C5", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D5
Resource("user_led", 4, Pins("A1", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D6
Resource("user_led", 5, Pins("A2", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D7
Resource("user_led", 6, Pins("B4", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D8
Resource("user_led", 7, Pins("B5", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")), # D9
*LEDResources(
pins="C3 B3 C4 C5 A1 A2 B4 B5",
attrs=Attrs(IO_STANDARD="SB_LVCMOS")
), # D2..D9

UARTResource(0,
rx="B10", tx="B12", rts="B13", cts="A15", dtr="A16", dsr="B14", dcd="B15",
Expand Down
11 changes: 5 additions & 6 deletions nmigen_boards/icebreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ class ICEBreakerPlatform(LatticeICE40Platform):
Resource("clk12", 0, Pins("35", dir="i"),
Clock(12e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_led", 0, PinsN("11", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 1, PinsN("37", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
# Color-specific aliases
Resource("user_ledr", 0, PinsN("11", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_ledg", 0, PinsN("37", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
*LEDResources(pins="11 37", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),
# Semantic aliases
Resource("led_r", 0, PinsN("11", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("led_g", 0, PinsN("37", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),

Resource("user_btn", 0, PinsN("10", dir="i"), Attrs(IO_STANDARD="SB_LVCMOS")),
*ButtonResources(pins="10", invert=True, attrs=Attrs(IO_STANDARD="SB_LVCMOS")),

UARTResource(0,
rx="6", tx="9",
Expand Down
6 changes: 1 addition & 5 deletions nmigen_boards/icestick.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ class ICEStickPlatform(LatticeICE40Platform):
Resource("clk12", 0, Pins("21", dir="i"),
Clock(12e6), Attrs(GLOBAL=True, IO_STANDARD="SB_LVCMOS")),

Resource("user_led", 0, Pins("99", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 1, Pins("98", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 2, Pins("97", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 3, Pins("96", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
Resource("user_led", 4, Pins("95", dir="o"), Attrs(IO_STANDARD="SB_LVCMOS")),
*LEDResources(pins="99 98 97 96 95", attrs=Attrs(IO_STANDARD="SB_LVCMOS")),

UARTResource(0,
rx="9", tx="8", rts="7", cts="4", dtr="3", dsr="2", dcd="1",
Expand Down
Loading

0 comments on commit dd87f47

Please sign in to comment.