X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fedid%2Fpd.py;h=e655fdd0a187a71bd09e2134d1937c7103cec391;hb=70aa53ec10dabe4a5267e142974b35d1312f7119;hp=1f621b22a5f1bef8890f4c49dad69fb9a8559e07;hpb=8915b34659332288aab38780d8f10d75c4c83e7f;p=libsigrokdecode.git diff --git a/decoders/edid/pd.py b/decoders/edid/pd.py index 1f621b2..e655fdd 100644 --- a/decoders/edid/pd.py +++ b/decoders/edid/pd.py @@ -17,8 +17,6 @@ ## along with this program; if not, see . ## -# EDID protocol decoder - # TODO: # - EDID < 1.3 # - add short annotations @@ -70,12 +68,12 @@ 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' @@ -83,13 +81,10 @@ class Decoder(srd.Decoder): license = 'gplv3+' inputs = ['i2c'] outputs = ['edid'] - probes = [] - optional_probes = [] - 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 @@ -101,10 +96,7 @@ class Decoder(srd.Decoder): self.cache = [] def start(self): - self.out_ann = self.add(srd.OUTPUT_ANN, 'edid') - - def report(self): - pass + self.out_ann = self.register(srd.OUTPUT_ANN) def decode(self, ss, es, data): cmd, data = data @@ -473,4 +465,3 @@ class Decoder(srd.Decoder): else: if self.cache[i+2] == 0 or self.cache[i+4] == 0: self.decode_descriptor(i) -