← Documents Documentation/userspace-api/media/rc/rc-protos.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Remote Controller

Remote Controller protocol과 scan code

Kernel이 지원하는 RC protocol별 wire field와 u32 scan code bit mapping을 정의합니다.

Source pathDocumentation/userspace-api/media/rc/rc-protos.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

rc-protos.rst:1-454

Protocol decoder는 pulse/space message를 protocol별 u32 scan code로 정규화합니다. Address·command field 순서, 반전 byte, toggle bit, vendor 구분과 scan code byte 재배치는 protocol마다 다르므로 이 문서의 mapping을 ABI 기준으로 사용해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2
3 .. _Remote_controllers_Protocols:
4
5 *****************************************
6 Remote Controller Protocols and Scancodes
7 *****************************************
8
9 IR is encoded as a series of pulses and spaces, using a protocol. These
10 protocols can encode e.g. an address (which device should respond) and a
11 command: what it should do. The values for these are not always consistent
12 across different devices for a given protocol.
13
14 Therefore out the output of the IR decoder is a scancode; a single u32
15 value. Using keymap tables this can be mapped to linux key codes.
16
17 Other things can be encoded too. Some IR protocols encode a toggle bit; this
18 is to distinguish whether the same button is being held down, or has been
19 released and pressed again. If has been released and pressed again, the
20 toggle bit will invert from one IR message to the next.
21
22 Some remotes have a pointer-type device which can used to control the
23 mouse; some air conditioning systems can have their target temperature
24 target set in IR.
25
26 The following are the protocols the kernel knows about and also lists
27 how scancodes are encoded for each protocol.
28
29 rc-5 (RC_PROTO_RC5)
30 -------------------
31
32 This IR protocol uses manchester encoding to encode 14 bits. There is a
33 detailed description here https://www.sbprojects.net/knowledge/ir/rc5.php.
34
35 The scancode encoding is *not* consistent with the lirc daemon (lircd) rc5
36 protocol, or the manchester BPF decoder.
37
38 .. flat-table:: rc5 bits scancode mapping
39 :widths: 1 1 2
40
41 * - rc-5 bit
42
43 - scancode bit
44
45 - description
46
47 * - 1
48
49 - none
50
51 - Start bit, always set
52
53 * - 1
54
55 - 6 (inverted)
56
57 - 2nd start bit in rc5, re-used as 6th command bit
58
59 * - 1
60
61 - none
62
63 - Toggle bit
64
65 * - 5
66
67 - 8 to 13
68
69 - Address
70
71 * - 6
72
73 - 0 to 5
74
75 - Command
76
77 There is a variant of rc5 called either rc5x or extended rc5
78 where there the second stop bit is the 6th command bit, but inverted.
79 This is done so it the scancodes and encoding is compatible with existing
80 schemes. This bit is stored in bit 6 of the scancode, inverted. This is
81 done to keep it compatible with plain rc-5 where there are two start bits.
82
83 rc-5-sz (RC_PROTO_RC5_SZ)
84 -------------------------
85 This is much like rc-5 but one bit longer. The scancode is encoded
86 differently.
87
88 .. flat-table:: rc-5-sz bits scancode mapping
89 :widths: 1 1 2
90
91 * - rc-5-sz bits
92
93 - scancode bit
94
95 - description
96
97 * - 1
98
99 - none
100
101 - Start bit, always set
102
103 * - 1
104
105 - 13
106
107 - Address bit
108
109 * - 1
110
111 - none
112
113 - Toggle bit
114
115 * - 6
116
117 - 6 to 11
118
119 - Address
120
121 * - 6
122
123 - 0 to 5
124
125 - Command
126
127 rc-5x-20 (RC_PROTO_RC5X_20)
128 ---------------------------
129
130 This rc-5 extended to encoded 20 bits. The is a 3555 microseconds space
131 after the 8th bit.
132
133 .. flat-table:: rc-5x-20 bits scancode mapping
134 :widths: 1 1 2
135
136 * - rc-5-sz bits
137
138 - scancode bit
139
140 - description
141
142 * - 1
143
144 - none
145
146 - Start bit, always set
147
148 * - 1
149
150 - 14
151
152 - Address bit
153
154 * - 1
155
156 - none
157
158 - Toggle bit
159
160 * - 5
161
162 - 16 to 20
163
164 - Address
165
166 * - 6
167
168 - 8 to 13
169
170 - Address
171
172 * - 6
173
174 - 0 to 5
175
176 - Command
177
178
179 jvc (RC_PROTO_JVC)
180 ------------------
181
182 The jvc protocol is much like nec, without the inverted values. It is
183 described here https://www.sbprojects.net/knowledge/ir/jvc.php.
184
185 The scancode is a 16 bits value, where the address is the lower 8 bits
186 and the command the higher 8 bits; this is reversed from IR order.
187
188 sony-12 (RC_PROTO_SONY12)
189 -------------------------
190
191 The sony protocol is a pulse-width encoding. There are three variants,
192 which just differ in number of bits and scancode encoding.
193
194 .. flat-table:: sony-12 bits scancode mapping
195 :widths: 1 1 2
196
197 * - sony-12 bits
198
199 - scancode bit
200
201 - description
202
203 * - 5
204
205 - 16 to 20
206
207 - device
208
209 * - 7
210
211 - 0 to 6
212
213 - function
214
215 sony-15 (RC_PROTO_SONY15)
216 -------------------------
217
218 The sony protocol is a pulse-width encoding. There are three variants,
219 which just differ in number of bits and scancode encoding.
220
221 .. flat-table:: sony-12 bits scancode mapping
222 :widths: 1 1 2
223
224 * - sony-12 bits
225
226 - scancode bit
227
228 - description
229
230 * - 8
231
232 - 16 to 23
233
234 - device
235
236 * - 7
237
238 - 0 to 6
239
240 - function
241
242 sony-20 (RC_PROTO_SONY20)
243 -------------------------
244
245 The sony protocol is a pulse-width encoding. There are three variants,
246 which just differ in number of bits and scancode encoding.
247
248 .. flat-table:: sony-20 bits scancode mapping
249 :widths: 1 1 2
250
251 * - sony-20 bits
252
253 - scancode bit
254
255 - description
256
257 * - 5
258
259 - 16 to 20
260
261 - device
262
263 * - 7
264
265 - 0 to 7
266
267 - device
268
269 * - 8
270
271 - 8 to 15
272
273 - extended bits
274
275 nec (RC_PROTO_NEC)
276 ------------------
277
278 The nec protocol encodes an 8 bit address and an 8 bit command. It is
279 described here https://www.sbprojects.net/knowledge/ir/nec.php. Note
280 that the protocol sends least significant bit first.
281
282 As a check, the nec protocol sends the address and command twice; the
283 second time it is inverted. This is done for verification.
284
285 A plain nec IR message has 16 bits; the high 8 bits are the address
286 and the low 8 bits are the command.
287
288 nec-x (RC_PROTO_NECX)
289 ---------------------
290
291 Extended nec has a 16 bit address and a 8 bit command. This is encoded
292 as a 24 bit value as you would expect, with the lower 8 bits the command
293 and the upper 16 bits the address.
294
295 nec-32 (RC_PROTO_NEC32)
296 -----------------------
297
298 nec-32 does not send an inverted address or an inverted command; the
299 entire message, all 32 bits, are used.
300
301 For this to be decoded correctly, the second 8 bits must not be the
302 inverted value of the first, and also the last 8 bits must not be the
303 inverted value of the third 8 bit value.
304
305 The scancode has a somewhat unusual encoding.
306
307 .. flat-table:: nec-32 bits scancode mapping
308
309 * - nec-32 bits
310
311 - scancode bit
312
313 * - First 8 bits
314
315 - 16 to 23
316
317 * - Second 8 bits
318
319 - 24 to 31
320
321 * - Third 8 bits
322
323 - 0 to 7
324
325 * - Fourth 8 bits
326
327 - 8 to 15
328
329 sanyo (RC_PROTO_SANYO)
330 ----------------------
331
332 The sanyo protocol is like the nec protocol, but with 13 bits address
333 rather than 8 bits. Both the address and the command are followed by
334 their inverted versions, but these are not present in the scancodes.
335
336 Bis 8 to 20 of the scancode is the 13 bits address, and the lower 8
337 bits are the command.
338
339 mcir2-kbd (RC_PROTO_MCIR2_KBD)
340 ------------------------------
341
342 This protocol is generated by the Microsoft MCE keyboard for keyboard
343 events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
344
345 mcir2-mse (RC_PROTO_MCIR2_MSE)
346 ------------------------------
347
348 This protocol is generated by the Microsoft MCE keyboard for pointer
349 events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
350
351 rc-6-0 (RC_PROTO_RC6_0)
352 -----------------------
353
354 This is the rc-6 in mode 0. rc-6 is described here
355 https://www.sbprojects.net/knowledge/ir/rc6.php.
356 The scancode is the exact 16 bits as in the protocol. There is also a
357 toggle bit.
358
359 rc-6-6a-20 (RC_PROTO_RC6_6A_20)
360 -------------------------------
361
362 This is the rc-6 in mode 6a, 20 bits. rc-6 is described here
363 https://www.sbprojects.net/knowledge/ir/rc6.php.
364 The scancode is the exact 20 bits
365 as in the protocol. There is also a toggle bit.
366
367 rc-6-6a-24 (RC_PROTO_RC6_6A_24)
368 -------------------------------
369
370 This is the rc-6 in mode 6a, 24 bits. rc-6 is described here
371 https://www.sbprojects.net/knowledge/ir/rc6.php.
372 The scancode is the exact 24 bits
373 as in the protocol. There is also a toggle bit.
374
375 rc-6-6a-32 (RC_PROTO_RC6_6A_32)
376 -------------------------------
377
378 This is the rc-6 in mode 6a, 32 bits. rc-6 is described here
379 https://www.sbprojects.net/knowledge/ir/rc6.php.
380 The upper 16 bits are the vendor,
381 and the lower 16 bits are the vendor-specific bits. This protocol is
382 for the non-Microsoft MCE variant (vendor != 0x800f).
383
384
385 rc-6-mce (RC_PROTO_RC6_MCE)
386 ---------------------------
387
388 This is the rc-6 in mode 6a, 32 bits. The upper 16 bits are the vendor,
389 and the lower 16 bits are the vendor-specific bits. This protocol is
390 for the Microsoft MCE variant (vendor = 0x800f). The toggle bit in the
391 protocol itself is ignored, and the 16th bit should be takes as the toggle
392 bit.
393
394 sharp (RC_PROTO_SHARP)
395 ----------------------
396
397 This is a protocol used by Sharp VCRs, is described here
398 https://www.sbprojects.net/knowledge/ir/sharp.php. There is a very long
399 (40ms) space between the normal and inverted values, and some IR receivers
400 cannot decode this.
401
402 There is a 5 bit address and a 8 bit command. In the scancode the address is
403 in bits 8 to 12, and the command in bits 0 to 7.
404
405 xmp (RC_PROTO_XMP)
406 ------------------
407
408 This protocol has several versions and only version 1 is supported. Refer
409 to the decoder (ir-xmp-decoder.c) to see how it is encoded.
410
411
412 cec (RC_PROTO_CEC)
413 ------------------
414
415 This is not an IR protocol, this is a protocol over CEC. The CEC
416 infrastructure uses rc-core for handling CEC commands, so that they
417 can easily be remapped.
418
419 imon (RC_PROTO_IMON)
420 --------------------
421
422 This protocol is used by Antec Veris/SoundGraph iMON remotes.
423
424 The protocol
425 describes both button presses and pointer movements. The protocol encodes
426 31 bits, and the scancode is simply the 31 bits with the top bit always 0.
427
428 rc-mm-12 (RC_PROTO_RCMM12)
429 --------------------------
430
431 The rc-mm protocol is described here
432 https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
433 the 12 bits.
434
435 rc-mm-24 (RC_PROTO_RCMM24)
436 --------------------------
437
438 The rc-mm protocol is described here
439 https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
440 the 24 bits.
441
442 rc-mm-32 (RC_PROTO_RCMM32)
443 --------------------------
444
445 The rc-mm protocol is described here
446 https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
447 the 32 bits.
448
449 xbox-dvd (RC_PROTO_XBOX_DVD)
450 ----------------------------
451
452 This protocol is used by Xbox DVD Remote, which was made for the original
453 Xbox. There is no in-kernel decoder or encoder for this protocol. The usb
454 device decodes the protocol. There is a BPF decoder available in v4l-utils.
455

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

