-
Notifications
You must be signed in to change notification settings - Fork 1
/
decode_por_default.py
204 lines (168 loc) · 5.52 KB
/
decode_por_default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
import sys
lookupTable = [
"output port 0",
"output port 1",
"output port 2",
"output port 3",
"output port 4",
"output port 5",
"output port 6",
"output port 7", "\n",
"interrupt mask port 0",
"interrupt mask port 1",
"interrupt mask port 2",
"interrupt mask port 3",
"interrupt mask port 4",
"interrupt mask port 5",
"interrupt mask port 6",
"interrupt mask port 7","\n",
"select PWM port 0",
"select PWM port 1",
"select PWM port 2",
"select PWM port 3",
"select PWM port 4",
"select PWM port 5",
"select PWM port 6",
"select PWM port 7","\n",
"inversion port 0",
"inversion port 1",
"inversion port 2",
"inversion port 3",
"inversion port 4",
"inversion port 5",
"inversion port 6",
"inversion port 7","\n",
"pin direction port 0",
"pin direction port 1",
"pin direction port 2",
"pin direction port 3",
"pin direction port 4",
"pin direction port 5",
"pin direction port 6",
"pin direction port 7","\n",
"drive mode - port 0 - Resistive pull-up",
"drive mode - port 0 - Resistive pull-down",
"drive mode - port 0 - Open drain high",
"drive mode - port 0 - Open drain low",
"drive mode - port 0 - Strong drive",
"drive mode - port 0 - Slow strong drive",
"drive mode - port 0 - High impedance","\n",
"drive mode - port 1 - Resistive pull-up",
"drive mode - port 1 - Resistive pull-down",
"drive mode - port 1 - Open drain high",
"drive mode - port 1 - Open drain low",
"drive mode - port 1 - Strong drive",
"drive mode - port 1 - Slow strong drive",
"drive mode - port 1 - High impedance","\n",
"drive mode - port 2 - Resistive pull-up",
"drive mode - port 2 - Resistive pull-down",
"drive mode - port 2 - Open drain high",
"drive mode - port 2 - Open drain low",
"drive mode - port 2 - Strong drive",
"drive mode - port 2 - Slow strong drive",
"drive mode - port 2 - High impedance","\n",
"drive mode - port 3 - Resistive pull-up",
"drive mode - port 3 - Resistive pull-down",
"drive mode - port 3 - Open drain high",
"drive mode - port 3 - Open drain low",
"drive mode - port 3 - Strong drive",
"drive mode - port 3 - Slow strong drive",
"drive mode - port 3 - High impedance","\n",
"drive mode - port 4 - Resistive pull-up",
"drive mode - port 4 - Resistive pull-down",
"drive mode - port 4 - Open drain high",
"drive mode - port 4 - Open drain low",
"drive mode - port 4 - Strong drive",
"drive mode - port 4 - Slow strong drive",
"drive mode - port 4 - High impedance","\n",
"drive mode - port 5 - Resistive pull-up",
"drive mode - port 5 - Resistive pull-down",
"drive mode - port 5 - Open drain high",
"drive mode - port 5 - Open drain low",
"drive mode - port 5 - Strong drive",
"drive mode - port 5 - Slow strong drive",
"drive mode - port 5 - High impedance","\n",
"drive mode - port 6 - Resistive pull-up",
"drive mode - port 6 - Resistive pull-down",
"drive mode - port 6 - Open drain high",
"drive mode - port 6 - Open drain low",
"drive mode - port 6 - Strong drive",
"drive mode - port 6 - Slow strong drive",
"drive mode - port 6 - High impedance","\n",
"drive mode - port 7 - Resistive pull-up",
"drive mode - port 7 - Resistive pull-down",
"drive mode - port 7 - Open drain high",
"drive mode - port 7 - Open drain low",
"drive mode - port 7 - Strong drive",
"drive mode - port 7 - Slow strong drive",
"drive mode - port 7 - High impedance","\n",
"config setting PWM 0",
"period setting PWM 0",
"pulse width setting PWM 0","\n",
"config setting PWM 1",
"period setting PWM 1",
"pulse width setting PWM 1","\n",
"config setting PWM 2",
"period setting PWM 2",
"pulse width setting PWM 2","\n",
"config setting PWM 3",
"period setting PWM 3",
"pulse width setting PWM 3","\n",
"config setting PWM 4",
"period setting PWM 4",
"pulse width setting PWM 4","\n",
"config setting PWM 5",
"period setting PWM 5",
"pulse width setting PWM 5","\n",
"config setting PWM 6",
"period setting PWM 6",
"pulse width setting PWM 6","\n",
"config setting PWM 7",
"period setting PWM 7",
"pulse width setting PWM 7","\n",
"config setting PWM 8",
"period setting PWM 8",
"pulse width setting PWM 8","\n",
"config setting PWM 9",
"period setting PWM 9",
"pulse width setting PWM 9","\n",
"config setting PWM 10",
"period setting PWM 10",
"pulse width setting PWM 10","\n",
"config setting PWM 11",
"period setting PWM 11",
"pulse width setting PWM 11","\n",
"config setting PWM 12",
"period setting PWM 12",
"pulse width setting PWM 12","\n",
"config setting PWM 13",
"period setting PWM 13",
"pulse width setting PWM 13","\n",
"config setting PWM 14",
"period setting PWM 14",
"pulse width setting PWM 14","\n",
"config setting PWM 15",
"period setting PWM 15",
"pulse width setting PWM 15","\n",
"divider",
"enable",
"crc"
]
data = []
data = sys.stdin.readline()
data = data.split(" ")
try:
data.remove("\n")
data.remove("\r")
except ValueError:
pass
idx = 0
for el in lookupTable:
if(el != "\n"):
try:
print(el + " => " + data[idx])
idx = idx + 1
except IndexError:
print(el + " => MISSING!!!")
else:
print(el)