X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fadns5020%2Fpd.py;h=cd72eca8b46d93432379469b33d10031296b9d5f;hb=88567e4abe73a49acf9527aedeed42ee738c7976;hp=29b639752fa2eb8a59b7fc3bc8694ca61e8d065f;hpb=9eac0fe36580a21ad8eeef5b31118af97749beb8;p=libsigrokdecode.git diff --git a/decoders/adns5020/pd.py b/decoders/adns5020/pd.py index 29b6397..cd72eca 100644 --- a/decoders/adns5020/pd.py +++ b/decoders/adns5020/pd.py @@ -14,33 +14,32 @@ ## 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 regs = { - 0: 'Product_ID', - 1: 'Revision_ID', - 2: 'Motion', - 3: 'Delta_X', - 4: 'Delta_Y', - 5: 'SQUAL', - 6: 'Shutter_Upper', - 7: 'Shutter_Lower', - 8: 'Maximum_Pixel', - 9: 'Pixel_Sum', - 0xa: 'Minimum_Pixel', - 0xb: 'Pixel_Grab', - 0xd: 'Mouse_Control', - 0x3a: 'Chip_Reset', - 0x3f: 'Inv_Rev_ID', - 0x63: 'Motion_Burst', + 0: 'Product_ID', + 1: 'Revision_ID', + 2: 'Motion', + 3: 'Delta_X', + 4: 'Delta_Y', + 5: 'SQUAL', + 6: 'Shutter_Upper', + 7: 'Shutter_Lower', + 8: 'Maximum_Pixel', + 9: 'Pixel_Sum', + 0xa: 'Minimum_Pixel', + 0xb: 'Pixel_Grab', + 0xd: 'Mouse_Control', + 0x3a: 'Chip_Reset', + 0x3f: 'Inv_Rev_ID', + 0x63: 'Motion_Burst', } class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'adns5020' name = 'ADNS-5020' longname = 'Avago ADNS-5020 optical mouse sensor' @@ -59,7 +58,10 @@ class Decoder(srd.Decoder): ('warnings', 'Warnings', (2,)), ) - def __init__(self, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.ss_cmd, self.es_cmd = 0, 0 self.mosi_bytes = []