From: Uwe Hermann Date: Thu, 30 Jan 2014 21:37:29 +0000 (+0100) Subject: s/out_proto/out_python/. X-Git-Tag: libsigrokdecode-0.3.0~139 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c515eed7ef7a04a42b5b34abd308e08d6942835e;p=libsigrokdecode.git s/out_proto/out_python/. The output type is now called OUTPUT_PYTHON, adapt all PDs to that. --- diff --git a/decoders/avr_isp/pd.py b/decoders/avr_isp/pd.py index a0daf0b..be8ee29 100644 --- a/decoders/avr_isp/pd.py +++ b/decoders/avr_isp/pd.py @@ -49,7 +49,7 @@ class Decoder(srd.Decoder): self.xx, self.yy, self.zz, self.mm = 0, 0, 0, 0 def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/can/pd.py b/decoders/can/pd.py index 0234e33..c394cf1 100644 --- a/decoders/can/pd.py +++ b/decoders/can/pd.py @@ -62,7 +62,7 @@ class Decoder(srd.Decoder): self.reset_variables() def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def metadata(self, key, value): diff --git a/decoders/dcf77/pd.py b/decoders/dcf77/pd.py index 4c76eeb..e8d1443 100644 --- a/decoders/dcf77/pd.py +++ b/decoders/dcf77/pd.py @@ -74,7 +74,7 @@ class Decoder(srd.Decoder): self.dcf77_bitnumber_is_known = 0 def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def metadata(self, key, value): diff --git a/decoders/guess_bitrate/pd.py b/decoders/guess_bitrate/pd.py index 0ab3129..3249b31 100644 --- a/decoders/guess_bitrate/pd.py +++ b/decoders/guess_bitrate/pd.py @@ -49,7 +49,7 @@ class Decoder(srd.Decoder): def start(self, metadata): self.samplerate = metadata['samplerate'] - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def decode(self, ss, es, data): diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py index a959eca..4d77920 100644 --- a/decoders/i2c/pd.py +++ b/decoders/i2c/pd.py @@ -26,7 +26,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: I²C packet: [, ] @@ -117,7 +117,7 @@ class Decoder(srd.Decoder): self.samplerate = value def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) self.out_binary = self.register(srd.OUTPUT_BINARY) self.out_bitrate = self.register(srd.OUTPUT_META, @@ -127,7 +127,7 @@ class Decoder(srd.Decoder): self.put(self.startsample, self.samplenum, self.out_ann, data) def putp(self, data): - self.put(self.startsample, self.samplenum, self.out_proto, data) + self.put(self.startsample, self.samplenum, self.out_python, data) def putb(self, data): self.put(self.startsample, self.samplenum, self.out_binary, data) diff --git a/decoders/i2cdemux/pd.py b/decoders/i2cdemux/pd.py index 23c4253..12ebb88 100644 --- a/decoders/i2cdemux/pd.py +++ b/decoders/i2cdemux/pd.py @@ -41,7 +41,7 @@ class Decoder(srd.Decoder): self.streamcount = 0 # Number of created output streams def start(self): - self.out_proto = [] + self.out_python = [] # Grab I²C packets into a local cache, until an I²C STOP condition # packet comes along. At some point before that STOP condition, there @@ -63,8 +63,8 @@ class Decoder(srd.Decoder): # We're never seen this slave, add a new stream. self.slaves.append(databyte) - self.out_proto.append(self.register(srd.OUTPUT_PYTHON, - proto_id='i2c-%s' % hex(databyte))) + self.out_python.append(self.register(srd.OUTPUT_PYTHON, + proto_id='i2c-%s' % hex(databyte))) self.stream = self.streamcount self.streamcount += 1 elif cmd == 'STOP': @@ -73,7 +73,7 @@ class Decoder(srd.Decoder): # Send the whole chunk of I²C packets to the correct stream. for p in self.packets: - self.put(p[0], p[1], self.out_proto[self.stream], p[2]) + self.put(p[0], p[1], self.out_python[self.stream], p[2]) self.packets = [] self.stream = -1 diff --git a/decoders/i2cfilter/pd.py b/decoders/i2cfilter/pd.py index 70613d2..09c12f1 100644 --- a/decoders/i2cfilter/pd.py +++ b/decoders/i2cfilter/pd.py @@ -46,7 +46,7 @@ class Decoder(srd.Decoder): self.packets = [] # Local cache of I²C packets def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON, proto_id='i2c') + self.out_python = self.register(srd.OUTPUT_PYTHON, proto_id='i2c') if self.options['address'] not in range(0, 127 + 1): raise Exception('Invalid slave (must be 0..127).') if self.options['direction'] not in ('both', 'read', 'write'): @@ -86,7 +86,7 @@ class Decoder(srd.Decoder): # TODO: START->STOP chunks with both read and write (Repeat START) # Otherwise, send out the whole chunk of I²C packets. for p in self.packets: - self.put(p[0], p[1], self.out_proto, p[2]) + self.put(p[0], p[1], self.out_python, p[2]) self.packets = [] else: diff --git a/decoders/i2s/pd.py b/decoders/i2s/pd.py index 3064b7d..73bfa6f 100644 --- a/decoders/i2s/pd.py +++ b/decoders/i2s/pd.py @@ -21,7 +21,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: Packet: [, ] @@ -71,7 +71,7 @@ class Decoder(srd.Decoder): self.wrote_wav_header = False def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_bin = self.register(srd.OUTPUT_BINARY) self.out_ann = self.register(srd.OUTPUT_ANN) @@ -80,7 +80,7 @@ class Decoder(srd.Decoder): self.samplerate = value def putpb(self, data): - self.put(self.start_sample, self.samplenum, self.out_proto, data) + self.put(self.start_sample, self.samplenum, self.out_python, data) def putbin(self, data): self.put(self.start_sample, self.samplenum, self.out_bin, data) diff --git a/decoders/jtag/pd.py b/decoders/jtag/pd.py index 0241924..26ddbac 100644 --- a/decoders/jtag/pd.py +++ b/decoders/jtag/pd.py @@ -21,7 +21,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: JTAG packet: [, ] @@ -96,14 +96,14 @@ class Decoder(srd.Decoder): self.first = True def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): self.put(self.ss_item, self.es_item, self.out_ann, data) def putp(self, data): - self.put(self.ss_item, self.es_item, self.out_proto, data) + self.put(self.ss_item, self.es_item, self.out_python, data) def advance_state_machine(self, tms): self.oldstate = self.state diff --git a/decoders/jtag_stm32/pd.py b/decoders/jtag_stm32/pd.py index 3928ae3..7d6a71d 100644 --- a/decoders/jtag_stm32/pd.py +++ b/decoders/jtag_stm32/pd.py @@ -139,7 +139,7 @@ class Decoder(srd.Decoder): # self.state = 'BYPASS' def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def handle_reg_bypass(self, cmd, bits): diff --git a/decoders/lm75/pd.py b/decoders/lm75/pd.py index 2f4d135..58c2c89 100644 --- a/decoders/lm75/pd.py +++ b/decoders/lm75/pd.py @@ -73,7 +73,7 @@ class Decoder(srd.Decoder): self.databytes = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py index 983e8d9..584b005 100644 --- a/decoders/lpc/pd.py +++ b/decoders/lpc/pd.py @@ -149,7 +149,7 @@ class Decoder(srd.Decoder): self.ss_block = self.es_block = None def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putb(self, data): diff --git a/decoders/midi/pd.py b/decoders/midi/pd.py index 2bd1d89..b20dcc3 100644 --- a/decoders/midi/pd.py +++ b/decoders/midi/pd.py @@ -49,7 +49,7 @@ class Decoder(srd.Decoder): self.es_block = None def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/mlx90614/pd.py b/decoders/mlx90614/pd.py index 08c7a7b..14451c8 100644 --- a/decoders/mlx90614/pd.py +++ b/decoders/mlx90614/pd.py @@ -42,7 +42,7 @@ class Decoder(srd.Decoder): self.data = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/mx25lxx05d/pd.py b/decoders/mx25lxx05d/pd.py index fe1ca62..faecf59 100644 --- a/decoders/mx25lxx05d/pd.py +++ b/decoders/mx25lxx05d/pd.py @@ -107,7 +107,7 @@ class Decoder(srd.Decoder): self.data = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/mxc6225xu/pd.py b/decoders/mxc6225xu/pd.py index 94dff27..46c6c09 100644 --- a/decoders/mxc6225xu/pd.py +++ b/decoders/mxc6225xu/pd.py @@ -81,7 +81,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/nunchuk/pd.py b/decoders/nunchuk/pd.py index 01563c2..d4fe34a 100644 --- a/decoders/nunchuk/pd.py +++ b/decoders/nunchuk/pd.py @@ -46,7 +46,7 @@ class Decoder(srd.Decoder): self.init_seq = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/onewire_link/pd.py b/decoders/onewire_link/pd.py index 650a7a0..c27abc6 100644 --- a/decoders/onewire_link/pd.py +++ b/decoders/onewire_link/pd.py @@ -60,7 +60,7 @@ class Decoder(srd.Decoder): self.put(0, 0, self.out_ann, data) def putpb(self, data): - self.put(self.fall, self.samplenum, self.out_proto, data) + self.put(self.fall, self.samplenum, self.out_python, data) def putb(self, data): self.put(self.fall, self.samplenum, self.out_ann, data) @@ -72,7 +72,7 @@ class Decoder(srd.Decoder): self.put(self.fall, self.rise, self.out_ann, data) def putprs(self, data): - self.put(self.rise, self.samplenum, self.out_proto, data) + self.put(self.rise, self.samplenum, self.out_python, data) def putrs(self, data): self.put(self.rise, self.samplenum, self.out_ann, data) @@ -90,7 +90,7 @@ class Decoder(srd.Decoder): self.rise = 0 def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def metadata(self, key, value): diff --git a/decoders/onewire_network/pd.py b/decoders/onewire_network/pd.py index 19ee649..a80132e 100644 --- a/decoders/onewire_network/pd.py +++ b/decoders/onewire_network/pd.py @@ -60,7 +60,7 @@ class Decoder(srd.Decoder): self.rom = 0x0000000000000000 def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): @@ -69,7 +69,7 @@ class Decoder(srd.Decoder): def puty(self, data): # Helper function for most protocol packets. - self.put(self.beg, self.end, self.out_proto, data) + self.put(self.beg, self.end, self.out_python, data) def decode(self, ss, es, data): code, val = data @@ -80,7 +80,7 @@ class Decoder(srd.Decoder): self.bit_cnt = 0 self.put(ss, es, self.out_ann, [0, ['Reset/presence: %s' % ('true' if val else 'false')]]) - self.put(ss, es, self.out_proto, ['RESET/PRESENCE', val]) + self.put(ss, es, self.out_python, ['RESET/PRESENCE', val]) self.state = 'COMMAND' return diff --git a/decoders/pan1321/pd.py b/decoders/pan1321/pd.py index 8db3b8f..f345506 100644 --- a/decoders/pan1321/pd.py +++ b/decoders/pan1321/pd.py @@ -47,7 +47,7 @@ class Decoder(srd.Decoder): self.ss_block = None def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/parallel/pd.py b/decoders/parallel/pd.py index 540ab24..b2903d2 100644 --- a/decoders/parallel/pd.py +++ b/decoders/parallel/pd.py @@ -21,7 +21,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: Packet: [, ] @@ -95,17 +95,17 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putpb(self, data): - self.put(self.ss_item, self.es_item, self.out_proto, data) + self.put(self.ss_item, self.es_item, self.out_python, data) def putb(self, data): self.put(self.ss_item, self.es_item, self.out_ann, data) def putpw(self, data): - self.put(self.ss_word, self.es_word, self.out_proto, data) + self.put(self.ss_word, self.es_word, self.out_python, data) def putw(self, data): self.put(self.ss_word, self.es_word, self.out_ann, data) @@ -142,7 +142,7 @@ class Decoder(srd.Decoder): if self.itemcount < ws: return - # Output annotations/proto for a word (a collection of items). + # Output annotations/python for a word (a collection of items). word = 0 for i in range(ws): if endian == 'little': diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index d2d01d1..afc2fe0 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/pd.py @@ -54,7 +54,7 @@ class Decoder(srd.Decoder): self.years = -1 def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py index 0ff0e22..8324e4f 100644 --- a/decoders/sdcard_spi/pd.py +++ b/decoders/sdcard_spi/pd.py @@ -96,7 +96,7 @@ class Decoder(srd.Decoder): self.read_buf = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py index a7830cd..7761f31 100644 --- a/decoders/spi/pd.py +++ b/decoders/spi/pd.py @@ -22,7 +22,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: SPI packet: [, , ] @@ -108,13 +108,13 @@ class Decoder(srd.Decoder): self.samplerate = value def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) self.out_bitrate = self.register(srd.OUTPUT_META, meta=(int, 'Bitrate', 'Bitrate during transfers')) def putpw(self, data): - self.put(self.startsample, self.samplenum, self.out_proto, data) + self.put(self.startsample, self.samplenum, self.out_python, data) def putw(self, data): self.put(self.startsample, self.samplenum, self.out_ann, data) @@ -179,7 +179,7 @@ class Decoder(srd.Decoder): def find_clk_edge(self, miso, mosi, clk, cs): if self.have_cs and self.oldcs != cs: # Send all CS# pin value changes. - self.put(self.samplenum, self.samplenum, self.out_proto, + self.put(self.samplenum, self.samplenum, self.out_python, ['CS-CHANGE', self.oldcs, cs]) self.oldcs = cs # Reset decoder state when CS# changes (and the CS# pin is used). diff --git a/decoders/tlc5620/pd.py b/decoders/tlc5620/pd.py index 8c22b85..4097c45 100644 --- a/decoders/tlc5620/pd.py +++ b/decoders/tlc5620/pd.py @@ -63,7 +63,7 @@ class Decoder(srd.Decoder): self.dac_select = self.gain = self.dac_value = None def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def handle_11bits(self): diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index 00be94b..051c803 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -21,7 +21,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: UART packet: [, , ] @@ -118,7 +118,7 @@ class Decoder(srd.Decoder): def putp(self, data): s, halfbit = self.samplenum, int(self.bit_width / 2) - self.put(s - halfbit, s + halfbit, self.out_proto, data) + self.put(s - halfbit, s + halfbit, self.out_python, data) def putbin(self, rxtx, data): s, halfbit = self.startsample[rxtx], int(self.bit_width / 2) @@ -139,7 +139,7 @@ class Decoder(srd.Decoder): self.oldpins = [1, 1] def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_bin = self.register(srd.OUTPUT_BINARY) self.out_ann = self.register(srd.OUTPUT_ANN) diff --git a/decoders/usb_packet/pd.py b/decoders/usb_packet/pd.py index e6fc355..8e5fb9e 100644 --- a/decoders/usb_packet/pd.py +++ b/decoders/usb_packet/pd.py @@ -22,7 +22,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: Packet: [, ] @@ -162,19 +162,19 @@ class Decoder(srd.Decoder): self.state = 'WAIT FOR SOP' def putpb(self, data): - self.put(self.ss, self.es, self.out_proto, data) + self.put(self.ss, self.es, self.out_python, data) def putb(self, data): self.put(self.ss, self.es, self.out_ann, data) def putpp(self, data): - self.put(self.ss_packet, self.es_packet, self.out_proto, data) + self.put(self.ss_packet, self.es_packet, self.out_python, data) def putp(self, data): self.put(self.ss_packet, self.es_packet, self.out_ann, data) def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def handle_packet(self): @@ -251,7 +251,7 @@ class Decoder(srd.Decoder): data = data[8:] self.packet_summary += ' ]' - # Convenience proto output (no annotation) for all bytes together. + # Convenience python output (no annotation) for all bytes together. self.ss, self.es = self.bits[16][1], self.bits[-16][2] self.putpb(['DATABYTES', databytes]) self.packet.append(databytes) diff --git a/decoders/usb_signalling/pd.py b/decoders/usb_signalling/pd.py index fbc390a..35ffce6 100644 --- a/decoders/usb_signalling/pd.py +++ b/decoders/usb_signalling/pd.py @@ -22,7 +22,7 @@ import sigrokdecode as srd ''' -Protocol output format: +OUTPUT_PYTHON format: Packet: [, ] @@ -107,7 +107,7 @@ class Decoder(srd.Decoder): self.state = 'IDLE' def start(self): - self.out_proto = self.register(srd.OUTPUT_PYTHON) + self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def metadata(self, key, value): @@ -118,14 +118,14 @@ class Decoder(srd.Decoder): self.halfbit = int(self.bitwidth / 2) def putpx(self, data): - self.put(self.samplenum, self.samplenum, self.out_proto, data) + self.put(self.samplenum, self.samplenum, self.out_python, data) def putx(self, data): self.put(self.samplenum, self.samplenum, self.out_ann, data) def putpm(self, data): s, h = self.samplenum, self.halfbit - self.put(self.ss_block - h, s + h, self.out_proto, data) + self.put(self.ss_block - h, s + h, self.out_python, data) def putm(self, data): s, h = self.samplenum, self.halfbit @@ -133,7 +133,7 @@ class Decoder(srd.Decoder): def putpb(self, data): s, h = self.samplenum, self.halfbit - self.put(s - h, s + h, self.out_proto, data) + self.put(s - h, s + h, self.out_python, data) def putb(self, data): s, h = self.samplenum, self.halfbit