요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======================
w1_ds2406 kernel driver
=======================
Supported chips:
* Maxim DS2406 (and other family 0x12) addressable switches
Author: Scott Alfter <scott@alfter.us>
Description
-----------
The w1_ds2406 driver allows connected devices to be switched on and off.
These chips also provide 128 bytes of OTP EPROM, but reading/writing it is
not supported. In TSOC-6 form, the DS2406 provides two switch outputs and
can be provided with power on a dedicated input. In TO-92 form, it provides
one output and uses parasitic power only.
The driver provides two sysfs files. state is readable; it gives the
current state of each switch, with PIO A in bit 0 and PIO B in bit 1. The
driver ORs this state with 0x30, so shell scripts get an ASCII 0/1/2/3 to
work with. output is writable; bits 0 and 1 control PIO A and B,
respectively. Bits 2-7 are ignored, so it's safe to write ASCII data.
CRCs are checked on read and write. Failed checks cause an I/O error to be
returned. On a failed write, the switch status is not changed.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
지원 칩과 작성자
1-10`w1_ds2406` 드라이버는 Maxim DS2406과 family code `0x12`의 다른 주소 지정 스위치를 지원합니다. 문서 작성자는 Scott Alfter입니다.
드라이버가 인식하는 제품군입니다.
=======================
w1_ds2406 kernel driver
=======================
Supported chips:
* Maxim DS2406 (and other family 0x12) addressable switches
Author: Scott Alfter <scott@alfter.us>
출력 형식과 오류 처리
11-27드라이버는 연결된 장치를 켜고 끌 수 있게 합니다. 칩에는 128바이트 OTP EPROM도 있지만 이 드라이버는 EPROM 읽기와 쓰기를 지원하지 않습니다.
TSOC-6 패키지는 두 스위치 출력과 별도 전원 입력을 제공하고, TO-92 패키지는 한 출력만 제공하며 기생 전원만 사용합니다.
sysfs의 `state`는 읽기 전용입니다. PIO A 상태가 비트 0, PIO B 상태가 비트 1에 들어가며, 드라이버는 상태값에 `0x30`을 OR하여 셸 스크립트가 ASCII `0`, `1`, `2`, `3`으로 읽을 수 있게 합니다.
`output`은 쓰기 가능하며 비트 0과 1이 각각 PIO A와 PIO B를 제어합니다. 비트 2~7은 무시되므로 ASCII 데이터를 써도 안전합니다.
읽기와 쓰기 모두 CRC를 확인합니다. 검사가 실패하면 I/O 오류를 반환하고, 쓰기 실패 시 스위치 상태는 바뀌지 않습니다.
노출되는 두 파일과 비트 의미입니다.
출력 변경은 CRC 확인 뒤에만 확정됩니다.
Description
-----------
The w1_ds2406 driver allows connected devices to be switched on and off.
These chips also provide 128 bytes of OTP EPROM, but reading/writing it is
not supported. In TSOC-6 form, the DS2406 provides two switch outputs and
can be provided with power on a dedicated input. In TO-92 form, it provides
one output and uses parasitic power only.
The driver provides two sysfs files. state is readable; it gives the
current state of each switch, with PIO A in bit 0 and PIO B in bit 1. The
driver ORs this state with 0x30, so shell scripts get an ASCII 0/1/2/3 to
work with. output is writable; bits 0 and 1 control PIO A and B,
respectively. Bits 2-7 are ignored, so it's safe to write ASCII data.
CRCs are checked on read and write. Failed checks cause an I/O error to be
returned. On a failed write, the switch status is not changed.
요약·해설
w1_ds2406.rst:1-27DS2406 출력 스위치, ASCII 상태 표현, CRC 오류 처리를 설명합니다.