IR message와 scan code mapping

1-28

IR은 protocol이 정한 pulse와 space의 연속으로 encode됩니다. Protocol은 어느 장치가 응답할지를 나타내는 address와 수행할 동작인 command 등을 담을 수 있지만, 같은 protocol에서도 장치마다 이 값의 사용 방식이 항상 일치하지는 않습니다.

IR decoder의 출력은 하나의 u32 scan code입니다. Kernel keymap table은 이 scan code를 Linux key code로 변환합니다.

Protocol은 address와 command 외에도 toggle bit 같은 상태를 encode할 수 있습니다. Toggle bit는 button을 계속 누른 상태와 놓았다가 다시 누른 상태를 구분하며, 다시 누르면 연속 IR message 사이에서 값이 반전됩니다.

일부 remote는 mouse를 제어하는 pointer-type device를 포함하고, air conditioner처럼 target temperature 자체를 IR message에 담는 장치도 있습니다. 이어지는 절은 kernel이 아는 protocol과 각 protocol의 scan code bit 배치를 정의합니다.

IR에서 Linux key event까지
Receiver가 pulse와 space 수신Protocol decoder가 address, command와 상태 bit 해석Protocol별 규칙으로 u32 scan code 구성Keymap이 scan code를 Linux key code로 mappingevdev input event로 전달

