]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/transitioncounter.py
Partial implementation of the streaming PD API.
[libsigrokdecode.git] / decoders / transitioncounter.py
index a6d331e85fc1af676d87edbebdce96c28d343a0a..4cd1670bbc644457720b4eaa031a20134d423c21 100644 (file)
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
+import sigrok
 
-def decode(inbuf):
+def decode(l):
+       """Counts the low->high and high->low transitions in the specified
+          channel(s) of the signal."""
+
+       print(l)
+       sigrok.put(l)
+
+def decode2(inbuf):
        """Counts the low->high and high->low transitions in the specified
           channel(s) of the signal."""
 
@@ -75,15 +83,26 @@ def decode(inbuf):
 
        return outbuf
 
-def register():
-       return {
-               'id': 'transitioncounter',
-               'name': 'Transition counter',
-               'desc': 'Count rising/falling edges',
-               'inputformats': ['raw'],
-               'signalnames': {}, # FIXME
-               'outputformats': ['transitioncounts'],
-       }
+register = {
+       'id': 'transitioncounter',
+       'name': 'Transition counter',
+       'longname': '...',
+       'desc': 'Counts rising/falling edges in the signal.',
+       'longdesc': '...',
+       'author': 'Uwe Hermann',
+       'email': 'uwe@hermann-uwe.de',
+       'license': 'gplv2+',
+       'in': ['logic'],
+       'out': ['transitioncounts'],
+       'probes': [
+               # All probes.
+       ],
+       'options': {
+               # No options so far.
+       },
+       # 'start': start,
+       # 'report': report,
+}
 
 # Use psyco (if available) as it results in huge performance improvements.
 try: