Part 1
요약·해설
DTS compatible, child node와 pwms phandle 요구 사항을 보존합니다.
pwm-leds
6단계
LED API
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
7A405334881C784BD1924BFCEBC75EB218F654747BE86DF9BD324B1ACEE1A3EA
.. zephyr:code-sample:: led-pwm
:name: LED PWM
:relevant-api: led_interface
Control PWM LEDs using the LED API.
Overview
********
This sample allows to test the led-pwm driver. The first "pwm-leds" compatible
device instance found in DT is used. For each LEDs attached to this device
(child nodes) the same test pattern (described below) is executed. The LED API
functions are used to control the LEDs.
Test pattern
============
For each PWM LEDs (one after the other):
- Turning on
- Turning off
- Increasing brightness gradually
- Blinking on: 0.1 sec, off: 0.1 sec
- Blinking on: 1 sec, off: 1 sec
- Turning off
Building and Running
********************
This sample can be built and executed on all the boards with PWM LEDs connected.
The LEDs must be correctly described in the DTS: the compatible property of the
device node must match "pwm-leds". And for each LED, a child node must be
defined and the PWM configuration must be provided through a "pwms" phandle's
node.
Part 3
한국어 전문 번역
개요
이 sample은 led-pwm driver를 시험합니다. Devicetree에서 처음 발견된 pwm-leds compatible device instance를 사용합니다. 이 device에 연결된 각 LED, 즉 child node마다 아래와 같은 시험 pattern을 실행하며 LED API 함수로 LED를 제어합니다.
시험 pattern
각 PWM LED에 차례대로 다음 동작을 수행합니다.
- 켭니다.
- 끕니다.
- 밝기를 서서히 높입니다.
- 0.1초 켜고 0.1초 끄는 blink를 수행합니다.
- 1초 켜고 1초 끄는 blink를 수행합니다.
- 끕니다.
Build와 실행
PWM LED가 연결된 모든 board에서 이 sample을 build하고 실행할 수 있습니다. LED는 DTS에 올바르게 기술해야 합니다. Device node의 compatible property는 pwm-leds와 일치해야 하며, 각 LED마다 child node를 정의하고 pwms phandle의 node를 통해 PWM 설정을 제공해야 합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.