From 637947aded0234c8f9ffc5817c835bc438a3e07e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 25 Sep 2020 13:48:11 +0100 Subject: [PATCH] add descriptions and scenario --- src/spec/base.py | 1 + src/spec/ifaceprint.py | 4 ++- src/spec/ls180.py | 57 ++++++++++++++++++++++++---------------- src/spec/pinfunctions.py | 2 +- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/spec/base.py b/src/spec/base.py index a03ad93..701a4ca 100644 --- a/src/spec/base.py +++ b/src/spec/base.py @@ -72,6 +72,7 @@ auto-generated by [[pinouts.py]] of.write("""# Reference Datasheets datasheets and pinout links + * * * diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index 4e72d51..abd8091 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -66,7 +66,7 @@ def display_fns(of, bankspec, pins, function_names): fn_names = function_names.keys() fns = {} for (pin, pdata) in pins.items(): - for mux in range(1, 4): # skip GPIO for now + for mux in range(0, 4): # skip GPIO for now if mux not in pdata: continue name, bank = pdata[mux] @@ -80,6 +80,7 @@ def display_fns(of, bankspec, pins, function_names): current_fn = None for fname in fnidx: fnbase = find_fn(fname, fn_names) + #fblower = fnbase.lower() assert fnbase in function_names, "fn %s not in descriptions %s" % \ (fname, str(function_names.keys())) #print "name", fname, fnbase @@ -110,6 +111,7 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm, of.write("# Pinmap for %s\n\n" % title) print "fn_idx", fnidx + print "fns", fns print "fnspec", pins.fnspec.keys() print "required", required for name in required: diff --git a/src/spec/ls180.py b/src/spec/ls180.py index 5d751d6..d8fcd3b 100644 --- a/src/spec/ls180.py +++ b/src/spec/ls180.py @@ -37,11 +37,19 @@ def pinspec(): fixedpins = {} function_names = { 'PWM': 'PWM (pulse-width modulation)', - 'MSPI2': 'SPI (Serial Peripheral Interface) Master 1', - 'UART1': 'UART (TX/RX) 1', - 'UART3': 'UART (TX/RX) 2', - 'MMC1': 'SD/MMC 1', - 'MMC2': 'SD/MMC 2', + 'MSPI0': 'SPI (Serial Peripheral Interface) Master 1', + 'MSPI1': 'SPI (Serial Peripheral Interface) Master 2', + 'UART0': 'UART (TX/RX) 1', + 'CLK': 'System Clock', + 'RST': 'Reset', + 'GPIO': 'GPIO', + 'EINT': 'External Interrupt', + 'PWM': 'PWM', + 'JTAG': 'JTAG', + 'SD0': 'SD/MMC 1', + 'SDR': 'SDRAM', + 'VDD': 'Power', + 'VSS': 'GND', #'LPC1': 'Low Pincount Interface 1', #'LPC2': 'Low Pincount Interface 2', } @@ -51,30 +59,33 @@ def pinspec(): ps.vss("", ('N', 0), 0, 0, 1) ps.vdd("", ('N', 1), 0, 0, 1) ps.sdram1("", ('N', 2), 0, 0, 30) - ps.vss("", ('N', 30), 0, 0, 1) - ps.vdd("", ('N', 31), 0, 0, 1) + ps.vss("", ('N', 30), 0, 1, 1) + ps.vdd("", ('N', 31), 0, 1, 1) - ps.vss("", ('E', 0), 0, 1, 1) + ps.vss("", ('E', 0), 0, 2, 1) ps.sdram2("", ('E', 1), 0, 0, 12) - ps.vdd("", ('E', 13), 0, 1, 1) + ps.vdd("", ('E', 13), 0, 2, 1) ps.gpio("", ('E', 14), 0, 8, 8) - ps.vss("", ('E', 23), 0, 1, 1) + ps.vss("", ('E', 23), 0, 3, 1) ps.jtag("", ('E', 24), 0, 0, 4) - ps.vdd("", ('E', 31), 0, 1, 1) + ps.vdd("", ('E', 31), 0, 3, 1) - ps.vss("", ('S', 0), 0, 1, 1) + ps.vss("", ('S', 0), 0, 4, 1) ps.clk("", ('S', 1), 0, 0, 1) ps.rst("", ('S', 2), 0, 0, 1) - ps.mspi("0", ('S', 3), 0) - ps.uart("0", ('S', 7), 0) - ps.vdd("", ('S', 31), 0, 1, 1) + ps.mspi("0", ('S', 4), 0) + ps.uart("0", ('S', 8), 0) + ps.gpio("", ('S', 14), 0, 0, 8) + ps.vdd("", ('S', 31), 0, 4, 1) - ps.vss("", ('W', 0), 0, 1, 1) + ps.vss("", ('W', 0), 0, 5, 1) ps.pwm("", ('W', 1), 0, 0, 2) ps.eint("", ('W', 3), 0, 0, 3) ps.mspi("1", ('W', 6), 0) - ps.sdmmc("0", ('W', 10), 0) - ps.vdd("", ('W', 31), 0, 1, 1) + ps.vdd("", ('W', 10), 0, 5, 1) + ps.sdmmc("0", ('W', 11), 0) + ps.vss("", ('W', 17), 0, 6, 1) + ps.vdd("", ('W', 31), 0, 6, 1) #ps.mspi("0", ('W', 8), 0) #ps.mspi("1", ('W', 8), 0) @@ -87,12 +98,12 @@ def pinspec(): # using "BM:Name". Pins are removed in-order as listed from # lists (interfaces, EINTs, PWMs) from available pins. - ls180 = ['ULPI0/8', 'ULPI1', 'MMC0', 'MMC2', 'SD0', 'UART0', - 'TWI0', 'MSPI0', 'B3:SD1', ] + ls180 = ['SD0', 'UART0', 'GPIOS', 'GPIOE', 'JTAG', 'PWM', 'EINT', + 'VDD', 'VSS', 'CLK', 'RST', + 'TWI0', 'MSPI0', 'MSPI1', 'SDR'] ls180_eint = [] ls180_pwm = []#['B0:PWM_0'] descriptions = { - 'MMC': 'internal (on Card)', 'SD0': 'user-facing: internal (on Card), multiplexed with JTAG\n' 'and UART2, for debug purposes', 'TWI2': 'I2C.\n', @@ -100,8 +111,10 @@ def pinspec(): 'MSPI1': '', 'UART0': '', 'LPC1': '', + 'CLK': '', + 'RST': '', 'LPC2': '', - 'MMC0': '', + 'SDR': '', 'B1:LCD/22': '18-bit RGB/TTL LCD', 'ULPI0/8': 'user-facing: internal (on Card), USB-OTG ULPI PHY', 'ULPI1': 'dual USB2 Host ULPI PHY' diff --git a/src/spec/pinfunctions.py b/src/spec/pinfunctions.py index b7318dd..c046dbd 100644 --- a/src/spec/pinfunctions.py +++ b/src/spec/pinfunctions.py @@ -284,7 +284,7 @@ def rst(suffix, bank): pinspec = (('IIS', i2s), ('LPC', lpc), ('EMMC', emmc), - ('MMC', sdmmc), + ('SD', sdmmc), ('MSPI', mspi), ('MQSPI', mquadspi), ('SPI', spi), -- 2.30.2