• 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

    • external_strobe_set

    定义flash LED strobe的源source - V4L2_CID_FLASH_STROBE control or external source,通常是一个传感器,使flash strobe开始与曝光开始同步成为可能。

    • 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

    • dev_name

    the name of the media entity, unique in the system,

    • 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>,

    • torch_intensity

    constraints for the LED in TORCH mode in microamperes,

    • indicator_intensity

    constraints for the indicator LED in microamperes,

    • 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闪存子设备,接口将重新启用。

    人工智能芯片与自动驾驶
  • 相关阅读:
    Jquery超简单遮罩层实现代码
    java中Token验证
    基于Token的WEB后台认证机制
    jsp页面数据回显(select下拉选择框)
    ckeditor 绑定事件
    ckeditor 触发事件(案例)
    Linux sed命令学习
    字符串 全排列生成问题
    算法导论第九章 第K顺序统计量
    字符串相似度算法 递归与动态规划求解分析
  • 原文地址:https://www.cnblogs.com/wujianming-110117/p/14311400.html
Copyright © 2020-2023  润新知