## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-# Dallas DS1307 RTC protocol decoder
-
import sigrokdecode as srd
days_of_week = [
optional_probes = []
options = {}
annotations = [
- ['Text', 'Human-readable text'],
+ ['text', 'Human-readable text'],
]
def __init__(self, **kwargs):
self.years = -1
def start(self):
- self.out_ann = self.add(srd.OUTPUT_ANN, 'ds1307')
-
- def report(self):
- pass
+ self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.put(self.ss, self.es, self.out_ann, data)
def decode(self, ss, es, data):
cmd, databyte = data
- # Store the start/end samples of this I2C packet.
+ # Store the start/end samples of this I²C packet.
self.ss, self.es = ss, es
# State machine.
if self.state == 'IDLE':
- # Wait for an I2C START condition.
+ # Wait for an I²C START condition.
if cmd != 'START':
return
self.state = 'GET SLAVE ADDR'