diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2020-01-10 21:15:38 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2020-01-10 21:48:18 +0100 |
commit | a32575cd7fc63447f4ba8bdb27e8e73ba5ae3cc0 (patch) | |
tree | 36a725ea8c09dcaadb44ab496b5f496231fa0646 /decoders | |
parent | 0671a9de83a5bc7e09b282f24af7f95f302ede91 (diff) | |
download | libsigrokdecode-a32575cd7fc63447f4ba8bdb27e8e73ba5ae3cc0.tar.gz libsigrokdecode-a32575cd7fc63447f4ba8bdb27e8e73ba5ae3cc0.zip |
sdcard_sd: Use SrdIntEnum for pins.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/sdcard_sd/pd.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/decoders/sdcard_sd/pd.py b/decoders/sdcard_sd/pd.py index 98f4725..d0e72d2 100644 --- a/decoders/sdcard_sd/pd.py +++ b/decoders/sdcard_sd/pd.py @@ -23,6 +23,8 @@ from common.sdcard import (cmd_names, acmd_names, accepted_voltages, card_status responses = '1 1b 2 3 6 7'.split() +Pin = SrdIntEnum.from_str('Pin', 'CMD CLK DAT0 DAT1 DAT2 DAT3') + a = ['CMD%d' % i for i in range(64)] + ['ACMD%d' % i for i in range(64)] + \ ['R' + r.upper() for r in responses] + \ ['F_' + f for f in 'START TRANSM CMD ARG CRC END'.split()] + \ @@ -422,7 +424,7 @@ class Decoder(srd.Decoder): def decode(self): while True: # Wait for a rising CLK edge. - (cmd, clk, dat0, dat1, dat2, dat3) = self.wait({1: 'r'}) + (cmd, clk, dat0, dat1, dat2, dat3) = self.wait({Pin.CLK: 'r'}) # State machine. if self.state == St.GET_COMMAND_TOKEN: |