Protocol bitstream을 공통 input event로 변환합니다.

.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later

.. _Remote_controllers_Protocols:

*****************************************
Remote Controller Protocols and Scancodes
*****************************************

IR is encoded as a series of pulses and spaces, using a protocol. These
protocols can encode e.g. an address (which device should respond) and a
command: what it should do. The values for these are not always consistent
across different devices for a given protocol.

Therefore out the output of the IR decoder is a scancode; a single u32
value. Using keymap tables this can be mapped to linux key codes.

Other things can be encoded too. Some IR protocols encode a toggle bit; this
is to distinguish whether the same button is being held down, or has been
released and pressed again. If has been released and pressed again, the
toggle bit will invert from one IR message to the next.

Some remotes have a pointer-type device which can used to control the
mouse; some air conditioning systems can have their target temperature
target set in IR.

The following are the protocols the kernel knows about and also lists
how scancodes are encoded for each protocol.

rc-5 (RC_PROTO_RC5)

29-82

rc-5는 Manchester encoding으로 14 bit를 encode합니다. Kernel scan code 배치는 lircd의 rc5 protocol 및 Manchester BPF decoder와 일치하지 않으므로 서로의 숫자를 그대로 교환해서는 안 됩니다.

rc-5 bit와 scan code mapping
rc-5 bit 수scan code bit설명
1 bit없음항상 설정되는 start bit
1 bitbit 6, 반전rc5의 두 번째 start bit를 6번째 command bit로 재사용
1 bit없음Toggle bit
5 bitbit 8~13Address
6 bitbit 0~5Command

