[RK3288][Android6.0] Documentation/leds/leds-lp5523.txt

Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92

Kernel driver for lp5523

Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo
Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com)

Description

LP5523 can drive up to 9 channels. Leds can be controlled directly via
the led class control interface.
The name of each channel is configurable in the platform data - name and label.
There are three options to make the channel name.

LP5523可以驱动最大到9通道。Leds可以直接通过Linux的led class接口来控制。
每个通道的名字可以通过platform data中的name和label来定义,有三种方法可以定义名字。

a) Define the ‘name’ in the platform data
To make specific channel name, then use ‘name’ platform data.
/sys/class/leds/R1 (name: ‘R1’)
/sys/class/leds/B1 (name: ‘B1’)

a) 在platform data中定义"name"
会看到如下形式名字:
/sys/class/leds/R1 (name: 'R1')
/sys/class/leds/B1 (name: 'B1')

b) Use the ‘label’ with no ‘name’ field
For one device name with channel number, then use ‘label’.
/sys/class/leds/RGB:channelN (label: ‘RGB’, N: 0 ~ 8)

b) 在没有"name"域的情况下使用"label"
对于一个device下面有多个channel的情况下,会看到如下形式:
/sys/class/leds/RGB:channelN (label: 'RGB', N: 0 ~ 8)

c) Default
If both fields are NULL, ‘lp5523’ is used by default.
/sys/class/leds/lp5523:channelN (N: 0 ~ 8)

c) 默认上面两种都没有定义的情况时,默认就使用名字"lp5523"

LP5523 has the internal program memory for running various LED patterns.
For the details, please refer to ‘firmware’ section in leds-lp55xx.txt

LP5523内部有一块memory可以用来运行不同的LED pattern。
详细内容可以参考leds-lp55xx.txt的"firmware"章节。

Selftest uses always the current from the platform data.
platform data中的电流值用于做自检测试。

Each channel contains led current settings.
/sys/class/leds/lp5523:channel2/led_current - RW
/sys/class/leds/lp5523:channel2/max_current - RO
Format: 10x mA i.e 10 means 1.0 mA

每个channel包含各自的电流设置,当前电流可读写,最大电流只读,操作路径如下。
/sys/class/leds/lp5523:channel2/led_current - RW
/sys/class/leds/lp5523:channel2/max_current - RO
文件的格式是以10倍于电流数为单位的,比如设置为10,那么实际值是1mA.

如下是对lp5523的配置格式,如果是dts形式,则不适合。
注意: 函数结构填充要加返回值,否则就会注册Leds driver失败。

Example platform data:

Note - chan_nr can have values between 0 and 8.

static struct lp55xx_led_config lp5523_led_config[] = {
{
.name = “D1”,
.chan_nr = 0,
.led_current = 50,
.max_current = 130,
},

{
.chan_nr = 8,
.led_current = 50,
.max_current = 130,
}
};

static int lp5523_setup(void)
{
/* Setup HW resources */
}

static void lp5523_release(void)
{
/* Release HW resources */
}

static void lp5523_enable(bool state)
{
/* Control chip enable signal */
}

static struct lp55xx_platform_data lp5523_platform_data = {
.led_config = lp5523_led_config,
.num_channels = ARRAY_SIZE(lp5523_led_config),
.clock_mode = LP55XX_CLOCK_EXT,
.setup_resources = lp5523_setup,
.release_resources = lp5523_release,
.enable = lp5523_enable,
};

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将QT += core QT -= gui CONFIG += c++11 TARGET = UavRectifyLoadLIb CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS win32{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../../RasterManager/bin/Debug } else{ DESTDIR = $$PWD/../../../../RasterManager/bin/release } INCLUDEPATH += $$PWD/../../../include/gdal1101 DEPENDPATH += $$PWD/../../../include/gdal1101 } else{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../product/release32 } else{ DESTDIR = $$PWD/../../../product/release32 } } # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lUAVAutoRectifyMt -lUAVAutoRectify -lUAVAutoRectifyFi INCLUDEPATH += $$PWD/../include DEPENDPATH += $$PWD/../include unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_core unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_imgproc INCLUDEPATH += $$PWD/../../../lib/opencvf249 DEPENDPATH += $$PWD/../../../lib/opencvf249 unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_core #unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgproc unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_features2d unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgcodecs INCLUDEPATH += $$PWD/../../../../../../../usr/local/include DEPENDPATH += $$PWD/../../../../../../../usr/local/include unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lDEMDriver unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lProjection unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lIImage_gC QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 转为cmake格式
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值