From: Luke Kenneth Casson Leighton Date: Tue, 24 Jul 2018 11:49:49 +0000 (+0100) Subject: add sdcard interface X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d3be1c98f7332822827babdcb86ca87b538b5b1;p=pinmux.git add sdcard interface --- diff --git a/src/bsv/interface_decl.py b/src/bsv/interface_decl.py index 7da8371..1840ba1 100644 --- a/src/bsv/interface_decl.py +++ b/src/bsv/interface_decl.py @@ -488,6 +488,17 @@ class InterfaceLCD(InterfaceBus, Interface): return len(pins) +class InterfaceSD(InterfaceBus, Interface): + + def __init__(self, *args): + InterfaceBus.__init__(self, ['io_out', 'io_out_en', 'io_in'], + "Bit#({0})", "d") + Interface.__init__(self, *args) + + def get_n_iopins(self, pins): # HACK! assume in/out/outen so div by 3 + return len(pins) / 3 + + class InterfaceNSPI(InterfaceBus, Interface): def __init__(self, *args): @@ -512,6 +523,9 @@ class InterfaceEINT(Interface): class InterfaceGPIO(InterfaceBus, Interface): + """ note: the busfilter cuts out everything as the entire set of pins + is a bus, but it's less code. get_nonbuspins returns empty list. + """ def __init__(self, ifacename, pinspecs, ganged=None, single=False): InterfaceBus.__init__(self, ['out', 'out_en', 'in'], @@ -531,6 +545,7 @@ class Interfaces(InterfacesBase, PeripheralInterfaces): {'gpio': InterfaceGPIO, 'spi': InterfaceNSPI, 'lcd': InterfaceLCD, + 'sd': InterfaceSD, 'qspi': InterfaceNSPI, 'eint': InterfaceEINT}) PeripheralInterfaces.__init__(self)