요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Up/down event boundary
sysfs-bus-iio-timer-stm32:93-103Up-counting은 0에서 preset까지, down-counting은 preset에서 0까지 진행한 뒤 이벤트를 발생시킵니다.
Always, gated, and triggered
sysfs-bus-iio-timer-stm32:104-129Enable mode는 항상 실행, trigger high 동안 gated 실행, 상승 에지 뒤 지속 실행을 선택하며 내부 클록으로 count합니다.
Trigger-clocked counting
sysfs-bus-iio-timer-stm32:130-143Trigger mode에서는 연결된 trigger의 상승 에지가 counter clock이 되고 방향은 count_direction 속성이 정합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/bus/iio/devices/triggerX/master_mode_available
KernelVersion: 4.11
Contact: benjamin.gaignard@st.com
Description:
Reading returns the list possible master modes which are:
- "reset"
The UG bit from the TIMx_EGR register is
used as trigger output (TRGO).
- "enable"
The Counter Enable signal CNT_EN is used
as trigger output.
- "update"
The update event is selected as trigger output.
For instance a master timer can then be used
as a prescaler for a slave timer.
- "compare_pulse"
The trigger output send a positive pulse
when the CC1IF flag is to be set.
- "OC1REF"
OC1REF signal is used as trigger output.
- "OC2REF"
OC2REF signal is used as trigger output.
- "OC3REF"
OC3REF signal is used as trigger output.
- "OC4REF"
OC4REF signal is used as trigger output.
Additional modes (on TRGO2 only):
- "OC5REF"
OC5REF signal is used as trigger output.
- "OC6REF"
OC6REF signal is used as trigger output.
- "compare_pulse_OC4REF":
OC4REF rising or falling edges generate pulses.
- "compare_pulse_OC6REF":
OC6REF rising or falling edges generate pulses.
- "compare_pulse_OC4REF_r_or_OC6REF_r":
OC4REF or OC6REF rising edges generate pulses.
- "compare_pulse_OC4REF_r_or_OC6REF_f":
OC4REF rising or OC6REF falling edges generate
pulses.
- "compare_pulse_OC5REF_r_or_OC6REF_r":
OC5REF or OC6REF rising edges generate pulses.
- "compare_pulse_OC5REF_r_or_OC6REF_f":
OC5REF rising or OC6REF falling edges generate
pulses.
::
+-----------+ +-------------+ +---------+
| Prescaler +-> | Counter | +-> | Master | TRGO(2)
+-----------+ +--+--------+-+ |-> | Control +-->
| | || +---------+
+--v--------+-+ OCxREF || +---------+
| Chx compare +----------> | Output | ChX
+-----------+-+ | | Control +-->
. | | +---------+
. | | .
+-----------v-+ OC6REF | .
| Ch6 compare +---------+>
+-------------+
Example with: "compare_pulse_OC4REF_r_or_OC6REF_r"::
X
X X
X . . X
X . . X
X . . X
count X . . . . X
. . . .
. . . .
+---------------+
OC4REF | . . |
+-+ . . +-+
. +---+ .
OC6REF . | | .
+-------+ +-------+
+-+ +-+
TRGO2 | | | |
+-+ +---+ +---------+
What: /sys/bus/iio/devices/triggerX/master_mode
KernelVersion: 4.11
Contact: benjamin.gaignard@st.com
Description:
Reading returns the current master modes.
Writing set the master mode
What: /sys/bus/iio/devices/iio:deviceX/in_count0_preset
KernelVersion: 4.12
Contact: benjamin.gaignard@st.com
Description:
Reading returns the current preset value.
Writing sets the preset value.
When counting up the counter starts from 0 and fires an
event when reach preset value.
When counting down the counter start from preset value
and fire event when reach 0.
What: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available
KernelVersion: 4.12
Contact: benjamin.gaignard@st.com
Description:
Reading returns the list possible enable modes.
What: /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode
KernelVersion: 4.12
Contact: benjamin.gaignard@st.com
Description:
Configure the device counter enable modes, in all case
counting direction is set by in_count0_count_direction
attribute and the counter is clocked by the internal clock.
always:
Counter is always ON.
gated:
Counting is enabled when connected trigger signal
level is high else counting is disabled.
triggered:
Counting is enabled on rising edge of the connected
trigger, and remains enabled for the duration of this
selected mode.
What: /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available
KernelVersion: 4.13
Contact: benjamin.gaignard@st.com
Description:
Reading returns the list possible trigger modes.
What: /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode
KernelVersion: 4.13
Contact: benjamin.gaignard@st.com
Description:
Configure the device counter trigger mode
counting direction is set by in_count0_count_direction
attribute and the counter is clocked by the connected trigger
rising edges.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
사용 가능한 timer master mode
1-85| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/triggerX/master_mode_available |
| KernelVersion | 4.11 |
| Contact | benjamin.gaignard@st.com |
| Description | 읽으면 사용할 수 있는 master mode 목록을 반환합니다. |
| 기본 모드 | TRGO 동작 |
|---|---|
| reset | TIMx_EGR 레지스터의 UG bit를 trigger output(TRGO)으로 사용합니다. |
| enable | Counter Enable 신호 CNT_EN을 trigger output으로 사용합니다. |
| update | update event를 trigger output으로 선택합니다. 예를 들어 master timer를 slave timer의 prescaler로 사용할 수 있습니다. |
| compare_pulse | CC1IF flag가 설정될 때 trigger output이 양의 pulse를 보냅니다. |
| OC1REF | OC1REF 신호를 trigger output으로 사용합니다. |
| OC2REF | OC2REF 신호를 trigger output으로 사용합니다. |
| OC3REF | OC3REF 신호를 trigger output으로 사용합니다. |
| OC4REF | OC4REF 신호를 trigger output으로 사용합니다. |
| TRGO2 전용 추가 모드 | 동작 |
|---|---|
| OC5REF | OC5REF 신호를 trigger output으로 사용합니다. |
| OC6REF | OC6REF 신호를 trigger output으로 사용합니다. |
| compare_pulse_OC4REF | OC4REF의 상승 또는 하강 에지가 pulse를 생성합니다. |
| compare_pulse_OC6REF | OC6REF의 상승 또는 하강 에지가 pulse를 생성합니다. |
| compare_pulse_OC4REF_r_or_OC6REF_r | OC4REF 또는 OC6REF의 상승 에지가 pulse를 생성합니다. |
| compare_pulse_OC4REF_r_or_OC6REF_f | OC4REF 상승 에지 또는 OC6REF 하강 에지가 pulse를 생성합니다. |
| compare_pulse_OC5REF_r_or_OC6REF_r | OC5REF 또는 OC6REF의 상승 에지가 pulse를 생성합니다. |
| compare_pulse_OC5REF_r_or_OC6REF_f | OC5REF 상승 에지 또는 OC6REF 하강 에지가 pulse를 생성합니다. |
Prescaler가 Counter를 구동하고 각 compare 채널이 OCxREF를 만듭니다. OCxREF는 Master Control을 거쳐 TRGO/TRGO2가 되거나 Output Control을 거쳐 채널 출력 ChX가 됩니다.
예제 모드에서는 OC4REF와 OC6REF 각각의 상승 에지가 TRGO2에 양의 pulse를 하나씩 생성합니다.
현재 timer master mode
86-92| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/triggerX/master_mode |
| KernelVersion | 4.11 |
| Contact | benjamin.gaignard@st.com |
| Description | 읽으면 현재 master mode를 반환합니다. 쓰면 master mode를 설정합니다. |
Counter preset과 이벤트 시점
93-103| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/iio:deviceX/in_count0_preset |
| KernelVersion | 4.12 |
| Contact | benjamin.gaignard@st.com |
| Description | 읽으면 현재 preset 값을 반환하고 쓰면 preset 값을 설정합니다. Up-counting에서는 counter가 0에서 시작해 preset 값에 도달할 때 이벤트를 발생시킵니다. Down-counting에서는 preset 값에서 시작해 0에 도달할 때 이벤트를 발생시킵니다. |
사용 가능한 counter enable mode
104-109| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available |
| KernelVersion | 4.12 |
| Contact | benjamin.gaignard@st.com |
| Description | 읽으면 사용할 수 있는 enable mode 목록을 반환합니다. |
Counter enable mode 설정
110-129| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode |
| KernelVersion | 4.12 |
| Contact | benjamin.gaignard@st.com |
| Description | 장치 counter의 enable mode를 구성합니다. 모든 경우 counting 방향은 in_count0_count_direction 속성으로 설정하며 counter는 내부 클록으로 구동됩니다. |
| 모드 | 동작 |
|---|---|
| always | Counter가 항상 ON입니다. |
| gated | 연결한 trigger 신호 레벨이 high일 때 counting을 활성화하고, 그 외에는 비활성화합니다. |
| triggered | 연결한 trigger의 상승 에지에서 counting을 활성화하고 이 모드를 선택한 동안 계속 활성 상태를 유지합니다. |
사용 가능한 counter trigger mode
130-135| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available |
| KernelVersion | 4.13 |
| Contact | benjamin.gaignard@st.com |
| Description | 읽으면 사용할 수 있는 trigger mode 목록을 반환합니다. |
Counter trigger mode 설정
136-143| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode |
| KernelVersion | 4.13 |
| Contact | benjamin.gaignard@st.com |
| Description | 장치 counter의 trigger mode를 구성합니다. Counting 방향은 in_count0_count_direction 속성으로 설정하며, counter는 연결된 trigger의 상승 에지로 클록됩니다. |
TRGO and TRGO2 selection
sysfs-bus-iio-timer-stm32:1-92Master mode는 reset·enable·update·compare pulse·OCxREF 중 하나를 TRGO로 선택합니다. TRGO2는 OC4REF..OC6REF 에지 조합까지 지원하며 현재 모드는 master_mode에서 읽고 씁니다.