Start·toggle bit는 scan code에 직접 저장되지 않거나 별도 flag로 처리됩니다.

rc5x 또는 extended rc5 variant에서는 원문이 두 번째 stop bit라고 부르는 bit를 반전된 6번째 command bit로 사용합니다. 기존 scheme 및 일반 rc-5의 두 start bit와 호환되도록 이 값을 scan code bit 6에 반전해 저장합니다.

rc-5 (RC_PROTO_RC5)
-------------------

This IR protocol uses manchester encoding to encode 14 bits. There is a
detailed description here https://www.sbprojects.net/knowledge/ir/rc5.php.

The scancode encoding is *not* consistent with the lirc daemon (lircd) rc5
protocol, or the manchester BPF decoder.

.. flat-table:: rc5 bits scancode mapping
   :widths:       1 1 2

   * - rc-5 bit

     - scancode bit

     - description

   * - 1

     - none

     - Start bit, always set

   * - 1

     - 6 (inverted)

     - 2nd start bit in rc5,  re-used as 6th command bit

   * - 1

     - none

     - Toggle bit

   * - 5

     - 8 to 13

     - Address

   * - 6

     - 0 to 5

     - Command

There is a variant of rc5 called either rc5x or extended rc5
where there the second stop bit is the 6th command bit, but inverted.
This is done so it the scancodes and encoding is compatible with existing
schemes. This bit is stored in bit 6 of the scancode, inverted. This is
done to keep it compatible with plain rc-5 where there are two start bits.

rc-5-sz (RC_PROTO_RC5_SZ)

83-126

`RC_PROTO_RC5_SZ`로 식별되는 rc-5-sz는 rc-5와 매우 비슷하지만 한 bit 더 길고 scan code encoding도 다릅니다.

rc-5-sz bit와 scan code mapping
rc-5-sz bit 수scan code bit설명
1 bit없음항상 설정되는 start bit
1 bitbit 13Address bit
1 bit없음Toggle bit
6 bitbit 6~11Address
6 bitbit 0~5Command

Address가 상위 단일 bit와 6-bit field로 나뉩니다.

rc-5-sz (RC_PROTO_RC5_SZ)
-------------------------
This is much like rc-5 but one bit longer. The scancode is encoded
differently.

.. flat-table:: rc-5-sz bits scancode mapping
   :widths:       1 1 2

   * - rc-5-sz bits

     - scancode bit

     - description

   * - 1

     - none

     - Start bit, always set

   * - 1

     - 13

     - Address bit

   * - 1

     - none

     - Toggle bit

   * - 6

     - 6 to 11

     - Address

   * - 6

     - 0 to 5

     - Command

rc-5x-20 (RC_PROTO_RC5X_20)

127-178

rc-5x-20은 rc-5를 20 bit로 확장한 protocol입니다. 8번째 bit 뒤에 3555 microsecond space가 들어갑니다.

