]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: SPI: Set default PD options.
authorUwe Hermann <redacted>
Sat, 14 Jan 2012 17:02:33 +0000 (18:02 +0100)
committerUwe Hermann <redacted>
Sat, 14 Jan 2012 17:02:33 +0000 (18:02 +0100)
decoders/spi.py

index 7e64fcf8ffd87b43d3f41617fb974a6b1c9969a8..457abb5bde2f962cdd2c325023944eb6e9017aa9 100644 (file)
@@ -78,6 +78,13 @@ class Decoder(srd.Decoder):
         self.bytesreceived = 0
         self.samplenum = -1
 
+        # Set protocol decoder option defaults.
+        self.cs_active_low = Decoder.options['cs_active_low'][1]
+        self.clock_polarity = Decoder.options['clock_polarity'][1]
+        self.clock_phase = Decoder.options['clock_phase'][1]
+        self.bit_order = Decoder.options['bit_order'][1]
+        self.word_size = Decoder.options['word_size'][1]
+
     def start(self, metadata):
         self.out_proto = self.add(srd.OUTPUT_PROTO, 'spi')
         self.out_ann = self.add(srd.OUTPUT_ANN, 'spi')