]>
Commit | Line | Data |
---|---|---|
f47d3a2d TP |
1 | ## |
2 | ## This file is part of the libsigrokdecode project. | |
3 | ## | |
4 | ## Copyright (C) 2020 Analog Devices Inc. | |
5 | ## | |
6 | ## This program is free software; you can redistribute it and/or modify | |
7 | ## it under the terms of the GNU General Public License as published by | |
8 | ## the Free Software Foundation; either version 2 of the License, or | |
9 | ## (at your option) any later version. | |
10 | ## | |
11 | ## This program is distributed in the hope that it will be useful, | |
12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ## GNU General Public License for more details. | |
15 | ## | |
16 | ## You should have received a copy of the GNU General Public License | |
17 | ## along with this program; if not, write to the Free Software | |
18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | ## | |
20 | ||
21 | error_messages = { | |
22 | 'interrupt': ['Interrupt'], | |
23 | 'undesirable': ['Undesirable behavior'], | |
24 | 'dis_single': ['Disable single tap'], | |
25 | 'dis_double': ['Disable double tap'], | |
26 | 'dis_single_double': ['Disable single/double tap'], | |
27 | } | |
28 | ||
29 | rate_code = { | |
30 | 0x00: 0.1, | |
31 | 0x01: 0.2, | |
32 | 0x02: 0.39, | |
33 | 0x03: 0.78, | |
34 | 0x04: 1.56, | |
35 | 0x05: 3.13, | |
36 | 0x06: 6.25, | |
37 | 0x07: 12.5, | |
38 | 0x08: 25, | |
39 | 0x09: 50, | |
40 | 0x0A: 100, | |
41 | 0x0B: 200, | |
42 | 0x0C: 400, | |
43 | 0x0D: 800, | |
44 | 0x0E: 1600, | |
45 | 0x0F: 3200, | |
46 | } | |
47 | ||
48 | fifo_modes = { | |
49 | 0x00: 'Bypass', | |
50 | 0x01: 'FIFO', | |
51 | 0x02: 'Stream', | |
52 | 0x03: 'Trigger', | |
53 | } | |
54 | ||
55 | operations = { | |
56 | 0x00: ['WRITE REG', 'WRITE', 'W'], | |
57 | 0x01: ['READ REG', 'READ', 'R'], | |
58 | } | |
59 | ||
60 | number_bytes = { | |
61 | 0x00: ['SINGLE BYTE', 'SING BYTE', '1 BYTE', '1B'], | |
62 | 0x01: ['MULTIPLE BYTES', 'MULTI BYTES', 'n*BYTES', 'n*B'], | |
63 | } | |
64 | ||
65 | registers = { | |
66 | 0x00: ['DEVID', 'DID', 'ID'], | |
67 | 0x1D: ['THRESH_TAP', 'TH_TAP', 'TH_T'], | |
68 | 0x1E: ['OFSX', 'OFX'], | |
69 | 0x1F: ['OFSY', 'OFY'], | |
70 | 0x20: ['OFSZ', 'OFZ'], | |
71 | 0x21: ['DUR'], | |
72 | 0x22: ['Latent', 'Lat'], | |
73 | 0x23: ['Window', 'Win'], | |
74 | 0x24: ['THRESH_ACT', 'TH_ACT', 'TH_A'], | |
75 | 0x25: ['THRESH_INACT', 'TH_INACT', 'TH_I'], | |
76 | 0x26: ['TIME_INACT', 'TI_INACT', 'TI_I'], | |
77 | 0x27: ['ACT_INACT_CTL', 'ACT_I_CTL', 'A_I_C'], | |
78 | 0x28: ['THRESH_FF', 'TH_FF'], | |
79 | 0x29: ['TIME_FF', 'TI_FF'], | |
80 | 0x2A: ['TAP_AXES', 'TAP_AX', 'TP_AX'], | |
81 | 0x2B: ['ACT_TAP_STATUS', 'ACT_TAP_STAT', 'ACT_TP_ST', 'A_T_S'], | |
82 | 0x2C: ['BW_RATE', 'BW_R'], | |
83 | 0x2D: ['POWER_CTL', 'PW_CTL', 'PW_C'], | |
84 | 0x2E: ['INT_ENABLE', 'INT_EN', 'I_EN'], | |
85 | 0x2F: ['INT_MAP', 'I_M'], | |
86 | 0x30: ['INT_SOURCE', 'INT_SRC', 'I_SRC', 'I_S'], | |
87 | 0x31: ['DATA_FORMAT', 'DATA_FRM', 'D_FRM', 'D_F'], | |
88 | 0x32: ['DATAX0', 'DX0', 'X0'], | |
89 | 0x33: ['DATAX1', 'DX1', 'X1'], | |
90 | 0x34: ['DATAY0', 'DY0', 'Y0'], | |
91 | 0x35: ['DATAY1', 'DY1', 'Y1'], | |
92 | 0x36: ['DATAZ0', 'DZ0', 'Z0'], | |
93 | 0x37: ['DATAZ1', 'DZ1', 'Z1'], | |
94 | 0x38: ['FIFO_CTL', 'FIF_CT', 'F_C'], | |
95 | 0x39: ['FIFO_STATUS', 'FIFO_STAT', 'FIF_ST', 'F_S'], | |
96 | } |