## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-# Dallas DS1307 RTC protocol decoder
-
import sigrokdecode as srd
days_of_week = [
return (b & 0x0f) + ((b >> 4) * 10)
class Decoder(srd.Decoder):
- api_version = 1
+ api_version = 2
id = 'ds1307'
name = 'DS1307'
longname = 'Dallas DS1307'
license = 'gplv2+'
inputs = ['i2c']
outputs = ['ds1307']
- probes = []
- optional_probes = []
- options = {}
- annotations = [
- ['Text', 'Human-readable text'],
- ]
+ annotations = (
+ ('text', 'Human-readable text'),
+ )
def __init__(self, **kwargs):
self.state = 'IDLE'
self.state = 'IDLE'
else:
pass # TODO?
- else:
- raise Exception('Invalid state: %s' % self.state)