summaryrefslogtreecommitdiff
path: root/decoders/parallel/pd.py
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/parallel/pd.py')
-rw-r--r--decoders/parallel/pd.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/decoders/parallel/pd.py b/decoders/parallel/pd.py
index 5acfb67..96741e7 100644
--- a/decoders/parallel/pd.py
+++ b/decoders/parallel/pd.py
@@ -108,6 +108,9 @@ class Decoder(srd.Decoder):
('words', 'Words', (Ann.WORD,)),
('warnings', 'Warnings', (Ann.WARN,)),
)
+ binary = (
+ ('binary', 'Binary'),
+ )
def __init__(self):
self.reset()
@@ -118,6 +121,7 @@ class Decoder(srd.Decoder):
def start(self):
self.out_python = self.register(srd.OUTPUT_PYTHON)
+ self.out_binary = self.register(srd.OUTPUT_BINARY)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putg(self, ss, es, ann, txts):
@@ -126,6 +130,9 @@ class Decoder(srd.Decoder):
def putpy(self, ss, es, ann, data):
self.put(ss, es, self.out_python, [ann, data])
+ def putbin(self, ss, es, ann_class, data):
+ self.put(ss, es, self.out_binary, [ann_class, data])
+
def flush_word(self, bus_width):
if not self.word_items:
return
@@ -177,6 +184,7 @@ class Decoder(srd.Decoder):
txts = [self.fmt_item.format(data)]
self.putg(ss, es, Ann.ITEM, txts)
self.putpy(ss, es, 'ITEM', (data, bus_width))
+ self.putbin(ss, es, 0, data.to_bytes(1, byteorder='big'))
# Optionally queue the currently seen item.
if item is not None: