]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/maxim_ds28ea00/pd.py
license: remove FSF postal address from boiler plate license text
[libsigrokdecode.git] / decoders / maxim_ds28ea00 / pd.py
index 69ace697d18a93d278d446412c25bf167e77cbc1..d860c9da4f216a24a3f2b0b6cf14d64bca96f59c 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/>.
 ##
 
-# Maxim DS28EA00 protocol decoder
-
 import sigrokdecode as srd
 
 # Dictionary of FUNCTION commands and their names.
@@ -38,7 +35,7 @@ command = {
 }
 
 class Decoder(srd.Decoder):
-    api_version = 1
+    api_version = 2
     id = 'maxim_ds28ea00'
     name = 'DS28EA00'
     longname = 'Maxim DS28EA00 1-Wire digital thermometer'
@@ -46,19 +43,11 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['onewire_network']
     outputs = ['maxim_ds28ea00']
-    probes = []
-    optional_probes = [
-        {'id': 'pioa', 'name': 'PIOA/DONE#',
-         'desc': 'PIOA channel and chain output'},
-        {'id': 'piob', 'name': 'PIOB/EN#',
-         'desc': 'PIOB channel and chain output'},
-    ]
-    options = {}
-    annotations = [
-        ['Text', 'Human-readable text'],
-    ]
+    annotations = (
+        ('text', 'Human-readable text'),
+    )
 
-    def __init__(self, **kwargs):
+    def __init__(self):
         self.trn_beg = 0
         self.trn_end = 0
         self.state = 'ROM'
@@ -67,9 +56,6 @@ class Decoder(srd.Decoder):
     def start(self):
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
-    def report(self):
-        pass
-
     def putx(self, data):
         self.put(self.ss, self.es, self.out_ann, data)
 
@@ -101,6 +87,3 @@ class Decoder(srd.Decoder):
                 self.putx([0, ['Temperature conversion status: 0x%02x' % val]])
             elif self.state in [s.upper() for s in command.values()]:
                 self.putx([0, ['TODO \'%s\': 0x%02x' % (self.state, val)]])
-            else:
-                raise Exception('Invalid state: %s' % self.state)
-