← Documents Documentation/w1/slaves/w1_ds2413.rst GitHub 원문 ↗

Linux 6.18.37 · 1-Wire / Slave

Kernel driver w1_ds2413

DS2413 이중 PIO의 핀·래치 비트와 보호 쓰기 절차를 설명합니다.

Source pathDocumentation/w1/slaves/w1_ds2413.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

w1_ds2413.rst:1-59

DS2413 이중 PIO의 핀·래치 비트와 보호 쓰기 절차를 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 =======================
2 Kernel driver w1_ds2413
3 =======================
4
5 Supported chips:
6
7 * Maxim DS2413 1-Wire Dual Channel Addressable Switch
8
9 supported family codes:
10
11 ================ ====
12 W1_FAMILY_DS2413 0x3A
13 ================ ====
14
15 Author: Mariusz Bialonczyk <[email protected]>
16
17 Description
18 -----------
19
20 The DS2413 chip has two open-drain outputs (PIO A and PIO B).
21 Support is provided through the sysfs files "output" and "state".
22
23 Reading state
24 -------------
25 The "state" file provides one-byte value which is in the same format as for
26 the chip PIO_ACCESS_READ command (refer the datasheet for details):
27
28 ======== =============================================================
29 Bit 0: PIOA Pin State
30 Bit 1: PIOA Output Latch State
31 Bit 2: PIOB Pin State
32 Bit 3: PIOB Output Latch State
33 Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
34 ======== =============================================================
35
36 This file is readonly.
37
38 Writing output
39 --------------
40 You can set the PIO pins using the "output" file.
41 It is writable, you can write one-byte value to this sysfs file.
42 Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
43
44 ======== ======================================
45 Bit 0: PIOA
46 Bit 1: PIOB
47 Bit 2-7: No matter (driver will set it to "1"s)
48 ======== ======================================
49
50
51 The chip has some kind of basic protection against transmission errors.
52 When reading the state, there is a four complement bits.
53 The driver is checking this complement, and when it is wrong then it is
54 returning I/O error.
55
56 When writing output, the master must repeat the PIO Output Data byte in
57 its inverted form and it is waiting for a confirmation.
58 If the write is unsuccessful for three times, the write also returns
59 I/O error.
60

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

DS2413과 family code

1-17

`w1_ds2413`은 Maxim DS2413 1-Wire 이중 채널 주소 지정 스위치를 지원합니다. family symbol은 `W1_FAMILY_DS2413`, 코드는 `0x3A`이며 작성자는 Mariusz Bialonczyk입니다.

DS2413 식별 정보
항목
Maxim DS2413
채널PIO A, PIO B
Family symbolW1_FAMILY_DS2413
Family code0x3A

커널이 사용하는 제품군 식별자입니다.

=======================
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-37

DS2413에는 오픈 드레인 출력 PIO A와 PIO B가 있으며 `output`과 `state` sysfs 파일로 제어합니다.

`state`는 읽기 전용 한 바이트 값이며 칩의 `PIO_ACCESS_READ` 명령 형식과 같습니다. 비트 0과 2는 각 핀의 실제 상태, 비트 1과 3은 각 출력 래치 상태입니다. 비트 4~7은 비트 3~0의 보수이며 커널 모듈이 이를 검증합니다.

DS2413 state 바이트
비트의미
0PIO A 핀 상태
1PIO A 출력 래치 상태
2PIO B 핀 상태
3PIO B 출력 래치 상태
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 오류로 끝납니다.

DS2413 output 바이트
비트의미
0PIO A 출력
1PIO B 출력
2~7드라이버가 1로 설정

PIO_ACCESS_WRITE에 전달되는 비트입니다.

DS2413 보호 쓰기
PIO 출력 데이터 전송데이터의 반전 바이트 전송칩 확인 응답 대기실패하면 최대 세 번 재시도계속 실패하면 I/O 오류 반환

원본과 반전 바이트, 확인 응답으로 전송 오류를 검출합니다.

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.