From: Uwe Hermann Date: Sun, 4 Mar 2012 09:40:58 +0000 (+0100) Subject: srd: PDs: More cosmetics. X-Git-Tag: libsigrokdecode-0.1.0~36 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=1541976fcac03a780b5d27046f5f8884973c08ae srd: PDs: More cosmetics. --- diff --git a/decoders/edid/__init__.py b/decoders/edid/__init__.py index d892e60..9932a81 100644 --- a/decoders/edid/__init__.py +++ b/decoders/edid/__init__.py @@ -25,7 +25,7 @@ The three-character vendor ID as specified in the EDID standard refers to a Plug and Play ID (PNPID). The list of PNPID assignments is done by Microsoft. More information is available on this page: - http://msdn.microsoft.com/en-us/windows/hardware/gg463195 + http://msdn.microsoft.com/en-us/windows/hardware/gg463195 The 'pnpids.txt' file included with this protocol decoder is derived from the list of assignments downloadable from that page. It was retrieved in @@ -33,7 +33,7 @@ January 2012. More information on EDID is available here: - https://en.wikipedia.org/wiki/Extended_display_identification_data + https://en.wikipedia.org/wiki/Extended_display_identification_data ''' from .edid import * diff --git a/decoders/i2c/i2c.py b/decoders/i2c/i2c.py index 2c11be0..cc70e96 100644 --- a/decoders/i2c/i2c.py +++ b/decoders/i2c/i2c.py @@ -38,7 +38,7 @@ ANN_SHIFTED_SHORT = 1 ANN_RAW = 2 # Values are verbose and short annotation, respectively. -protocol = { +proto = { 'START': ['START', 'S'], 'START REPEAT': ['START REPEAT', 'Sr'], 'STOP': ['STOP', 'P'], @@ -119,8 +119,8 @@ class Decoder(srd.Decoder): cmd = 'START REPEAT' if (self.is_repeat_start == 1) else 'START' self.put(self.out_proto, [cmd, None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[cmd][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[cmd][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[cmd][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[cmd][1]]]) self.state = 'FIND ADDRESS' self.bitcount = self.databyte = 0 @@ -165,8 +165,8 @@ class Decoder(srd.Decoder): cmd = 'DATA READ' self.put(self.out_proto, [cmd, d]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[cmd][0], '0x%02x' % d]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[cmd][1], '0x%02x' % d]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[cmd][0], '0x%02x' % d]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[cmd][1], '0x%02x' % d]]) # Done with this packet. self.startsample = -1 @@ -177,8 +177,8 @@ class Decoder(srd.Decoder): self.startsample = self.samplenum ack_bit = 'NACK' if (sda == 1) else 'ACK' self.put(self.out_proto, [ack_bit, None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol[ack_bit][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[ack_bit][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto[ack_bit][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto[ack_bit][1]]]) # There could be multiple data bytes in a row, so either find # another data byte or a STOP condition next. self.state = 'FIND DATA' @@ -186,8 +186,8 @@ class Decoder(srd.Decoder): def found_stop(self, scl, sda): self.startsample = self.samplenum self.put(self.out_proto, ['STOP', None]) - self.put(self.out_ann, [ANN_SHIFTED, [protocol['STOP'][0]]]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol['STOP'][1]]]) + self.put(self.out_ann, [ANN_SHIFTED, [proto['STOP'][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, [proto['STOP'][1]]]) self.state = 'FIND START' self.is_repeat_start = 0 diff --git a/decoders/mlx90614/__init__.py b/decoders/mlx90614/__init__.py index fd62251..0ceabc2 100644 --- a/decoders/mlx90614/__init__.py +++ b/decoders/mlx90614/__init__.py @@ -18,5 +18,12 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +''' +Melexis MLX90614 protocol decoder. + +Details: +TODO +''' + from .mlx90614 import * diff --git a/decoders/mx25lxx05d/__init__.py b/decoders/mx25lxx05d/__init__.py index 26b1a58..3f3c1c6 100644 --- a/decoders/mx25lxx05d/__init__.py +++ b/decoders/mx25lxx05d/__init__.py @@ -19,7 +19,7 @@ ## ''' -Macronix MX25Lxx05D SPI (NOR) flash chip decoder. +Macronix MX25Lxx05D SPI (NOR) flash chip protocol decoder. Works for MX25L1605D/MX25L3205D/MX25L6405D. diff --git a/decoders/nunchuk/__init__.py b/decoders/nunchuk/__init__.py index da6db06..9b85374 100644 --- a/decoders/nunchuk/__init__.py +++ b/decoders/nunchuk/__init__.py @@ -19,7 +19,7 @@ ## ''' -Nintendo Wii Nunchuk decoder. +Nintendo Wii Nunchuk protocol decoder. TODO: Description. diff --git a/decoders/pan1321/__init__.py b/decoders/pan1321/__init__.py index abbcf5d..155d961 100644 --- a/decoders/pan1321/__init__.py +++ b/decoders/pan1321/__init__.py @@ -18,5 +18,12 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +''' +Panasonic PAN1321 protocol decoder. + +Details: +TODO +''' + from .pan1321 import * diff --git a/decoders/rtc8564/__init__.py b/decoders/rtc8564/__init__.py index c7be2c5..5653453 100644 --- a/decoders/rtc8564/__init__.py +++ b/decoders/rtc8564/__init__.py @@ -18,5 +18,12 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +''' +Epson RTC-8564 JE/NB protocol decoder. + +Details: +TODO +''' + from .rtc8564 import * diff --git a/decoders/spi/__init__.py b/decoders/spi/__init__.py index 3276fed..c1b5889 100644 --- a/decoders/spi/__init__.py +++ b/decoders/spi/__init__.py @@ -18,5 +18,12 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +''' +Serial Peripheral Interface protocol decoder. + +Details: +TODO +''' + from .spi import * diff --git a/decoders/transitioncounter/__init__.py b/decoders/transitioncounter/__init__.py index bdf296b..f2c3b80 100644 --- a/decoders/transitioncounter/__init__.py +++ b/decoders/transitioncounter/__init__.py @@ -18,5 +18,12 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +''' +Pin transition counter protocol decoder. + +Details: +TODO +''' + from .transitioncounter import * diff --git a/decoders/uart/__init__.py b/decoders/uart/__init__.py index 43e7706..d41a964 100644 --- a/decoders/uart/__init__.py +++ b/decoders/uart/__init__.py @@ -97,15 +97,13 @@ UART packet: [, , ] This is the list of s and their respective : - - 'STARTBIT': The data is the (integer) value of the start bit (0 or 1). + - 'STARTBIT': The data is the (integer) value of the start bit (0/1). - 'DATA': The data is the (integer) value of the UART data. Valid values range from 0 to 512 (as the data can be up to 9 bits in size). - - 'PARITYBIT': The data is the (integer) value of the parity bit (0 or 1). + - 'PARITYBIT': The data is the (integer) value of the parity bit (0/1). - 'STOPBIT': The data is the (integer) value of the stop bit (0 or 1). - - 'INVALID STARTBIT': The data is the (integer) value of the start bit - (0 or 1). - - 'INVALID STOPBIT': The data is the (integer) value of the stop bit - (0 or 1). + - 'INVALID STARTBIT': The data is the (integer) value of the start bit (0/1). + - 'INVALID STOPBIT': The data is the (integer) value of the stop bit (0/1). - 'PARITY ERROR': The data is a tuple with two entries. The first one is the expected parity value, the second is the actual parity value. - TODO: Frame error? diff --git a/decoders/uart/uart.py b/decoders/uart/uart.py index 2bb61dd..057a890 100644 --- a/decoders/uart/uart.py +++ b/decoders/uart/uart.py @@ -102,10 +102,7 @@ class Decoder(srd.Decoder): self.paritybit = [-1, -1] self.stopbit1 = [-1, -1] self.startsample = [-1, -1] - - # Initial state. self.state = ['WAIT FOR START BIT', 'WAIT FOR START BIT'] - self.oldbit = [None, None] def start(self, metadata):