summaryrefslogtreecommitdiffstats
path: root/libtoprammer/top2049
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2010-02-25 20:13:18 +0100
committerMichael Buesch <mb@bu3sch.de>2010-02-25 20:13:18 +0100
commit82e2de5fe9d4822a456ab78257f65526b1485799 (patch)
tree486eb0e9a41838f650fa45f202626e5c63b1552f /libtoprammer/top2049
parentce2db44d9846adf13b5477a3cfa714b6eb17d3d1 (diff)
downloadtoprammer-82e2de5fe9d4822a456ab78257f65526b1485799.tar.xz
toprammer-82e2de5fe9d4822a456ab78257f65526b1485799.zip
Support dumping GND layouts
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'libtoprammer/top2049')
-rw-r--r--libtoprammer/top2049/gnd_layouts.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/libtoprammer/top2049/gnd_layouts.py b/libtoprammer/top2049/gnd_layouts.py
index 5a3d6b5..2e72a7d 100644
--- a/libtoprammer/top2049/gnd_layouts.py
+++ b/libtoprammer/top2049/gnd_layouts.py
@@ -40,6 +40,22 @@ class GNDLayout:
mask |= (1 << (pin - 1))
self.layouts.append( (id, mask) )
+ def __repr__(self):
+ res = ""
+ for (id, zif_mask) in self.supportedLayouts():
+ res += "Layout %d:\n" % id
+ res += " o---------o\n"
+ for pin in range(1, 25):
+ left = " "
+ right = ""
+ if (1 << (pin - 1)) & zif_mask:
+ left = "HOT >"
+ if (1 << (49 - pin - 1)) & zif_mask:
+ right = "< HOT"
+ res += "%s | %2d | %2d | %s\n" % (left, pin, 49 - pin, right)
+ res += " o---------o\n\n"
+ return res
+
def supportedLayouts(self):
"""Returns a list of supported layouts.
Each entry is a tuple of (id, bitmask), where bitmask is
@@ -66,3 +82,7 @@ class GNDLayout:
def setLayoutID(self, id):
"Load a specific layout ID."
self.top.cmdLoadGNDLayout(id)
+
+if __name__ == "__main__":
+ print "ZIF socket GND layouts"
+ print GNDLayout()
bues.ch cgit interface