rc-5x-20 bit와 scan code mapping
rc-5x-20 bit 수scan code bit설명
1 bit없음항상 설정되는 start bit
1 bitbit 14Address bit
1 bit없음Toggle bit
5 bitbit 16~20Address
6 bitbit 8~13Address
6 bitbit 0~5Command

두 address field와 command field를 떨어진 scan code 영역에 배치합니다.

원문 flat-table의 첫 열 제목은 `rc-5-sz bits`로 적혀 있지만 이 절의 대상과 symbol은 `RC_PROTO_RC5X_20`입니다. 원문 표 자체는 접을 수 있는 원문 영역에 그대로 보존됩니다.

rc-5x-20 (RC_PROTO_RC5X_20)
---------------------------

This rc-5 extended to encoded 20 bits. The is a 3555 microseconds space
after the 8th bit.

.. flat-table:: rc-5x-20 bits scancode mapping
   :widths:       1 1 2

   * - rc-5-sz bits

     - scancode bit

     - description

   * - 1

     - none

     - Start bit, always set

   * - 1

     - 14

     - Address bit

   * - 1

     - none

     - Toggle bit

   * - 5

     - 16 to 20

     - Address

   * - 6

     - 8 to 13

     - Address

   * - 6

     - 0 to 5

     - Command

jvc (RC_PROTO_JVC)

179-187

JVC protocol은 반전 값을 보내지 않는다는 점을 제외하면 NEC와 매우 비슷합니다. Scan code는 16 bit이며 address가 하위 8 bit, command가 상위 8 bit입니다.

이 scan code 배치는 IR wire order와 반대입니다. Decoder 또는 analyzer의 전송 순서 값을 그대로 scan code로 취급하지 않도록 주의해야 합니다.

JVC scan code
scan code bit내용
bit 0~7Address
bit 8~15Command

16-bit scan code의 byte 배치입니다.

jvc (RC_PROTO_JVC)
------------------

The jvc protocol is much like nec, without the inverted values. It is
described here https://www.sbprojects.net/knowledge/ir/jvc.php.

The scancode is a 16 bits value, where the address is the lower 8 bits
and the command the higher 8 bits; this is reversed from IR order.

sony-12 (RC_PROTO_SONY12)

188-214

Sony protocol은 pulse-width encoding이며 12·15·20 bit 세 variant가 있습니다. 차이는 전체 bit 수와 scan code 배치입니다.

sony-12 bit와 scan code mapping
sony-12 bit 수scan code bit설명
5 bitbit 16~20Device
7 bitbit 0~6Function

5-bit device와 7-bit function을 분리합니다.

sony-12 (RC_PROTO_SONY12)
-------------------------

The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.

.. flat-table:: sony-12 bits scancode mapping
   :widths:       1 1 2

   * - sony-12 bits

     - scancode bit

     - description

   * - 5

     - 16 to 20

     - device

   * - 7

     - 0 to 6

     - function

sony-15 (RC_PROTO_SONY15)

215-241

sony-15도 pulse-width encoding을 사용하며 device field가 8 bit로 늘어나고 function field는 7 bit로 유지됩니다.

sony-15 bit와 scan code mapping
sony-15 bit 수scan code bit설명
8 bitbit 16~23Device
7 bitbit 0~6Function

상위 device field와 하위 function field 배치입니다.

원문 flat-table 제목과 첫 열 header에는 `sony-12`가 적혀 있지만 절과 protocol symbol은 `RC_PROTO_SONY15`입니다. 번역 표는 해당 절의 실제 15-bit variant로 표시합니다.

sony-15 (RC_PROTO_SONY15)
-------------------------

The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.

.. flat-table:: sony-12 bits scancode mapping
   :widths:       1 1 2

   * - sony-12 bits

     - scancode bit

     - description

   * - 8

     - 16 to 23

     - device

   * - 7

     - 0 to 6

     - function

sony-20 (RC_PROTO_SONY20)

242-274

sony-20은 20-bit pulse-width variant입니다. 원문이 제시한 field 이름과 bit 범위를 그대로 옮기면 다음과 같습니다.

sony-20 bit와 scan code mapping
sony-20 bit 수scan code bit설명
5 bitbit 16~20Device
7 bitbit 0~7Device
8 bitbit 8~15Extended bits

Device와 extended field가 서로 다른 scan code 영역에 배치됩니다.

두 번째 행은 원문에서 7 bit를 scan code bit 0~7의 device field로 적습니다. 이 apparent width 차이를 임의로 고치지 않고 local v6.18.37 문서 내용을 보존했습니다.

sony-20 (RC_PROTO_SONY20)
-------------------------

The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.

