X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Ftransitioncounter.py;h=4cd1670bbc644457720b4eaa031a20134d423c21;hp=a6d331e85fc1af676d87edbebdce96c28d343a0a;hb=922763abc279fc5d4e0ed93ed6c6bebbf68d7baf;hpb=9c93add5aeca95c568afab7fe249c0586d8dec6b diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index a6d331e..4cd1670 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -17,8 +17,16 @@ ## 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: