]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/ebr30a_i2c_demux/ebr30a_i2c_demux.py
srd: I2C: change format to have ACK/NACK bits as separate events
[libsigrokdecode.git] / decoders / ebr30a_i2c_demux / ebr30a_i2c_demux.py
index 59649fd529e51fcffecacdc10bf2adb5122272d5..4c4a8e42cfbc671fb83c924d2f3a4158ae428951 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-#
 # TrekStor EBR30-a I2C demux protocol decoder
-#
-# Takes an I2C stream as input and outputs 3 different I2C streams, for the
-# 3 different I2C devices on the TrekStor EBR30-a eBook reader (which are all
-# physically connected to the same SCL/SDA lines).
-#
-# I2C slave addresses:
-#
-#  - AXP199 battery management chip: 0x69/0x68 (8bit R/W), 0x34 (7bit)
-#  - H8563S RTC chip: 0xa3/0xa2 (8bit R/W), 0x51 (7bit)
-#  - Unknown accelerometer chip: 0x2b/0x2a (8bit R/W), 0x15 (7bit)
-#
 
 import sigrokdecode as srd
 
@@ -50,7 +38,7 @@ class Decoder(srd.Decoder):
     inputs = ['i2c']
     outputs = ['i2c-axp199', 'i2c-h8563s', 'i2c-accel'] # TODO: type vs. inst.
     probes = []
-    extra_probes = []
+    optional_probes = []
     options = {}
     annotations = []
 
@@ -76,10 +64,10 @@ class Decoder(srd.Decoder):
     # get the whole chunk of packets (from START to STOP).
     def decode(self, ss, es, data):
 
-        cmd, databyte, ack_bit = data
+        cmd, databyte = data
 
         # Add the I2C packet to our local cache.
-        self.packets += [[ss, es, data]]
+        self.packets.append([ss, es, data])
 
         if cmd in ('ADDRESS READ', 'ADDRESS WRITE'):
             # print(hex(databyte))