.. flat-table:: sony-20 bits scancode mapping
   :widths:       1 1 2

   * - sony-20 bits

     - scancode bit

     - description

   * - 5

     - 16 to 20

     - device

   * - 7

     - 0 to 7

     - device

   * - 8

     - 8 to 15

     - extended bits

nec (RC_PROTO_NEC)

275-287

NEC protocol은 8-bit address와 8-bit command를 encode하며 least significant bit부터 전송합니다.

검증을 위해 address와 command를 각각 두 번 보내되 두 번째 값은 반전합니다. 일반 NEC IR message의 scan code는 16 bit이며 상위 8 bit가 address, 하위 8 bit가 command입니다.

일반 NEC scan code
scan code bit내용
bit 8~15Address
bit 0~7Command

전송의 LSB-first 특성과 별개인 논리 scan code 배치입니다.

nec (RC_PROTO_NEC)
------------------

The nec protocol encodes an 8 bit address and an 8 bit command. It is
described here https://www.sbprojects.net/knowledge/ir/nec.php. Note
that the protocol sends least significant bit first.

As a check, the nec protocol sends the address and command twice; the
second time it is inverted. This is done for verification.

A plain nec IR message has 16 bits; the high 8 bits are the address
and the low 8 bits are the command.

nec-x (RC_PROTO_NECX)

288-294

Extended NEC는 16-bit address와 8-bit command를 사용합니다. 예상할 수 있는 24-bit 값으로 encode하며 하위 8 bit가 command, 상위 16 bit가 address입니다.

NEC-X scan code
scan code bit내용
bit 8~2316-bit address
bit 0~78-bit command

24-bit scan code의 field 배치입니다.

nec-x (RC_PROTO_NECX)
---------------------

Extended nec has a 16 bit address and a 8 bit command. This is encoded
as a 24 bit value as you would expect, with the lower 8 bits the command
and the upper 16 bits the address.

nec-32 (RC_PROTO_NEC32)

295-328

NEC-32는 반전 address나 반전 command를 보내지 않고 32 bit 전체를 message data로 사용합니다.

올바르게 NEC-32로 decode되려면 두 번째 8-bit 값이 첫 번째 값의 반전이 아니어야 하고, 마지막 8-bit 값도 세 번째 값의 반전이 아니어야 합니다. 반전 관계가 있으면 일반 NEC 계열로 해석될 수 있습니다.

Scan code byte 순서는 전송의 네 8-bit chunk를 직선적으로 놓지 않는 독특한 배치입니다.

nec-32 bit와 scan code mapping
nec-32 전송 fieldscan code bit
첫 번째 8 bitbit 16~23
두 번째 8 bitbit 24~31
세 번째 8 bitbit 0~7
네 번째 8 bitbit 8~15

전송 순서의 byte를 scan code에서 재배열합니다.

nec-32 (RC_PROTO_NEC32)
-----------------------

nec-32 does not send an inverted address or an inverted command; the
entire message, all 32 bits, are used.

For this to be decoded correctly, the second 8 bits must not be the
inverted value of the first, and also the last 8 bits must not be the
inverted value of the third 8 bit value.

The scancode has a somewhat unusual encoding.

.. flat-table:: nec-32 bits scancode mapping

   * - nec-32 bits

     - scancode bit

   * - First 8 bits

     - 16 to 23

   * - Second 8 bits

     - 24 to 31

   * - Third 8 bits

     - 0 to 7

   * - Fourth 8 bits

     - 8 to 15

sanyo (RC_PROTO_SANYO)

329-338

Sanyo protocol은 NEC와 비슷하지만 address가 8 bit가 아니라 13 bit입니다. Address와 command 뒤에는 각각 반전 값이 오지만 이 반전 값은 scan code에 포함하지 않습니다.

Scan code bit 8~20에 13-bit address를, 하위 8 bit인 bit 0~7에 command를 저장합니다. 원문의 `Bis` 표기는 문맥상 `Bits`로 해석하되 영어 원문에는 그대로 남습니다.

Sanyo scan code
scan code bit내용
bit 8~2013-bit address
bit 0~78-bit command

검증용 반전 값은 제외한 field 배치입니다.

sanyo (RC_PROTO_SANYO)
----------------------

The sanyo protocol is like the nec protocol, but with 13 bits address
rather than 8 bits. Both the address and the command are followed by
their inverted versions, but these are not present in the scancodes.

Bis 8 to 20 of the scancode is the 13 bits address, and the lower 8
bits are the command.

mcir2 keyboard와 pointer protocol

339-350

`RC_PROTO_MCIR2_KBD`는 Microsoft MCE keyboard가 keyboard event에 생성하는 protocol입니다. 정확한 encoding은 `ir-mce_kbd-decoder.c` 구현을 참조합니다.

