diff options
author | Mike <mike@flomp.net> | 2015-02-06 16:42:32 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2015-02-24 21:38:37 +0100 |
commit | b03e2209d5e83e3c1b9737097b13109c7e4658c3 (patch) | |
tree | b0294aaaacb08a2a4e2d9284033706ad66ed5df1 /decoders | |
parent | b5712ccbbcd023e5ac20d790bf75af3c18fc66d5 (diff) | |
download | libsigrokdecode-b03e2209d5e83e3c1b9737097b13109c7e4658c3.tar.gz libsigrokdecode-b03e2209d5e83e3c1b9737097b13109c7e4658c3.zip |
nrf24l01: Add option to support the XN297's extra registers
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/nrf24l01/pd.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/decoders/nrf24l01/pd.py b/decoders/nrf24l01/pd.py index b026f59..f729961 100644 --- a/decoders/nrf24l01/pd.py +++ b/decoders/nrf24l01/pd.py @@ -52,6 +52,11 @@ regs = { 0x1c: ('DYNPD', 1), 0x1d: ('FEATURE', 1), } +xn297_regs = { + 0x19: ('DEMOD_CAL', 5), + 0x1e: ('RF_CAL', 7), + 0x1f: ('BB_CAL', 5), +} class Decoder(srd.Decoder): api_version = 2 @@ -62,6 +67,10 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['spi'] outputs = ['nrf24l01'] + options = ( + {'id': 'xn297_extensions', 'desc': 'XN297 extensions', + 'default': 'disable', 'values': ('enable', 'disable')}, + ) annotations = ( # Sent from the host to the chip. ('cmd', 'Commands sent to the device'), @@ -91,6 +100,8 @@ class Decoder(srd.Decoder): def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) + if self.options['xn297_extensions'] == 'enable': + regs.update(xn297_regs) def warn(self, pos, msg): '''Put a warning message 'msg' at 'pos'.''' |