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