`RC_PROTO_MCIR2_MSE`는 같은 keyboard의 pointer event용 protocol이며 encoding 기준 역시 `ir-mce_kbd-decoder.c`입니다.

MCIR2 protocol 구분
protocol용도
RC_PROTO_MCIR2_KBDKeyboard event
RC_PROTO_MCIR2_MSEPointer event

동일 장치의 event 종류에 따라 protocol symbol이 다릅니다.

mcir2-kbd (RC_PROTO_MCIR2_KBD)
------------------------------

This protocol is generated by the Microsoft MCE keyboard for keyboard
events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.

mcir2-mse (RC_PROTO_MCIR2_MSE)
------------------------------

This protocol is generated by the Microsoft MCE keyboard for pointer
events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.

rc-6-0 (RC_PROTO_RC6_0)

351-358

이 protocol은 rc-6 mode 0입니다. Scan code는 protocol의 16 bit를 그대로 사용하며 별도의 toggle bit도 있습니다.

RC6 mode 0
항목설명
scan codeProtocol의 정확한 16 bit
상태Toggle bit 별도 제공

Protocol payload와 scan code가 직접 대응합니다.

rc-6-0 (RC_PROTO_RC6_0)
-----------------------

This is the rc-6 in mode 0. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 16 bits as in the protocol. There is also a
toggle bit.

rc-6-6a-20 (RC_PROTO_RC6_6A_20)

359-366

rc-6 mode 6a의 20-bit variant입니다. Scan code는 protocol의 정확한 20 bit이며 toggle bit도 제공합니다.

RC6 6A 20-bit
항목설명
scan codeProtocol의 정확한 20 bit
상태Toggle bit 별도 제공

Payload와 상태 구성입니다.

rc-6-6a-20 (RC_PROTO_RC6_6A_20)
-------------------------------

This is the rc-6 in mode 6a, 20 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 20 bits
as in the protocol. There is also a toggle bit.

rc-6-6a-24 (RC_PROTO_RC6_6A_24)

367-374

rc-6 mode 6a의 24-bit variant입니다. Scan code는 protocol의 정확한 24 bit이며 toggle bit도 제공합니다.

RC6 6A 24-bit
항목설명
scan codeProtocol의 정확한 24 bit
상태Toggle bit 별도 제공

Payload와 상태 구성입니다.

rc-6-6a-24 (RC_PROTO_RC6_6A_24)
-------------------------------

This is the rc-6 in mode 6a, 24 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 24 bits
as in the protocol. There is also a toggle bit.

rc-6-6a-32 (RC_PROTO_RC6_6A_32)

375-384

rc-6 mode 6a의 32-bit non-Microsoft MCE variant입니다. 상위 16 bit는 vendor, 하위 16 bit는 vendor-specific bits입니다.

이 protocol은 vendor가 `0x800f`가 아닌 경우에 사용합니다. Microsoft vendor 값은 별도 `RC_PROTO_RC6_MCE`로 구분합니다.

RC6 6A 32-bit non-MCE
scan code bit내용
bit 16~31Vendor, 0x800f가 아님
bit 0~15Vendor-specific bits

Vendor 값으로 MCE variant와 구분합니다.

rc-6-6a-32 (RC_PROTO_RC6_6A_32)
-------------------------------

This is the rc-6 in mode 6a, 32 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The upper 16 bits are the vendor,
and the lower 16 bits are the vendor-specific bits. This protocol is
for the non-Microsoft MCE variant (vendor != 0x800f).

rc-6-mce (RC_PROTO_RC6_MCE)

385-393

Microsoft MCE variant도 rc-6 mode 6a의 32-bit 형식이며 상위 16 bit는 vendor, 하위 16 bit는 vendor-specific bits입니다. Vendor 값은 `0x800f`입니다.

Protocol 자체의 toggle bit는 무시하고 16번째 bit를 toggle bit로 취급해야 합니다.

RC6 MCE 구분 규칙
항목설명
Vendor0x800f
Payload상위 16-bit vendor + 하위 16-bit vendor-specific
ToggleProtocol toggle은 무시, 16번째 bit 사용

Vendor와 toggle 해석이 non-MCE variant와 다릅니다.

rc-6-mce (RC_PROTO_RC6_MCE)
---------------------------

This is the rc-6 in mode 6a, 32 bits. The upper 16 bits are the vendor,
and the lower 16 bits are the vendor-specific bits. This protocol is
for the Microsoft MCE variant (vendor = 0x800f). The toggle bit in the
protocol itself is ignored, and the 16th bit should be takes as the toggle
bit.

sharp (RC_PROTO_SHARP)

