X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fi2c.py;h=f2b0c2de68fd932bb977aa19d2d0972a11f12720;hp=bbf6925078738714f12a15374cb126920f6fb013;hb=922763abc279fc5d4e0ed93ed6c6bebbf68d7baf;hpb=9c93add5aeca95c568afab7fe249c0586d8dec6b diff --git a/decoders/i2c.py b/decoders/i2c.py index bbf6925..f2b0c2d 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -125,7 +125,13 @@ # 'signals': [{'SCL': }]} # -def decode(inbuf): +def decode(l): + print(l) + sigrok.put(l) + + + +def decode2(inbuf): """I2C protocol decoder""" # FIXME: Get the data in the correct format in the first place. @@ -233,18 +239,27 @@ def decode(inbuf): # FIXME: Just for testing... return str(out) -def register(): - return { - 'id': 'i2c', - 'name': 'I2C', - 'desc': 'Inter-Integrated Circuit (I2C) bus', - 'inputformats': ['raw'], - 'signalnames': { - 'SCL': 'Serial clock line', - 'SDA': 'Serial data line', - }, - 'outputformats': ['i2c'], - } +register = { + 'id': 'i2c', + 'name': 'I2C', + 'longname': 'Inter-Integrated Circuit (I2C) bus', + 'desc': 'I2C is a two-wire, multi-master, serial bus.', + 'longdesc': '...', + 'author': 'Uwe Hermann', + 'email': 'uwe@hermann-uwe.de', + 'license': 'gplv2+', + 'in': ['logic'], + 'out': ['i2c'], + 'probes': [ + ['scl', 'Serial clock line'], + ['sda', 'Serial data line'], + ], + 'options': { + 'address-space': ['Address space (in bits)', 7], + }, + # 'start': start, + # 'report': report, +} # Use psyco (if available) as it results in huge performance improvements. try: