X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fspec%2Fstage2.py;h=3cd7fbafb424e223a8f883123801833d7bb684e5;hb=f658592aa2f3756799aef9fb2b9dfc26092f2513;hp=a7978d01be4c3e0d8a8146487e6c516c84bb4987;hpb=7b3b0f65fd75922d65f77783fd21680f36ad630a;p=pinmux.git diff --git a/src/spec/stage2.py b/src/spec/stage2.py index a7978d0..3cd7fba 100644 --- a/src/spec/stage2.py +++ b/src/spec/stage2.py @@ -419,3 +419,24 @@ if __name__ == '__main__': #fixedpins = [] #function_names = [] #testspec = PinSpec() + pinbanks = { + 'A': (4, 4), # (num of pads, num of banks)? + #'B': (18, 4), + #'C': (24, 1), + #'D': (93, 1), + } + fixedpins = { + 'POWER_GPIO': [ + 'VDD_GPIOB', + 'GND_GPIOB', + ]} + function_names = {'TWI0': 'I2C 0', + 'UART0': 'UART (TX/RX) 0', + } + ps = PinSpec(pinbanks, fixedpins, function_names) + ps.gpio("", ('A', 0), 0, 0, 4) + ps.uart("0", ('A', 0), 1) + ps.i2c("0", ('A', 0), 2) + + print(dir(ps.gpio)) + print(ps.gpio.pinouts, ps.gpio.bankspec, ps.gpio.pinfn, ps.gpio.fname)