ext-ctrls-flash.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _flash-controls:
  4. ***********************
  5. Flash Control Reference
  6. ***********************
  7. The V4L2 flash controls are intended to provide generic access to flash
  8. controller devices. Flash controller devices are typically used in
  9. digital cameras.
  10. The interface can support both LED and xenon flash devices. As of
  11. writing this, there is no xenon flash driver using this interface.
  12. .. _flash-controls-use-cases:
  13. Supported use cases
  14. ===================
  15. Unsynchronised LED flash (software strobe)
  16. ------------------------------------------
  17. Unsynchronised LED flash is controlled directly by the host as the
  18. sensor. The flash must be enabled by the host before the exposure of the
  19. image starts and disabled once it ends. The host is fully responsible
  20. for the timing of the flash.
  21. Example of such device: Nokia N900.
  22. Synchronised LED flash (hardware strobe)
  23. ----------------------------------------
  24. The synchronised LED flash is pre-programmed by the host (power and
  25. timeout) but controlled by the sensor through a strobe signal from the
  26. sensor to the flash.
  27. The sensor controls the flash duration and timing. This information
  28. typically must be made available to the sensor.
  29. LED flash as torch
  30. ------------------
  31. LED flash may be used as torch in conjunction with another use case
  32. involving camera or individually.
  33. .. _flash-control-id:
  34. Flash Control IDs
  35. -----------------
  36. ``V4L2_CID_FLASH_CLASS (class)``
  37. The FLASH class descriptor.
  38. .. _v4l2-cid-flash-led-mode:
  39. ``V4L2_CID_FLASH_LED_MODE (menu)``
  40. Defines the mode of the flash LED, the high-power white LED attached
  41. to the flash controller. Setting this control may not be possible in
  42. presence of some faults. See V4L2_CID_FLASH_FAULT.
  43. .. tabularcolumns:: |p{5.7cm}|p{11.8cm}|
  44. .. flat-table::
  45. :header-rows: 0
  46. :stub-columns: 0
  47. * - ``V4L2_FLASH_LED_MODE_NONE``
  48. - Off.
  49. * - ``V4L2_FLASH_LED_MODE_FLASH``
  50. - Flash mode.
  51. * - ``V4L2_FLASH_LED_MODE_TORCH``
  52. - Torch mode.
  53. See V4L2_CID_FLASH_TORCH_INTENSITY.
  54. .. _v4l2-cid-flash-strobe-source:
  55. ``V4L2_CID_FLASH_STROBE_SOURCE (menu)``
  56. Defines the source of the flash LED strobe.
  57. .. tabularcolumns:: |p{7.5cm}|p{7.5cm}|
  58. .. flat-table::
  59. :header-rows: 0
  60. :stub-columns: 0
  61. * - ``V4L2_FLASH_STROBE_SOURCE_SOFTWARE``
  62. - The flash strobe is triggered by using the
  63. V4L2_CID_FLASH_STROBE control.
  64. * - ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL``
  65. - The flash strobe is triggered by an external source. Typically
  66. this is a sensor, which makes it possible to synchronise the
  67. flash strobe start to exposure start.
  68. This method of controlling flash LED strobe has two additional
  69. prerequisites: the strobe source's :ref:`strobe output
  70. <v4l2-cid-flash-strobe-oe>` must be enabled (if available)
  71. and the flash controller's :ref:`flash LED mode
  72. <v4l2-cid-flash-led-mode>` must be set to
  73. ``V4L2_FLASH_LED_MODE_FLASH``.
  74. ``V4L2_CID_FLASH_STROBE (button)``
  75. Strobe flash. Valid when V4L2_CID_FLASH_LED_MODE is set to
  76. V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
  77. is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
  78. control may not be possible in presence of some faults. See
  79. V4L2_CID_FLASH_FAULT.
  80. ``V4L2_CID_FLASH_STROBE_STOP (button)``
  81. Stop flash strobe immediately.
  82. ``V4L2_CID_FLASH_STROBE_STATUS (boolean)``
  83. Strobe status: whether the flash is strobing at the moment or not.
  84. This is a read-only control.
  85. ``V4L2_CID_FLASH_TIMEOUT (integer)``
  86. Hardware timeout for flash. The flash strobe is stopped after this
  87. period of time has passed from the start of the strobe.
  88. ``V4L2_CID_FLASH_INTENSITY (integer)``
  89. Intensity of the flash strobe when the flash LED is in flash mode
  90. (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps (mA)
  91. if possible.
  92. ``V4L2_CID_FLASH_TORCH_INTENSITY (integer)``
  93. Intensity of the flash LED in torch mode
  94. (V4L2_FLASH_LED_MODE_TORCH). The unit should be milliamps (mA)
  95. if possible. Setting this control may not be possible in presence of
  96. some faults. See V4L2_CID_FLASH_FAULT.
  97. ``V4L2_CID_FLASH_INDICATOR_INTENSITY (integer)``
  98. Intensity of the indicator LED. The indicator LED may be fully
  99. independent of the flash LED. The unit should be microamps (uA) if
  100. possible.
  101. ``V4L2_CID_FLASH_FAULT (bitmask)``
  102. Faults related to the flash. The faults tell about specific problems
  103. in the flash chip itself or the LEDs attached to it. Faults may
  104. prevent further use of some of the flash controls. In particular,
  105. V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
  106. if the fault affects the flash LED. Exactly which faults have such
  107. an effect is chip dependent. Reading the faults resets the control
  108. and returns the chip to a usable state if possible.
  109. .. tabularcolumns:: |p{8.4cm}|p{9.1cm}|
  110. .. flat-table::
  111. :header-rows: 0
  112. :stub-columns: 0
  113. * - ``V4L2_FLASH_FAULT_OVER_VOLTAGE``
  114. - Flash controller voltage to the flash LED has exceeded the limit
  115. specific to the flash controller.
  116. * - ``V4L2_FLASH_FAULT_TIMEOUT``
  117. - The flash strobe was still on when the timeout set by the user ---
  118. V4L2_CID_FLASH_TIMEOUT control --- has expired. Not all flash
  119. controllers may set this in all such conditions.
  120. * - ``V4L2_FLASH_FAULT_OVER_TEMPERATURE``
  121. - The flash controller has overheated.
  122. * - ``V4L2_FLASH_FAULT_SHORT_CIRCUIT``
  123. - The short circuit protection of the flash controller has been
  124. triggered.
  125. * - ``V4L2_FLASH_FAULT_OVER_CURRENT``
  126. - Current in the LED power supply has exceeded the limit specific to
  127. the flash controller.
  128. * - ``V4L2_FLASH_FAULT_INDICATOR``
  129. - The flash controller has detected a short or open circuit
  130. condition on the indicator LED.
  131. * - ``V4L2_FLASH_FAULT_UNDER_VOLTAGE``
  132. - Flash controller voltage to the flash LED has been below the
  133. minimum limit specific to the flash controller.
  134. * - ``V4L2_FLASH_FAULT_INPUT_VOLTAGE``
  135. - The input voltage of the flash controller is below the limit under
  136. which strobing the flash at full current will not be possible.The
  137. condition persists until this flag is no longer set.
  138. * - ``V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE``
  139. - The temperature of the LED has exceeded its allowed upper limit.
  140. ``V4L2_CID_FLASH_CHARGE (boolean)``
  141. Enable or disable charging of the xenon flash capacitor.
  142. ``V4L2_CID_FLASH_READY (boolean)``
  143. Is the flash ready to strobe? Xenon flashes require their capacitors
  144. charged before strobing. LED flashes often require a cooldown period
  145. after strobe during which another strobe will not be possible. This
  146. is a read-only control.
  147. .. _v4l2-cid-flash-duration:
  148. ``V4L2_CID_FLASH_DURATION (integer)``
  149. Duration of the flash strobe pulse generated by the strobe source, when
  150. using external strobe. This control shall be implemented by the device
  151. generating the hardware flash strobe signal, typically a camera sensor,
  152. connected to a flash controller.
  153. The flash controllers :ref:`strobe source <v4l2-cid-flash-strobe-source>`
  154. must be configured to ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL`` for this
  155. mode of operation. For more details please also take a look at the
  156. documentation there.
  157. The unit should be microseconds (µs) if possible.
  158. .. _v4l2-cid-flash-strobe-oe:
  159. ``V4L2_CID_FLASH_STROBE_OE (boolean)``
  160. Enables the output of a hardware strobe signal from the strobe source,
  161. when using external strobe. This control shall be implemented by the device
  162. generating the hardware flash strobe signal, typically a camera sensor,
  163. connected to a flash controller.
  164. Provided the signal generating device driver supports it, the length of the
  165. strobe signal can be configured by adjusting its
  166. :ref:`flash duration <v4l2-cid-flash-duration>`.
  167. The flash controllers :ref:`strobe source <v4l2-cid-flash-strobe-source>`
  168. must be configured to ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL`` for this
  169. mode of operation. For more details please also take a look at the
  170. documentation there.