add rgbttl mk_pincon
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 24 Jul 2018 10:25:09 +0000 (11:25 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 24 Jul 2018 10:25:09 +0000 (11:25 +0100)
src/bsv/peripheral_gen/rgbttl.py

index e350e65e447b6ac592edf617e5d3f4cbb6fbe108..3ba08c6749da946044627880daa99f0f8846f21e 100644 (file)
@@ -17,4 +17,20 @@ class rgbttl(PBase):
         return "lcd{0}.slave"
 
     def pinname_out(self, pname):
-        return pname
+        if not pname.startswith('out'):
+            return pname
+        return ''
+
+    def mk_pincon(self, name, count):
+        ret = [PBase.mk_pincon(self, name, count)]
+        # special-case for gpio in, store in a temporary vector
+        plen = len(self.peripheral.pinspecs)
+        template = "      mkConnection({0}.{1},\n\t\t\t{2}.{1});"
+        name = self.get_iname(count)
+        ps = "pinmux.peripheral_side.%s" % name
+        n = "{0}".format(name)
+        for ptype in ['data_out']:
+            ret.append(template.format(ps, ptype, n))
+        return '\n'.join(ret)
+
+