요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======================
Kernel driver w1_ds2413
=======================
Supported chips:
* Maxim DS2413 1-Wire Dual Channel Addressable Switch
supported family codes:
================ ====
W1_FAMILY_DS2413 0x3A
================ ====
Author: Mariusz Bialonczyk <[email protected]>
Description
-----------
The DS2413 chip has two open-drain outputs (PIO A and PIO B).
Support is provided through the sysfs files "output" and "state".
Reading state
-------------
The "state" file provides one-byte value which is in the same format as for
the chip PIO_ACCESS_READ command (refer the datasheet for details):
======== =============================================================
Bit 0: PIOA Pin State
Bit 1: PIOA Output Latch State
Bit 2: PIOB Pin State
Bit 3: PIOB Output Latch State
Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
======== =============================================================
This file is readonly.
Writing output
--------------
You can set the PIO pins using the "output" file.
It is writable, you can write one-byte value to this sysfs file.
Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
======== ======================================
Bit 0: PIOA
Bit 1: PIOB
Bit 2-7: No matter (driver will set it to "1"s)
======== ======================================
The chip has some kind of basic protection against transmission errors.
When reading the state, there is a four complement bits.
The driver is checking this complement, and when it is wrong then it is
returning I/O error.
When writing output, the master must repeat the PIO Output Data byte in
its inverted form and it is waiting for a confirmation.
If the write is unsuccessful for three times, the write also returns
I/O error.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
DS2413과 family code
1-17`w1_ds2413`은 Maxim DS2413 1-Wire 이중 채널 주소 지정 스위치를 지원합니다. family symbol은 `W1_FAMILY_DS2413`, 코드는 `0x3A`이며 작성자는 Mariusz Bialonczyk입니다.
커널이 사용하는 제품군 식별자입니다.
=======================
Kernel driver w1_ds2413
=======================
Supported chips:
* Maxim DS2413 1-Wire Dual Channel Addressable Switch
supported family codes:
================ ====
W1_FAMILY_DS2413 0x3A
================ ====
Author: Mariusz Bialonczyk <[email protected]>
Description
state 파일 읽기
18-37DS2413에는 오픈 드레인 출력 PIO A와 PIO B가 있으며 `output`과 `state` sysfs 파일로 제어합니다.
`state`는 읽기 전용 한 바이트 값이며 칩의 `PIO_ACCESS_READ` 명령 형식과 같습니다. 비트 0과 2는 각 핀의 실제 상태, 비트 1과 3은 각 출력 래치 상태입니다. 비트 4~7은 비트 3~0의 보수이며 커널 모듈이 이를 검증합니다.
PIO_ACCESS_READ 결과의 비트 배치입니다.
-----------
The DS2413 chip has two open-drain outputs (PIO A and PIO B).
Support is provided through the sysfs files "output" and "state".
Reading state
-------------
The "state" file provides one-byte value which is in the same format as for
the chip PIO_ACCESS_READ command (refer the datasheet for details):
======== =============================================================
Bit 0: PIOA Pin State
Bit 1: PIOA Output Latch State
Bit 2: PIOB Pin State
Bit 3: PIOB Output Latch State
Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
======== =============================================================
This file is readonly.
output 쓰기와 전송 보호
38-59`output` 파일에는 한 바이트를 쓸 수 있습니다. 형식은 `PIO_ACCESS_WRITE` 명령과 같고 비트 0은 PIO A, 비트 1은 PIO B를 설정합니다. 비트 2~7은 의미가 없으며 드라이버가 모두 1로 만듭니다.
읽기 시 네 개의 보수 비트가 맞지 않으면 드라이버는 I/O 오류를 반환합니다.
쓰기 시 마스터는 PIO 출력 데이터 바이트를 반전한 형태로 한 번 더 보내고 확인 응답을 기다립니다. 세 번 연속 실패하면 쓰기 역시 I/O 오류로 끝납니다.
PIO_ACCESS_WRITE에 전달되는 비트입니다.
원본과 반전 바이트, 확인 응답으로 전송 오류를 검출합니다.
Writing output
--------------
You can set the PIO pins using the "output" file.
It is writable, you can write one-byte value to this sysfs file.
Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
======== ======================================
Bit 0: PIOA
Bit 1: PIOB
Bit 2-7: No matter (driver will set it to "1"s)
======== ======================================
The chip has some kind of basic protection against transmission errors.
When reading the state, there is a four complement bits.
The driver is checking this complement, and when it is wrong then it is
returning I/O error.
When writing output, the master must repeat the PIO Output Data byte in
its inverted form and it is waiting for a confirmation.
If the write is unsuccessful for three times, the write also returns
I/O error.
요약·해설
w1_ds2413.rst:1-59DS2413 이중 PIO의 핀·래치 비트와 보호 쓰기 절차를 설명합니다.