Part 1
요약·해설
지원 chip, system call, LP5030 overlay와 주소 0x30을 보존합니다.
최대 12
8
LP5030
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
7F287ABA8EDB99BF7859DE707AD0E62C1F3DDC09000D01AA4733F1D30FEBD42B
.. zephyr:code-sample:: lp50xx
:name: LP50XX RGB LED
:relevant-api: led_interface
Control up to 12 RGB LEDs connected to an LP50xx driver chip.
Overview
********
This sample controls up to 12 LEDs connected to a LP50xx driver.
First, for each LED information is retrieved using the led_get_info syscall
and printed in the log messages. Next, from an infinite loop, a test pattern
(described below) is applied to all the LEDs simultaneously (using the
:c:func:`led_write_channels` syscall) and then to each LED one by one (using the
:c:func:`led_set_brightness` and :c:func:`led_set_color` syscalls).
Test pattern
============
For all the LEDs first (using channel API) and then for each LED one by one:
For each color in red green blue white yellow purple cyan orange:
- set the color
- turn on
- turn off
- set the brightness gradually to the maximum level
- turn off
Building and Running
********************
This sample can be built and executed on boards with an I2C LP5009, LP5012,
LP5018, LP5024, LP5030 or LP5036 LED driver connected. A node matching the
the device type binding should be defined in the board DTS files.
As an example this sample provides a DTS overlay for the :ref:`lpcxpresso11u68`
board (:file:`boards/lpcxpresso11u68.overlay`). It assumes that a I2C LP5030
LED driver (with 10 LEDs wired) is connected to the I2C0 bus at address 0x30.
References
**********
- LP5009/LP5012: https://www.ti.com/lit/ds/symlink/lp5012.pdf
- LP5018/LP5024: https://www.ti.com/lit/ds/symlink/lp5024.pdf
- LP5030/LP5036: https://www.ti.com/lit/ds/symlink/lp5036.pdf
Part 3
한국어 전문 번역
개요
이 sample은 LP50xx driver에 연결된 LED를 최대 12개까지 제어합니다.
먼저 led_get_info system call로 각 LED 정보를 가져와 log message에 출력합니다. 다음으로 무한 loop에서 아래 시험 pattern을 led_write_channels system call로 모든 LED에 동시에 적용하고, 이어서 led_set_brightness와 led_set_color system call로 LED마다 하나씩 적용합니다.
시험 pattern
먼저 channel API로 모든 LED에 적용한 뒤, 각 LED에 하나씩 다음 동작을 수행합니다.
빨강, 초록, 파랑, 흰색, 노랑, 보라, 청록, 주황의 각 색상에 대해 다음 순서를 반복합니다.
- 색상을 설정합니다.
- LED를 켭니다.
- LED를 끕니다.
- 밝기를 최대 수준까지 서서히 높입니다.
- LED를 끕니다.
Build와 실행
I2C LP5009, LP5012, LP5018, LP5024, LP5030 또는 LP5036 LED driver가 연결된 board에서 이 sample을 build하고 실행할 수 있습니다. 해당 device type binding과 일치하는 node를 board DTS file에 정의해야 합니다.
예제로 이 sample은 lpcxpresso11u68 board용 DTS overlay인 boards/lpcxpresso11u68.overlay를 제공합니다. 이 overlay는 LED 10개가 배선된 I2C LP5030 LED driver가 주소 0x30으로 I2C0 bus에 연결되어 있다고 가정합니다.
참고 자료
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.