]> sigrok.org Git - libsigrokdecode.git/blob - decoders/ir_sirc/lists.py
ir_sirc: use symbolic identifiers for annotation classes
[libsigrokdecode.git] / decoders / ir_sirc / lists.py
1 ##
2 ## This file is part of the libsigrokdecode project.
3 ##
4 ## Copyright (C) 2020 Tom Flanagan <knio@zkpq.ca>
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, see <http://www.gnu.org/licenses/>.
18 ##
19
20 NUMBERS = {
21     0x00: '1',
22     0x01: '2',
23     0x02: '3',
24     0x03: '4',
25     0x04: '5',
26     0x05: '6',
27     0x06: '7',
28     0x07: '8',
29     0x08: '9',
30     0x09: '0/10',
31 }
32
33 ADDRESSES = {
34     # TV
35     (0x01, None): (['TV: ', 'TV:'], {
36         0x15: 'Power',
37         0x25: 'Input',
38
39         0x33: 'Right',
40         0x34: 'Left',
41         0x3A: 'Display',
42
43         0x60: 'Home',
44         0x65: 'Enter',
45
46         0x74: 'Up',
47         0x75: 'Down',
48
49     }),
50
51     # Video
52     (0x0B, None): (['Video: ', 'V:'], {
53         0x18: 'Stop',
54         0x19: 'Pause',
55         0x1A: 'Play',
56         0x1B: 'Rewind',
57         0x1C: 'Fast Forward',
58
59         0x42: 'Up',
60         0x43: 'Down',
61         0x4D: 'Home',
62
63         0x51: 'Enter',
64         0x5A: 'Display',
65
66         0x61: 'Right',
67         0x62: 'Left',
68     }),
69
70     # BR Input select
71     (0x10, 0x28): (['BlueRay: ', 'BR:'], {
72         0x16: 'BlueRay',
73     }),
74
75     # Amp, Game, Sat, Tuner, USB
76     (0x10, 0x08): (['Playback: ', 'PB:'], {
77         0x2A: 'Shuffle',
78         0x2C: 'Repeat',
79         0x2E: 'Folder Down',
80         0x2F: 'Folder Up',
81
82         0x30: 'Previous',
83         0x31: 'Next',
84         0x32: 'Play',
85         0x33: 'Rewind',
86         0x34: 'Fast Forward',
87         0x38: 'Stop',
88         0x39: 'Pause',
89
90         0x73: 'Options',
91         0x7D: 'Return',
92     }),
93
94     # CD
95     (0x11, None): (['CD: ', 'CD:'], {
96         0x28: 'Display',
97
98         0x30: 'Previous',
99         0x31: 'Next',
100         0x32: 'Play',
101         0x33: 'Rewind',
102         0x34: 'Fast Forward',
103         0x38: 'Stop',
104         0x39: 'Pause',
105     }),
106
107     # BD
108     (0x1A, 0xE2): (['BlueRay: ', 'BD:'], {
109         0x18: 'Stop',
110         0x19: 'Pause',
111         0x1A: 'Play',
112         0x1B: 'Rewind',
113         0x1C: 'Fast Forward',
114
115         0x29: 'Menu',
116         0x2C: 'Top Menu',
117
118         0x39: 'Up',
119         0x3A: 'Down',
120         0x3B: 'Left',
121         0x3C: 'Right',
122         0x3D: 'Enter',
123         0x3F: 'Options',
124
125         0x41: 'Display',
126         0x42: 'Home',
127         0x43: 'Return',
128
129         0x56: 'Next',
130         0x57: 'Previous',
131     }),
132
133     # DVD
134     (0x1A, 0x49): (['DVD: ', 'DVD:'], {
135         0x0B: 'Enter',
136         0x0E: 'Return',
137         0x17: 'Options',
138
139         0x1A: 'Top Menu',
140         0x1B: 'Menu',
141
142         0x30: 'Previous',
143         0x31: 'Next',
144         0x32: 'Play',
145         0x33: 'Rewind',
146         0x34: 'Fast Forward',
147         0x38: 'Stop',
148         0x39: 'Pause',
149
150         0x54: 'Display',
151
152         0x7B: 'Left',
153         0x7C: 'Right',
154         0x79: 'Up',
155         0x7A: 'Down',
156     }),
157
158     # Amp, Game, Sat, Tuner, USB modes
159     (0x30, None): (['Keypad: ', 'KP:'], {
160         0x0C: 'Enter',
161
162         0x12: 'Volume Up',
163         0x13: 'Volume Down',
164         0x14: 'Mute',
165         0x15: 'Power',
166
167         0x21: 'Tuner',
168         0x22: 'Video',
169         0x25: 'CD',
170
171         0x4D: 'Home',
172         0x4B: 'Display',
173
174         0x60: 'Sleep',
175         0x6A: 'TV',
176
177         0x53: 'Home',
178
179         0x7C: 'Game',
180         0x7D: 'DVD',
181     }),
182
183     # Amp, Game, Sat, Tuner, USB modes
184     (0xB0, None): (['Arrows: ', 'Ar:'], {
185         0x7A: 'Left',
186         0x7B: 'Right',
187         0x78: 'Up',
188         0x79: 'Down',
189         0x77: 'Amp Menu',
190     }),
191
192     # TV mode
193     (0x97, None): (['TV Extra', 'TV:'], {
194         0x23: 'Return',
195         0x36: 'Options',
196
197     }),
198 }
199
200 for (address, extended), (name, commands) in ADDRESSES.items():
201     commands.update(NUMBERS)