]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: PDs: More cosmetics.
authorUwe Hermann <redacted>
Sun, 4 Mar 2012 09:40:58 +0000 (10:40 +0100)
committerUwe Hermann <redacted>
Sun, 4 Mar 2012 14:10:11 +0000 (15:10 +0100)
decoders/edid/__init__.py
decoders/i2c/i2c.py
decoders/mlx90614/__init__.py
decoders/mx25lxx05d/__init__.py
decoders/nunchuk/__init__.py
decoders/pan1321/__init__.py
decoders/rtc8564/__init__.py
decoders/spi/__init__.py
decoders/transitioncounter/__init__.py
decoders/uart/__init__.py
decoders/uart/uart.py

index d892e60ec1e038177756ffccc58ce9084ba1340b..9932a81a0ef7c8f41ca346aa21a2953cd5efe130 100644 (file)
@@ -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:
 
 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
 
 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:
 
 
 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 *
 '''
 
 from .edid import *
index 2c11be096529549f0be4714a3c7a8f2c1dc1e2ab..cc70e968eee72c134c43d7b5f1d4ac11cc3c8937 100644 (file)
@@ -38,7 +38,7 @@ ANN_SHIFTED_SHORT = 1
 ANN_RAW = 2
 
 # Values are verbose and short annotation, respectively.
 ANN_RAW = 2
 
 # Values are verbose and short annotation, respectively.
-protocol = {
+proto = {
     'START':           ['START',         'S'],
     'START REPEAT':    ['START REPEAT',  'Sr'],
     'STOP':            ['STOP',          'P'],
     '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])
 
         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
 
         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])
             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
 
         # 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.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'
         # 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])
     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
 
         self.state = 'FIND START'
         self.is_repeat_start = 0
index fd6225110ea65dc3f45968f615facf3f93a79ecb..0ceabc20d986606587413b494333a512a5b758b6 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+Melexis MLX90614 protocol decoder.
+
+Details:
+TODO
+'''
+
 from .mlx90614 import *
 
 from .mlx90614 import *
 
index 26b1a58a7df945c990f6fbe953b45a7b4883b921..3f3c1c662d13d707cbfc6ff138619869446ce0f9 100644 (file)
@@ -19,7 +19,7 @@
 ##
 
 '''
 ##
 
 '''
-Macronix MX25Lxx05D SPI (NOR) flash chip decoder.
+Macronix MX25Lxx05D SPI (NOR) flash chip protocol decoder.
 
 Works for MX25L1605D/MX25L3205D/MX25L6405D.
 
 
 Works for MX25L1605D/MX25L3205D/MX25L6405D.
 
index da6db065b4fc3343d630170714f61d608a510c2d..9b85374729718dd84e0b78ca19d21616c0697224 100644 (file)
@@ -19,7 +19,7 @@
 ##
 
 '''
 ##
 
 '''
-Nintendo Wii Nunchuk decoder.
+Nintendo Wii Nunchuk protocol decoder.
 
 TODO: Description.
 
 
 TODO: Description.
 
index abbcf5d31c5c8779a7d4e4a2efc04e7189fb6624..155d96141a51d216cfefa026a0e0db51b0bf8967 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+Panasonic PAN1321 protocol decoder.
+
+Details:
+TODO
+'''
+
 from .pan1321 import *
 
 from .pan1321 import *
 
index c7be2c5a8055d906024d4f01cf0dd8df149bf35f..56534532b2920dc36463da65627df2438133999e 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+Epson RTC-8564 JE/NB protocol decoder.
+
+Details:
+TODO
+'''
+
 from .rtc8564 import *
 
 from .rtc8564 import *
 
index 3276fed93f6f95499f2a769ab3896085b6824e7b..c1b5889fdc28c8c0affc7e4035b2668f8b550114 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+Serial Peripheral Interface protocol decoder.
+
+Details:
+TODO
+'''
+
 from .spi import *
 
 from .spi import *
 
index bdf296bd35feda11a735fefaf706a62bacb9cc15..f2c3b800cd014d918bb380c7c8f394f261eb2e32 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+Pin transition counter protocol decoder.
+
+Details:
+TODO
+'''
+
 from .transitioncounter import *
 
 from .transitioncounter import *
 
index 43e7706c8897d3223497c5105d6bc44c413c6fbe..d41a964c3f6ecf30fcba479c35f1f068fdd52d83 100644 (file)
@@ -97,15 +97,13 @@ UART packet:
 [<packet-type>, <rxtx>, <packet-data>]
 
 This is the list of <packet-types>s and their respective <packet-data>:
 [<packet-type>, <rxtx>, <packet-data>]
 
 This is the list of <packet-types>s and their respective <packet-data>:
- - '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).
  - '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).
  - '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?
  - '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?
index 2bb61dd86ca546ad119360fedc589626f4f4ff85..057a8900811f94503895c36247d5e66a9639455e 100644 (file)
@@ -102,10 +102,7 @@ class Decoder(srd.Decoder):
         self.paritybit = [-1, -1]
         self.stopbit1 = [-1, -1]
         self.startsample = [-1, -1]
         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.state = ['WAIT FOR START BIT', 'WAIT FOR START BIT']
-
         self.oldbit = [None, None]
 
     def start(self, metadata):
         self.oldbit = [None, None]
 
     def start(self, metadata):