set up defaults for mux
[pinmux.git] / src / bsv / peripheral_gen / gpio.py
index f96525d5ceb92bb07c26d281198e368060afc4f3..b9f8504d7a6f1c626207e22e0d00af3289c3bddc 100644 (file)
@@ -37,7 +37,8 @@ class gpio(PBase):
     def mkslow_peripheral(self, size=0):
         print "gpioslow", self.peripheral, dir(self.peripheral)
         size = len(self.peripheral.pinspecs)
-        return "MUX#(%d) mux{0} <- mkmux();\n" % size + \
+        dflt = "%s" % ("0"*size*2) # XX TODO: read default from config
+        return "MUX#(%d) mux{0} <- mkmux(`b%s);\n" % (size, dflt)+ \
                "GPIO#(%d) gpio{0} <- mkgpio();" % size
 
     def mk_connection(self, count, fabricname, typ):
@@ -82,7 +83,7 @@ class gpio(PBase):
         ret = []
         plen = len(self.peripheral.pinspecs)
         template = "mkConnection({0}.{1},\n\t\t\t{2}_{1});"
-        ps = "!!!pinmux.peripheral_side.%s" % name
+        ps = "pinmux.peripheral_side.%s" % name
         n = "{0}.func.gpio".format(name)
         for ptype in ['out', 'out_en', 'in']:
             ret.append(template.format(ps, ptype, n))