X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoders%2Fuart.py;h=45465213e717797c533f995551d18702e603cf3c;hb=d0e93c76e381eff58ca23949301f781b24ba4a8b;hp=1c204dc053d7b9defccddb43b4883a232e2ad64d;hpb=94d43b37bd34263f5ed9f7135aac5fe7413c7f07;p=libsigrokdecode.git diff --git a/decoders/uart.py b/decoders/uart.py index 1c204dc..4546521 100644 --- a/decoders/uart.py +++ b/decoders/uart.py @@ -125,7 +125,7 @@ # [T_PARITY_ERROR, (0, 1)] # -import sigrokdecode +import sigrokdecode as srd # States WAIT_FOR_START_BIT = 0 @@ -190,7 +190,7 @@ def parity_ok(parity_type, parity_bit, data, num_data_bits): else: raise Exception('Invalid parity type: %d' % parity_type) -class Decoder(sigrokdecode.Decoder): +class Decoder(srd.Decoder): id = 'uart' name = 'UART' longname = 'Universal Asynchronous Receiver/Transmitter (UART)' @@ -217,7 +217,7 @@ class Decoder(sigrokdecode.Decoder): # TODO: Options to invert the signal(s). # ... } - annotation = [ + annotations = [ # ANN_ASCII ["ASCII", "TODO: description"], # ANN_DEC @@ -231,9 +231,6 @@ class Decoder(sigrokdecode.Decoder): ] def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None - # Set defaults, can be overridden in 'start'. self.baudrate = 115200 self.num_data_bits = 8 @@ -258,8 +255,8 @@ class Decoder(sigrokdecode.Decoder): def start(self, metadata): self.samplerate = metadata['samplerate'] - self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'uart') - self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'uart') + self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'uart') + self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'uart') # TODO ### self.baudrate = metadata['baudrate']