X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Frtc8564%2Fpd.py;h=d71e62b8b9b268333df9013923885e822aa4369f;hb=8f1dd70dd15916813186135bae71aa0683851da9;hp=258ec2781fb81a6796a71bb372cf63f5ff214bea;hpb=769ed325837271b76beca1e74a037cf8bb91f4b3;p=libsigrokdecode.git diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index 258ec27..d71e62b 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/pd.py @@ -14,12 +14,11 @@ ## 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 -from srdhelper import bcd2int +from common.srdhelper import bcd2int def reg_list(): l = [] @@ -29,14 +28,15 @@ def reg_list(): return tuple(l) class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'rtc8564' name = 'RTC-8564' longname = 'Epson RTC-8564 JE/NB' desc = 'Realtime clock module protocol.' license = 'gplv2+' inputs = ['i2c'] - outputs = ['rtc8564'] + outputs = [] + tags = ['Clock/timing'] annotations = reg_list() + ( ('read', 'Read date/time'), ('write', 'Write date/time'), @@ -48,11 +48,14 @@ class Decoder(srd.Decoder): ) annotation_rows = ( ('bits', 'Bits', tuple(range(0, 8 + 1)) + (11, 12, 13)), - ('regs', 'Register access', (14, 15)), + ('regs', 'Register accesses', (14, 15)), ('date-time', 'Date/time', (9, 10)), ) - def __init__(self, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.state = 'IDLE' self.hours = -1 self.minutes = -1