summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
Diffstat (limited to 'decoders')
-rw-r--r--decoders/spi/pd.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py
index cd40946..3bebc7d 100644
--- a/decoders/spi/pd.py
+++ b/decoders/spi/pd.py
@@ -266,6 +266,10 @@ class Decoder(srd.Decoder):
self.have_mosi = (mosi in (0, 1))
self.have_cs = (cs in (0, 1))
+ # Either MISO or MOSI (but not both) can be omitted.
+ if not (self.have_miso or self.have_mosi):
+ raise Exception('Either MISO or MOSI (or both) pins required.')
+
# State machine.
if self.state == 'IDLE':
self.find_clk_edge(miso, mosi, clk, cs)