X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fedid%2Fpd.py;h=e655fdd0a187a71bd09e2134d1937c7103cec391;hb=83df730dd21ce52670a593455cfe5e732989a90d;hp=a03fe67c9644cbfbdf5b668eb7b4b4d403e89216;hpb=24c74fd30fb161837c5f8b01baf3c0fe2dfa4ed5;p=libsigrokdecode.git diff --git a/decoders/edid/pd.py b/decoders/edid/pd.py index a03fe67..e655fdd 100644 --- a/decoders/edid/pd.py +++ b/decoders/edid/pd.py @@ -1,5 +1,5 @@ ## -## This file is part of the sigrok project. +## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Bert Vermeulen ## @@ -17,8 +17,6 @@ ## along with this program; if not, see . ## -# EDID protocol decoder - # TODO: # - EDID < 1.3 # - add short annotations @@ -70,24 +68,23 @@ xy_ratio = [ (16, 9), ] -# Annotation types +# Annotation classes ANN_FIELDS = 0 ANN_SECTIONS = 1 class Decoder(srd.Decoder): - api_version = 1 + api_version = 2 id = 'edid' name = 'EDID' longname = 'Extended Display Identification Data' desc = 'Data structure describing display device capabilities.' license = 'gplv3+' - inputs = ['ddc2'] + inputs = ['i2c'] outputs = ['edid'] - options = {} - annotations = [ - ['EDID fields', 'EDID structure fields'], - ['EDID sections', 'EDID structure sections'], - ] + annotations = ( + ('fields', 'EDID structure fields'), + ('sections', 'EDID structure sections'), + ) def __init__(self, **kwargs): self.state = None @@ -98,11 +95,8 @@ class Decoder(srd.Decoder): # Received data self.cache = [] - def start(self, metadata): - self.out_ann = self.add(srd.OUTPUT_ANN, 'edid') - - def report(self): - pass + def start(self): + self.out_ann = self.register(srd.OUTPUT_ANN) def decode(self, ss, es, data): cmd, data = data @@ -471,4 +465,3 @@ class Decoder(srd.Decoder): else: if self.cache[i+2] == 0 or self.cache[i+4] == 0: self.decode_descriptor(i) -