日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Linux下Flash-LED的处理

發布時間:2023/11/28 生活经验 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux下Flash-LED的处理 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Linux下Flash-LED的處理
一些LED設備提供兩種模式-torch和flash。在LED子系統中,LED類(參見Linux下的LED處理)和LED Flash類,分別支持這些模式。torch模式相關的功能在默認情況下啟用,只有當驅動程序通過設置LED_DEV_CAP_flash標志來聲明時,才會啟用flash功能。
為了啟用對flash led的支持,必須在內核配置中定義flash LEDs CONFIG_LEDS_CLASS_FLASH符號。必須在具有led_classdev_flash_register功能的LED子系統中注冊LED flash類驅動程序。
以下sysfs屬性用于控制flash LED設備:
(see Documentation/ABI/testing/sysfs-class-led-flash)
? flash_brightness
? max_flash_brightness
? flash_timeout
? max_flash_timeout
? flash_strobe
? flash_fault
V4L2 flash wrapper for flash LEDs
LED子系統驅動器,可以從VideoForLinux2子系統level進行控制。為了啟用此配置,需要在內核配置中定義CONFIG_V4L2_FLASH_LED_CLASS類符號。
驅動程序必須調用v4l2_flash_init函數才能在v4l2子系統中注冊。函數有六個參數:
? dev:
flash device, e.g. an I2C device
? of_node:
of_node of the LED, may be NULL if the same as device’s
? fled_cdev:
LED flash class device to wrap
? iled_cdev:
表示與fled_cdev關聯LED flash設備可能為空NULL
? ops:
V4L2 specific ops
o external_strobe_set
定義flash LED strobe的源source - V4L2_CID_FLASH_STROBE control or external source,通常是一個傳感器,使flash strobe開始與曝光開始同步成為可能。
o intensity_to_led_brightness and led_brightness_to_intensity
perform enum led_brightness <-> V4L2 intensity conversion in a device specific manner - they can be used for devices with non-linear LED current scale.
? config:
configuration for V4L2 Flash sub-device
o dev_name
the name of the media entity, unique in the system,
o flash_faults
bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in <linux/led-class-flash.h>,
o torch_intensity
constraints for the LED in TORCH mode in microamperes,
o indicator_intensity
constraints for the indicator LED in microamperes,
o has_external_strobe
determines whether the flash strobe source can be switched to external,
在remove時,必須調用v4l2_flash_release函數,該函數接受一個參數v4l2_flash_init先前返回的- struct v4l2_flash指針。可使用NULL或error指針參數,安全地調用此函數。
請參閱drivers/leds/leds-max77693.c,了解v4l2閃存包裝器的示例性用法。
一旦創建媒體控制器設備的驅動程序,注冊了V4L2子設備,子設備節點的作用就像本機V4L2 flash API設備的節點一樣。調用被簡單地路由到LED flash API。
打開V4L2 flash子設備,使LED子系統sysfs接口不可用。關閉V4L2閃存子設備,接口將重新啟用。

總結

以上是生活随笔為你收集整理的Linux下Flash-LED的处理的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。