diff options
author | Bert Vermeulen <bert@biot.com> | 2012-01-29 18:42:10 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2012-01-29 18:44:11 +0100 |
commit | 70ccb1ce0cf0ae5e125c651a2ed7947ae0e58b19 (patch) | |
tree | ac9a9c067c2fb5dba82da63fbed1468ac834aec6 | |
parent | 066ecdabd251d503649850f09ff2bf161fc3364b (diff) | |
download | libsigrokdecode-70ccb1ce0cf0ae5e125c651a2ed7947ae0e58b19.tar.gz libsigrokdecode-70ccb1ce0cf0ae5e125c651a2ed7947ae0e58b19.zip |
ddc: add protocol output
-rw-r--r-- | decoders/ddc/ddc.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/decoders/ddc/ddc.py b/decoders/ddc/ddc.py index f59be8e..2cb4552 100644 --- a/decoders/ddc/ddc.py +++ b/decoders/ddc/ddc.py @@ -14,7 +14,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, If not, see <http://www.gnu.org/licenses/>. +## along with this program; if not, see <http://www.gnu.org/licenses/>. ## ''' @@ -30,28 +30,24 @@ import sigrokdecode as srd class Decoder(srd.Decoder): api_version = 1 id = 'ddc' - name = 'DDC' + name = 'DDC2' longname = 'Display Data Channel' desc = 'A protocol for communication between computers and displays.' longdesc = '' license = 'gplv3+' inputs = ['i2c'] - outputs = ['ddc'] - probes = [] - extra_probes = [] + outputs = ['ddc2'] options = {} annotations = [ - ['Byte stream', 'DDC byte stream as read from display.'], + ['Byte stream', 'DDC2B byte stream as read from display.'], ] def __init__(self, **kwargs): self.state = None def start(self, metadata): - self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc') - - def report(self): - pass + self.out_proto = self.add(srd.OUTPUT_PROTO, 'ddc2') + self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc2') def decode(self, ss, es, data): try: @@ -75,6 +71,7 @@ class Decoder(srd.Decoder): if cmd == 'DATA READ': # There shouldn't be anything but data reads on this # address, so ignore everything else. + self.put(ss, es, self.out_proto, data) self.put(ss, es, self.out_ann, [0, ['0x%.2x' % data]]) else: raise Exception('Invalid state: %s' % self.state) |