[media] lirc: document lirc modes better
LIRC_MODE_MODE2 and LIRC_MODE_LIRCCODE were not covered at all. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
5cd6522c5b
commit
a8b875a549
@@ -27,6 +27,8 @@ What you should see for a chardev:
|
||||
$ ls -l /dev/lirc*
|
||||
crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0
|
||||
|
||||
.. _lirc_modes:
|
||||
|
||||
**********
|
||||
LIRC modes
|
||||
**********
|
||||
@@ -38,25 +40,62 @@ on the following table.
|
||||
|
||||
``LIRC_MODE_MODE2``
|
||||
|
||||
The driver returns a sequence of pulse and space codes to userspace.
|
||||
The driver returns a sequence of pulse and space codes to userspace,
|
||||
as a series of u32 values.
|
||||
|
||||
This mode is used only for IR receive.
|
||||
|
||||
The upper 8 bits determine the packet type, and the lower 24 bits
|
||||
the payload. Use ``LIRC_VALUE()`` macro to get the payload, and
|
||||
the macro ``LIRC_MODE2()`` will give you the type, which
|
||||
is one of:
|
||||
|
||||
``LIRC_MODE2_PULSE``
|
||||
|
||||
Signifies the presence of IR in microseconds.
|
||||
|
||||
``LIRC_MODE2_SPACE``
|
||||
|
||||
Signifies absence of IR in microseconds.
|
||||
|
||||
``LIRC_MODE2_FREQUENCY``
|
||||
|
||||
If measurement of the carrier frequency was enabled with
|
||||
:ref:`lirc_set_measure_carrier_mode` then this packet gives you
|
||||
the carrier frequency in Hertz.
|
||||
|
||||
``LIRC_MODE2_TIMEOUT``
|
||||
|
||||
If timeout reports are enabled with
|
||||
:ref:`lirc_set_rec_timeout_reports`, when the timeout set with
|
||||
:ref:`lirc_set_rec_timeout` expires due to no IR being detected,
|
||||
this packet will be sent, with the number of microseconds with
|
||||
no IR.
|
||||
|
||||
.. _lirc-mode-lirccode:
|
||||
|
||||
``LIRC_MODE_LIRCCODE``
|
||||
|
||||
The IR signal is decoded internally by the receiver. The LIRC interface
|
||||
returns the scancode as an integer value. This is the usual mode used
|
||||
by several TV media cards.
|
||||
This mode can be used for IR receive and send.
|
||||
|
||||
This mode is used only for IR receive.
|
||||
The IR signal is decoded internally by the receiver, or encoded by the
|
||||
transmitter. The LIRC interface represents the scancode as byte string,
|
||||
which might not be a u32, it can be any length. The value is entirely
|
||||
driver dependent. This mode is used by some older lirc drivers.
|
||||
|
||||
The length of each code depends on the driver, which can be retrieved
|
||||
with :ref:`lirc_get_length`. This length is used both
|
||||
for transmitting and receiving IR.
|
||||
|
||||
.. _lirc-mode-pulse:
|
||||
|
||||
``LIRC_MODE_PULSE``
|
||||
|
||||
On puse mode, a sequence of pulse/space integer values are written to the
|
||||
lirc device using :Ref:`lirc-write`.
|
||||
In pulse mode, a sequence of pulse/space integer values are written to the
|
||||
lirc device using :ref:`lirc-write`.
|
||||
|
||||
The values are alternating pulse and space lengths, in microseconds. The
|
||||
first and last entry must be a pulse, so there must be an odd number
|
||||
of entries.
|
||||
|
||||
This mode is used only for IR send.
|
||||
|
Reference in New Issue
Block a user