summaryrefslogtreecommitdiff
path: root/decoders/sdcard_spi
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-02-05 00:44:52 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2014-02-09 19:38:21 +0100
commitc82620fc0b10c9541b8a92bd3ea3dd4bdf982390 (patch)
tree98181ee602b481f3b81e42773cc6fc85924bcd90 /decoders/sdcard_spi
parentd78e0beb6594de5dfd2a17d72f532a42f85ca55c (diff)
downloadlibsigrokdecode-c82620fc0b10c9541b8a92bd3ea3dd4bdf982390.tar.gz
libsigrokdecode-c82620fc0b10c9541b8a92bd3ea3dd4bdf982390.zip
sdcard_spi: Adapt for MSB-first bits from spi PD.
Diffstat (limited to 'decoders/sdcard_spi')
-rw-r--r--decoders/sdcard_spi/pd.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py
index 8bf5f84..f92be0d 100644
--- a/decoders/sdcard_spi/pd.py
+++ b/decoders/sdcard_spi/pd.py
@@ -159,7 +159,7 @@ class Decoder(srd.Decoder):
s = 'ACMD' if self.is_acmd else 'CMD'
def tb(byte, bit):
- return self.cmd_token_bits[5 - byte][7 - bit]
+ return self.cmd_token_bits[5 - byte][bit]
# Bits[47:47]: Start bit (always 0)
bit, self.bit_ss, self.bit_es = tb(5, 7)[0], tb(5, 7)[1], tb(5, 7)[2]
@@ -221,8 +221,8 @@ class Decoder(srd.Decoder):
# CMD1: SEND_OP_COND
self.putc(1, 'Send HCS info and activate the card init process')
hcs = (self.arg & (1 << 30)) >> 30
- self.bit_ss = self.cmd_token_bits[5 - 4][7 - 6][1]
- self.bit_es = self.cmd_token_bits[5 - 4][7 - 6][2]
+ self.bit_ss = self.cmd_token_bits[5 - 4][6][1]
+ self.bit_es = self.cmd_token_bits[5 - 4][6][2]
self.putb([70, ['HCS: %d' % hcs]])
self.state = 'GET RESPONSE R1'
@@ -341,11 +341,11 @@ class Decoder(srd.Decoder):
# The R1 response token format (1 byte).
# Sent by the card after every command except for SEND_STATUS.
- self.cmd_ss, self.cmd_es = self.miso_bits[0][1], self.miso_bits[7][2]
+ self.cmd_ss, self.cmd_es = self.miso_bits[7][1], self.miso_bits[0][2]
self.putx([65, ['R1: 0x%02x' % res]])
def putbit(bit, data):
- b = self.miso_bits[7 - bit]
+ b = self.miso_bits[bit]
self.bit_ss, self.bit_es = b[1], b[2]
self.putb([70, data])