X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fnrf24l01%2Fpd.py;h=06755ff3495b75f7beb27ba6aa320a7b4abf9d39;hb=826981ac5a2105c7231aeb5e5e523cd37ce72edd;hp=2337d4b6d01faed86c778e4b49ff89cbdebb9b4b;hpb=5dc48752efc84171dece2dcef93577e5483b9775;p=libsigrokdecode.git diff --git a/decoders/nrf24l01/pd.py b/decoders/nrf24l01/pd.py index 2337d4b..06755ff 100644 --- a/decoders/nrf24l01/pd.py +++ b/decoders/nrf24l01/pd.py @@ -14,8 +14,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## import sigrokdecode as srd @@ -60,28 +59,29 @@ xn297_regs = { } class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'nrf24l01' name = 'nRF24L01(+)' - longname = 'Nordic Semiconductor nRF24L01/nRF24L01+' - desc = '2.4GHz transceiver chip.' + longname = 'Nordic Semiconductor nRF24L01(+)' + desc = '2.4GHz RF transceiver chip.' license = 'gplv2+' inputs = ['spi'] - outputs = ['nrf24l01'] + outputs = [] + tags = ['IC', 'Wireless/RF'] options = ( {'id': 'chip', 'desc': 'Chip type', 'default': 'nrf24l01', 'values': ('nrf24l01', 'xn297')}, ) annotations = ( # Sent from the host to the chip. - ('cmd', 'Commands sent to the device'), - ('tx-data', 'Payload sent to the device'), + ('cmd', 'Command'), + ('tx-data', 'Payload'), # Returned by the chip. - ('register', 'Registers read from the device'), - ('rx-data', 'Payload read from the device'), + ('register', 'Register read'), + ('rx-data', 'Payload read'), - ('warning', 'Warnings'), + ('warning', 'Warning'), ) ann_cmd = 0 ann_tx = 1 @@ -94,7 +94,10 @@ class Decoder(srd.Decoder): ('warnings', 'Warnings', (ann_warn,)), ) - def __init__(self, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.next() self.requirements_met = True self.cs_was_released = False