]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/rfm12/pd.py
avr_isp: Add more parts
[libsigrokdecode.git] / decoders / rfm12 / pd.py
index 9bcbd9d8c21439c75cdf295892fb4f38ec7857dc..3f25b32eaae73f176f7745c21c8faba5bcba6a69 100644 (file)
 ## 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 <http://www.gnu.org/licenses/>.
 ##
 
 import sigrokdecode as srd
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'rfm12'
     name = 'RFM12'
-    longname = 'RFM12 control protocol'
+    longname = 'HopeRF RFM12'
     desc = 'HopeRF RFM12 wireless transceiver control protocol.'
     license = 'gplv2+'
     inputs = ['spi']
-    outputs = ['rfm12']
+    outputs = []
+    tags = ['Wireless/RF']
     annotations = (
         ('cmd', 'Command'),
-        ('params', 'Command parameters'),
-        ('disabled', 'Disabled bits'),
-        ('return', 'Returned values'),
-        ('disabled_return', 'Disabled returned values'),
+        ('param', 'Command parameter'),
+        ('disabled', 'Disabled bit'),
+        ('return', 'Returned value'),
+        ('disabled_return', 'Disabled returned value'),
         ('interpretation', 'Interpretation'),
     )
     annotation_rows = (
         ('commands', 'Commands', (0, 1, 2)),
-        ('return', 'Return', (3, 4)),
-        ('interpretation', 'Interpretation', (5,)),
+        ('returns', 'Returns', (3, 4)),
+        ('interpretations', 'Interpretations', (5,)),
     )
 
-    def __init__(self, **kwargs):
+    def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.mosi_bytes, self.miso_bytes = [], []
         self.mosi_bits, self.miso_bits = [], []
         self.row_pos = [0, 0, 0]