|
3 | 3 |
|
4 | 4 | __all__ = [
|
5 | 5 | "UARTResource", "IrDAResource", "SPIResource", "I2CResource",
|
6 |
| - "DirectUSBResource", "ULPIResource", "PS2Resource", |
| 6 | + "DirectUSBResource", "ULPIResource", "PS2Resource", "RGMIIResource", |
7 | 7 | ]
|
8 | 8 |
|
9 | 9 |
|
@@ -142,3 +142,20 @@ def PS2Resource(*args, clk, dat, conn=None, attrs=None):
|
142 | 142 | ios.append(attrs)
|
143 | 143 |
|
144 | 144 | return Resource.family(*args, default_name="ps2", ios=ios)
|
| 145 | + |
| 146 | + |
| 147 | +def RGMIIResource(*args, txc, txd, tx_ctl, rxc, rxd, rx_ctl, mdc, mdio, attrs=None, conn=None): |
| 148 | + io = [] |
| 149 | + |
| 150 | + io.append(Subsignal("txc", Pins(txc, dir="o", conn=conn, assert_width=1))) |
| 151 | + io.append(Subsignal("txd", Pins(txd, dir="o", conn=conn, assert_width=4))) |
| 152 | + io.append(Subsignal("tx_ctl", Pins(txc, dir="o", conn=conn, assert_width=1))) |
| 153 | + io.append(Subsignal("rxc", Pins(rxc, dir="i", conn=conn, assert_width=1))) |
| 154 | + io.append(Subsignal("rxd", Pins(rxd, dir="i", conn=conn, assert_width=4))) |
| 155 | + io.append(Subsignal("rx_ctl", Pins(txc, dir="i", conn=conn, assert_width=1))) |
| 156 | + io.append(Subsignal("mdc", Pins(mdc, dir="o", conn=conn, assert_width=1))) |
| 157 | + io.append(Subsignal("mdio", Pins(mdio, dir="io", conn=conn, assert_width=1))) |
| 158 | + |
| 159 | + if attrs is not None: |
| 160 | + io.append(attrs) |
| 161 | + return Resource.family(*args, default_name="rgmii", ios=io) |
0 commit comments