summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoeren Apel <soeren@apelpie.net>2017-10-25 09:28:56 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-11-02 00:33:09 +0100
commitd40e77620426826fb589bfc1c44009bf90a1eb36 (patch)
tree50c3b91573ab43406ab0099a6da957519c8b8318
parenta5ff553f2ea180580a1713691e02ff3da59e5061 (diff)
downloadlibsigrokdecode-d40e77620426826fb589bfc1c44009bf90a1eb36.tar.gz
libsigrokdecode-d40e77620426826fb589bfc1c44009bf90a1eb36.zip
ds243x: Add binary output for data read from EEPROM
-rw-r--r--decoders/ds243x/pd.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/decoders/ds243x/pd.py b/decoders/ds243x/pd.py
index 0c51596..05313dc 100644
--- a/decoders/ds243x/pd.py
+++ b/decoders/ds243x/pd.py
@@ -72,6 +72,9 @@ class Decoder(srd.Decoder):
annotations = (
('text', 'Human-readable text'),
)
+ binary = (
+ ('mem_read', 'Data read from memory'),
+ )
def __init__(self):
# Bytes for function command.
@@ -82,6 +85,7 @@ class Decoder(srd.Decoder):
def start(self):
self.out_ann = self.register(srd.OUTPUT_ANN)
+ self.out_binary = self.register(srd.OUTPUT_BINARY)
def putx(self, data):
self.put(self.ss, self.es, self.out_ann, data)
@@ -257,3 +261,6 @@ class Decoder(srd.Decoder):
elif 3 < len(self.bytes):
self.ss, self.es = ss, es
self.putx([0, ['Data: 0x%02x' % (self.bytes[-1])]])
+
+ bdata = self.bytes[-1].to_bytes(1, byteorder='big')
+ self.put(ss, es, self.out_binary, [0, bdata])