Skip to content

Commit 48f31ce

Browse files
committed
mergeme
1 parent a465463 commit 48f31ce

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

amaranth_orchard/base/gpio.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GPIOPins(wiring.PureInterface):
1313
class Signature(wiring.Signature):
1414
def __init__(self, width):
1515
if width > 32:
16-
raise ValueError(f"Pin width must be lesser than or equal to 32, not {len(pins.o)}")
16+
raise ValueError(f"Pin width must be lesser than or equal to 32, not {width}")
1717
self._width = width
1818
super().__init__(
1919
# each pin has seperate output enable
@@ -51,14 +51,11 @@ class DI(csr.Register, access="r"):
5151
def __init__(self, width):
5252
super().__init__({"pins": csr.Field(csr.action.R, unsigned(width))})
5353

54-
"""Simple GPIO peripheral.
55-
56-
All pins default to input at power up.
57-
"""
58-
def __init__(self, *, pins):
59-
if len(pins.o) > 32:
60-
raise ValueError(f"Pin width must be lesser than or equal to 32, not {len(pins.o)}")
54+
def __init__(self, *, pins: GPIOPins):
55+
"""Simple GPIO peripheral.
6156
57+
All pins default to input at power up.
58+
"""
6259
self.width = pins.width
6360
self.pins = pins
6461

0 commit comments

Comments
 (0)