요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Pattern format for LED pattern trigger
The pattern is given by a series of tuples, of brightness and duration (ms).
The LED is expected to traverse the series and each brightness value for the
specified duration. Duration of 0 means brightness should immediately change to
new value, and writing malformed pattern deactivates any active one.
1. For gradual dimming, the dimming interval now is set as 50 milliseconds. So
the tuple with duration less than dimming interval (50ms) is treated as a step
change of brightness, i.e. the subsequent brightness will be applied without
adding intervening dimming intervals.
The gradual dimming format of the software pattern values should be:
"brightness_1 duration_1 brightness_2 duration_2 brightness_3 duration_3 ...".
For example (using sysfs interface):
echo 0 1000 255 2000 > pattern
It will make the LED go gradually from zero-intensity to max (255) intensity in
1000 milliseconds, then back to zero intensity in 2000 milliseconds:
LED brightness
^
255-| / \ / \ /
| / \ / \ /
| / \ / \ /
| / \ / \ /
0-| / \/ \/
+---0----1----2----3----4----5----6------------> time (s)
2. To make the LED go instantly from one brightness value to another, we should
use zero-time lengths (the brightness must be same as the previous tuple's). So
the format should be: "brightness_1 duration_1 brightness_1 0 brightness_2
duration_2 brightness_2 0 ...".
For example (using sysfs interface):
echo 0 1000 0 0 255 2000 255 0 > pattern
It will make the LED stay off for one second, then stay at max brightness for
two seconds:
LED brightness
^
255-| +---------+ +---------+
| | | | |
| | | | |
| | | | |
0-| -----+ +----+ +----
+---0----1----2----3----4----5----6------------> time (s)
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Pattern tuple 형식
1-7LED pattern trigger의 pattern은 밝기와 지속 시간(ms)의 tuple을 연속해서 기록합니다. LED는 이 순서를 따라 각 밝기 값을 지정된 시간 동안 유지하거나 다음 값으로 전이합니다. 지속 시간 0은 새 밝기로 즉시 바꾸라는 뜻이며, 형식이 잘못된 pattern을 쓰면 현재 활성 pattern이 비활성화됩니다.
50ms 간격의 점진적 dimming
8-30점진적 dimming interval은 50ms입니다. 지속 시간이 50ms보다 짧은 tuple은 중간 dimming interval을 추가하지 않고 다음 밝기를 바로 적용하는 step change로 처리합니다.
Software pattern 값은 `brightness_1 duration_1 brightness_2 duration_2 brightness_3 duration_3 ...` 형식입니다. 다음 sysfs 명령은 밝기 0에서 최대 밝기 255까지 1000ms 동안 점진적으로 올린 뒤, 2000ms 동안 다시 0으로 낮춥니다.
echo 0 1000 255 2000 > pattern
원문의 삼각 파형을 시간 구간별 밝기 전이로 구조화했습니다. 이 3초 cycle이 반복됩니다.
0ms tuple의 즉시 전환
31-49한 밝기에서 다른 밝기로 즉시 바꾸려면 시간 길이가 0인 tuple을 사용해야 하며, 0ms tuple의 밝기는 바로 앞 tuple과 같아야 합니다. 형식은 `brightness_1 duration_1 brightness_1 0 brightness_2 duration_2 brightness_2 0 ...`입니다.
다음 sysfs 명령은 LED를 1초 동안 꺼 둔 다음 최대 밝기로 즉시 바꾸어 2초 동안 유지합니다.
echo 0 1000 0 0 255 2000 255 0 > pattern
원문의 사각 파형을 유지 구간과 0ms 경계로 구조화했습니다. 이 3초 cycle이 반복됩니다.
요약과 해설
leds-trigger-pattern.txt:1-4950ms dimming interval과 0ms step tuple 규칙을 두 파형으로 설명합니다.