lirc-dev-intro.rst 1.6 KB

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