From 8d2e54ce6b3a23b2aecf1f31533c043e36ae7326 Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 28 Nov 2021 21:36:03 +0000 Subject: [PATCH] --- docs/pinmux.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/pinmux.mdwn b/docs/pinmux.mdwn index 99e59a397..3588d4670 100644 --- a/docs/pinmux.mdwn +++ b/docs/pinmux.mdwn @@ -204,3 +204,16 @@ Here is a function that defines a UART Resource: io.append(Subsignal("rx", Pins(rx, dir="i", assert_width=1))) io.append(Subsignal("tx", Pins(tx, dir="o", assert_width=1))) return Resource.family(*args, default_name="uart", ios=io) + +It would typically be part of a larger function that defines, for either +an FPGA or an ASIC, a full array of IO Connections: + + def create_resources(pinset): + resources = [] + resources.append(UARTResource('uart', 0, tx='tx', rx='rx')) + # add clock and reset + clk = Resource("clk", 0, Pins("sys_clk", dir="i")) + rst = Resource("rst", 0, Pins("sys_rst", dir="i")) + resources.append(clk) + resources.append(rst) + return resources -- 2.30.2