394-404

Sharp VCR이 사용하는 protocol입니다. 정상 값과 반전 값 사이에 40 ms라는 매우 긴 space가 있어 일부 IR receiver는 이를 decode하지 못할 수 있습니다.

5-bit address는 scan code bit 8~12에, 8-bit command는 bit 0~7에 저장합니다.

Sharp scan code
scan code bit내용
bit 8~125-bit address
bit 0~78-bit command

긴 inter-frame space와 별개인 논리 field 배치입니다.

sharp (RC_PROTO_SHARP)
----------------------

This is a protocol used by Sharp VCRs, is described here
https://www.sbprojects.net/knowledge/ir/sharp.php. There is a very long
(40ms) space between the normal and inverted values, and some IR receivers
cannot decode this.

There is a 5 bit address and a 8 bit command. In the scancode the address is
in bits 8 to 12, and the command in bits 0 to 7.

xmp (RC_PROTO_XMP)

405-411

XMP protocol에는 여러 version이 있지만 kernel은 version 1만 지원합니다. Scan code encoding의 상세 기준은 `ir-xmp-decoder.c` 구현입니다.

XMP 지원 범위
항목설명
지원 versionXMP version 1
Encoding 기준ir-xmp-decoder.c

문서가 명시하는 version과 구현 기준입니다.

xmp (RC_PROTO_XMP)
------------------

This protocol has several versions and only version 1 is supported. Refer
to the decoder (ir-xmp-decoder.c) to see how it is encoded.

cec (RC_PROTO_CEC)

412-418

CEC는 IR protocol이 아니라 CEC transport 위의 protocol입니다. CEC infrastructure가 command를 쉽게 remap할 수 있도록 rc-core를 사용하기 때문에 RC protocol 목록에 포함됩니다.

CEC command remap
CEC infrastructure가 command 수신RC_PROTO_CEC scan code로 rc-core에 전달RC keymap으로 Linux key code remapInput event 생성

IR receiver 없이도 rc-core mapping을 재사용합니다.

cec (RC_PROTO_CEC)
------------------

This is not an IR protocol, this is a protocol over CEC. The CEC
infrastructure uses rc-core for handling CEC commands, so that they
can easily be remapped.

imon (RC_PROTO_IMON)

419-427

Antec Veris/SoundGraph iMON remote가 사용하는 protocol입니다. Button press와 pointer movement를 모두 표현합니다.

Protocol은 31 bit를 encode하며 scan code는 그 31 bit를 그대로 사용하고 최상위 bit는 항상 0입니다.

iMON scan code
scan code bit내용
bit 0~30Button 또는 pointer payload
bit 31항상 0

u32 안에 31-bit protocol 값을 직접 배치합니다.

imon (RC_PROTO_IMON)
--------------------

This protocol is used by Antec Veris/SoundGraph iMON remotes.

The protocol
describes both button presses and pointer movements. The protocol encodes
31 bits, and the scancode is simply the 31 bits with the top bit always 0.

rc-mm 12·24·32 bit variant

428-448

rc-mm protocol에는 12·24·32 bit variant가 있으며 각 scan code는 protocol bit를 변형 없이 그대로 사용합니다.

RC-MM variant
protocolscan code
RC_PROTO_RCMM12정확한 12 bit
RC_PROTO_RCMM24정확한 24 bit
RC_PROTO_RCMM32정확한 32 bit

Protocol payload와 scan code 길이가 같습니다.

rc-mm-12 (RC_PROTO_RCMM12)
--------------------------

The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 12 bits.

rc-mm-24 (RC_PROTO_RCMM24)
--------------------------

The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 24 bits.

rc-mm-32 (RC_PROTO_RCMM32)
--------------------------

The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 32 bits.

xbox-dvd (RC_PROTO_XBOX_DVD)

449-454

Original Xbox용 Xbox DVD Remote가 사용하는 protocol입니다. Kernel 안에는 이 protocol의 decoder나 encoder가 없습니다.

USB 장치가 protocol을 직접 decode합니다. Raw IR 환경을 위한 BPF decoder는 `v4l-utils`에서 제공합니다.

Xbox DVD protocol 지원 경로
항목설명
In-kernel decoder없음
In-kernel encoder없음
USB 장치Protocol 직접 decode
v4l-utilsBPF decoder 제공

Kernel codec 부재와 대체 decode 경로입니다.

xbox-dvd (RC_PROTO_XBOX_DVD)
----------------------------

This protocol is used by Xbox DVD Remote, which was made for the original
Xbox. There is no in-kernel decoder or encoder for this protocol. The usb
device decodes the protocol. There is a BPF decoder available in v4l-utils.