diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2015-02-24 21:46:04 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2015-02-24 21:46:04 +0100 |
commit | 5dc48752efc84171dece2dcef93577e5483b9775 (patch) | |
tree | 9ea27aa02ea7db9a16b3b4942a85279d75a4ddc2 | |
parent | b03e2209d5e83e3c1b9737097b13109c7e4658c3 (diff) | |
download | libsigrokdecode-5dc48752efc84171dece2dcef93577e5483b9775.tar.gz libsigrokdecode-5dc48752efc84171dece2dcef93577e5483b9775.zip |
nrf24l01: Change 'xn297_extensions' option to 'chip'.
This allows for easily extending the PD to support other clones or
compatibles of the nRF24L01(+) chip as well.
-rw-r--r-- | decoders/nrf24l01/pd.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/decoders/nrf24l01/pd.py b/decoders/nrf24l01/pd.py index f729961..2337d4b 100644 --- a/decoders/nrf24l01/pd.py +++ b/decoders/nrf24l01/pd.py @@ -52,6 +52,7 @@ regs = { 0x1c: ('DYNPD', 1), 0x1d: ('FEATURE', 1), } + xn297_regs = { 0x19: ('DEMOD_CAL', 5), 0x1e: ('RF_CAL', 7), @@ -68,8 +69,8 @@ class Decoder(srd.Decoder): inputs = ['spi'] outputs = ['nrf24l01'] options = ( - {'id': 'xn297_extensions', 'desc': 'XN297 extensions', - 'default': 'disable', 'values': ('enable', 'disable')}, + {'id': 'chip', 'desc': 'Chip type', + 'default': 'nrf24l01', 'values': ('nrf24l01', 'xn297')}, ) annotations = ( # Sent from the host to the chip. @@ -100,7 +101,7 @@ class Decoder(srd.Decoder): def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) - if self.options['xn297_extensions'] == 'enable': + if self.options['chip'] == 'xn297': regs.update(xn297_regs) def warn(self, pos, msg): |