| 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 | |
| 17 | .. code-block:: none |
| 18 | |
| 19 | $ dmesg |grep lirc_dev |
| 20 | lirc_dev: IR Remote Control driver registered, major 248 |
| 21 | rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0 |
| 22 | |
| 23 | What you should see for a chardev: |
| 24 | |
| 25 | .. code-block:: none |
| 26 | |
| 27 | $ ls -l /dev/lirc* |
| 28 | crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0 |
| 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. |