요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
2. 영어 원문 전체
번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.
원문 전체 펼치기
Crane Merchandising System - cr0014114 LED driver
-------------------------------------------------
This LED Board is widely used in vending machines produced
by Crane Merchandising Systems.
Required properties:
- compatible: "crane,cr0014114"
Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt
apply. In particular, "reg" and "spi-max-frequency" properties must be given.
LED sub-node properties:
- function :
see Documentation/devicetree/bindings/leds/common.txt
- color :
see Documentation/devicetree/bindings/leds/common.txt
- label :
see Documentation/devicetree/bindings/leds/common.txt (deprecated)
- linux,default-trigger : (optional)
see Documentation/devicetree/bindings/leds/common.txt
Example
-------
#include <dt-bindings/leds/common.h>
led-controller@0 {
compatible = "crane,cr0014114";
reg = <0>;
spi-max-frequency = <50000>;
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
function = "coin";
color = <LED_COLOR_ID_RED>;
};
led@1 {
reg = <1>;
function = "coin";
color = <LED_COLOR_ID_GREEN>;
};
led@2 {
reg = <2>;
function = "coin";
color = <LED_COLOR_ID_BLUE>;
};
led@3 {
reg = <3>;
function = "bill";
color = <LED_COLOR_ID_RED>;
};
led@4 {
reg = <4>;
function = "bill";
color = <LED_COLOR_ID_GREEN>;
};
led@5 {
reg = <5>;
function = "bill";
color = <LED_COLOR_ID_BLUE>;
};
...
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.
CR0014114 LED board 속성
1-22Crane Merchandising Systems의 CR0014114 LED board는 자판기에 널리 사용됩니다. 필수 `compatible`은 `crane,cr0014114`입니다. `Documentation/devicetree/bindings/spi/spi-bus.txt`의 규칙을 적용하므로 특히 `reg`와 `spi-max-frequency`를 반드시 지정해야 합니다.
LED 하위 node의 `function`과 `color`는 공통 LED 바인딩을 따릅니다. `label`도 같은 바인딩을 따르지만 deprecated입니다. 선택 `linux,default-trigger` 역시 공통 LED 바인딩에서 정의합니다.
SPI controller 아래의 channel별 하위 node가 동전 및 지폐 표시 RGB 출력을 구성합니다.
Coin과 bill RGB 예제
23-66예제는 최대 SPI frequency 50000으로 controller를 구성합니다. Channel 0~2는 `coin` function의 red, green, blue이고 channel 3~5는 `bill` function의 red, green, blue입니다. 색상은 `dt-bindings/leds/common.h`의 `LED_COLOR_ID_*` 상수를 사용합니다.
#include <dt-bindings/leds/common.h>
led-controller@0 {
compatible = "crane,cr0014114";
reg = <0>;
spi-max-frequency = <50000>;
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
function = "coin";
color = <LED_COLOR_ID_RED>;
};
led@1 {
reg = <1>;
function = "coin";
color = <LED_COLOR_ID_GREEN>;
};
led@2 {
reg = <2>;
function = "coin";
color = <LED_COLOR_ID_BLUE>;
};
led@3 {
reg = <3>;
function = "bill";
color = <LED_COLOR_ID_RED>;
};
led@4 {
reg = <4>;
function = "bill";
color = <LED_COLOR_ID_GREEN>;
};
led@5 {
reg = <5>;
function = "bill";
color = <LED_COLOR_ID_BLUE>;
};
...
};
요약과 해설
leds-cr0014114.txt:1-66Coin과 bill RGB channel 배치를 설명합니다.