Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _lirc_dev_intro: | |
4 | ||
5 | ************ | |
6 | Introduction | |
7 | ************ | |
8 | ||
9 | The LIRC device interface is a bi-directional interface for transporting | |
10 | raw IR data between userspace and kernelspace. Fundamentally, it is just | |
11 | a chardev (/dev/lircX, for X = 0, 1, 2, ...), with a number of standard | |
12 | struct file_operations defined on it. With respect to transporting raw | |
13 | IR data to and fro, the essential fops are read, write and ioctl. | |
14 | ||
15 | Example dmesg output upon a driver registering w/LIRC: | |
16 | ||
a23f4191 | 17 | .. code-block:: none |
5377d91f | 18 | |
a23f4191 | 19 | $ dmesg |grep lirc_dev |
5377d91f | 20 | lirc_dev: IR Remote Control driver registered, major 248 |
a23f4191 | 21 | rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0 |
5377d91f MH |
22 | |
23 | What you should see for a chardev: | |
24 | ||
a23f4191 | 25 | .. code-block:: none |
5377d91f | 26 | |
a23f4191 | 27 | $ ls -l /dev/lirc* |
5377d91f | 28 | crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0 |
048eb3ef MCC |
29 | |
30 | ********** | |
31 | LIRC modes | |
32 | ********** | |
33 | ||
34 | LIRC supports some modes of receiving and sending IR codes, as shown | |
35 | on the following table. | |
36 | ||
37 | .. _lirc-mode-mode2: | |
38 | ||
39 | ``LIRC_MODE_MODE2`` | |
40 | ||
41 | The driver returns a sequence of pulse and space codes to userspace. | |
42 | ||
43 | This mode is used only for IR receive. | |
44 | ||
45 | .. _lirc-mode-lirccode: | |
46 | ||
47 | ``LIRC_MODE_LIRCCODE`` | |
48 | ||
49 | The IR signal is decoded internally by the receiver. The LIRC interface | |
50 | returns the scancode as an integer value. This is the usual mode used | |
51 | by several TV media cards. | |
52 | ||
53 | This mode is used only for IR receive. | |
54 | ||
55 | .. _lirc-mode-pulse: | |
56 | ||
57 | ``LIRC_MODE_PULSE`` | |
58 | ||
59 | On puse mode, a sequence of pulse/space integer values are written to the | |
60 | lirc device using :Ref:`lirc-write`. | |
61 | ||
62 | This mode is used only for IR send. |