From: Luke Kenneth Casson Leighton Date: Fri, 3 Aug 2018 06:47:33 +0000 (+0100) Subject: read config mux and output to slow_peripherals.bsv X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f5212f4ec5a189908c53184bb3c30d2b49a3fcd;p=pinmux.git read config mux and output to slow_peripherals.bsv --- diff --git a/src/bsv/peripheral_gen/gpio.py b/src/bsv/peripheral_gen/gpio.py index b9f8504..095d654 100644 --- a/src/bsv/peripheral_gen/gpio.py +++ b/src/bsv/peripheral_gen/gpio.py @@ -36,8 +36,10 @@ class gpio(PBase): def mkslow_peripheral(self, size=0): print "gpioslow", self.peripheral, dir(self.peripheral) + print "gpioslow", self.peripheral.configs size = len(self.peripheral.pinspecs) - dflt = "%s" % ("0"*size*2) # XX TODO: read default from config + dflt_ = "%s" % ("0"*size*2) # default if not set in spec + dflt = self.peripheral.configs[0].get("muxconfig", dflt_) return "MUX#(%d) mux{0} <- mkmux(`b%s);\n" % (size, dflt)+ \ "GPIO#(%d) gpio{0} <- mkgpio();" % size