__all__ = ["SPIFlashResources"]
-def SPIFlashResources(number, *, cs, clk, mosi, miso, wp=None, hold=None, attrs=None):
+def SPIFlashResources(*args, cs, clk, mosi, miso, wp=None, hold=None, attrs=None):
resources = []
io_all = []
if wp is not None and hold is not None:
io_1x.append(Subsignal("wp", PinsN(wp, dir="o")))
io_1x.append(Subsignal("hold", PinsN(hold, dir="o")))
- resources.append(Resource("spi_flash", number, *io_1x))
+ resources.append(Resource.family(*args, default_name="spi_flash", ios=io_1x,
+ name_suffix="1x"))
io_2x = list(io_all)
io_2x.append(Subsignal("dq", Pins(" ".join([mosi, miso]), dir="io")))
- resources.append(Resource("spi_flash_2x", number, *io_2x))
+ resources.append(Resource.family(*args, default_name="spi_flash", ios=io_2x,
+ name_suffix="2x"))
if wp is not None and hold is not None:
io_4x = list(io_all)
io_4x.append(Subsignal("dq", Pins(" ".join([mosi, miso, wp, hold]), dir="io")))
- resources.append(Resource("spi_flash_4x", number, *io_4x))
+ resources.append(Resource.family(*args, default_name="spi_flash", ios=io_4x,
+ name_suffix="4x"))
return resources
__all__ = ["UARTResource", "IrDAResource"]
-def UARTResource(number, *, rx, tx, rts=None, cts=None, dtr=None, dsr=None, dcd=None, ri=None,
+def UARTResource(*args, rx, tx, rts=None, cts=None, dtr=None, dsr=None, dcd=None, ri=None,
attrs=None):
io = []
io.append(Subsignal("rx", Pins(rx, dir="i")))
io.append(Subsignal("ri", Pins(ri, dir="i")))
if attrs is not None:
io.append(attrs)
- return Resource("uart", number, *io)
+ return Resource.family(*args, default_name="uart", ios=io)
def IrDAResource(number, *, rx, tx, en=None, sd=None, attrs=None):