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

Linux 6.18.37 · 1-Wire / Slave

Kernel driver w1_ds28e17

DS28E17 1-Wire-to-I2C 브리지의 동적 버스, 속도와 stretch 설정을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

w1_ds28e17.rst:1-72

DS28E17 1-Wire-to-I2C 브리지의 동적 버스, 속도와 stretch 설정을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ========================
2 Kernel driver w1_ds28e17
3 ========================
4
5 Supported chips:
6
7 * Maxim DS28E17 1-Wire-to-I2C Master Bridge
8
9 supported family codes:
10
11 ================= ====
12 W1_FAMILY_DS28E17 0x19
13 ================= ====
14
15 Author: Jan Kandziora <jjj@gmx.de>
16
17
18 Description
19 -----------
20 The DS28E17 is a Onewire slave device which acts as an I2C bus master.
21
22 This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
23 come and go as the DS28E17 devices come and go. I2C slave devices connected to
24 a DS28E17 can be accessed by the kernel or userspace tools as if they were
25 connected to a "native" I2C bus master.
26
27
28 An udev rule like the following::
29
30 SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
31 SYMLINK+="i2c-$attr{name}"
32
33 may be used to create stable /dev/i2c- entries based on the unique id of the
34 DS28E17 chip.
35
36
37 Driver parameters are:
38
39 speed:
40 This sets up the default I2C speed a DS28E17 get configured for as soon
41 it is connected. The power-on default of the DS28E17 is 400kBaud, but
42 chips may come and go on the Onewire bus without being de-powered and
43 as soon the "w1_ds28e17" driver notices a freshly connected, or
44 reconnected DS28E17 device on the Onewire bus, it will re-apply this
45 setting.
46
47 Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
48 alone the current DS28E17 setting on detect. The default value is 100.
49
50 stretch:
51 This sets up the default stretch value used for freshly connected
52 DS28E17 devices. It is a multiplier used on the calculation of the busy
53 wait time for an I2C transfer. This is to account for I2C slave devices
54 which make heavy use of the I2C clock stretching feature and thus, the
55 needed timeout cannot be pre-calculated correctly. As the w1_ds28e17
56 driver checks the DS28E17's busy flag in a loop after the precalculated
57 wait time, it should be hardly needed to tweak this setting.
58
59 Leave it at 1 unless you get ETIMEDOUT errors and a "w1_slave_driver
60 19-00000002dbd8: busy timeout" in the kernel log.
61
62 Valid values are 1 to 9. The default is 1.
63
64
65 The driver creates sysfs files /sys/bus/w1/devices/19-<id>/speed and
66 /sys/bus/w1/devices/19-<id>/stretch for each device, preloaded with the default
67 settings from the driver parameters. They may be changed anytime. In addition a
68 directory /sys/bus/w1/devices/19-<id>/i2c-<nnn> for the I2C bus master sysfs
69 structure is created.
70
71
72 See https://github.com/ianka/w1_ds28e17 for even more information.
73

3. 한국어 전문 번역

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

1-Wire-to-I2C 브리지

1-25

`w1_ds28e17`은 Maxim DS28E17 1-Wire-to-I2C Master Bridge를 지원합니다. family symbol은 `W1_FAMILY_DS28E17`, 코드는 `0x19`이며 작성자는 Jan Kandziora입니다.

DS28E17은 1-Wire 슬레이브로 동작하면서 I2C 버스의 마스터가 됩니다. 드라이버는 감지한 DS28E17마다 새 I2C 버스를 만들고 장치 연결·분리에 따라 버스도 생성·제거합니다.

DS28E17에 연결된 I2C 슬레이브는 네이티브 I2C 마스터에 연결된 것처럼 커널이나 사용자 공간 도구에서 접근할 수 있습니다.

DS28E17 브리지 계층
측면DS28E17 역할노출 결과
1-Wire슬레이브family 0x19 장치
I2C마스터동적 i2c-N 버스
I2C 하위 장치브리지 뒤 슬레이브일반 I2C 장치처럼 접근

두 버스에서 장치가 맡는 역할입니다.

========================
Kernel driver w1_ds28e17
========================

Supported chips:

  * Maxim DS28E17 1-Wire-to-I2C Master Bridge

supported family codes:

        =================  ====
        W1_FAMILY_DS28E17  0x19
        =================  ====

Author: Jan Kandziora <jjj@gmx.de>


Description
-----------
The DS28E17 is a Onewire slave device which acts as an I2C bus master.

This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
come and go as the DS28E17 devices come and go. I2C slave devices connected to
a DS28E17 can be accessed by the kernel or userspace tools as if they were
connected to a "native" I2C bus master.

고유 ID 기반 장치 이름

26-36

문서의 udev 규칙은 `i2c-dev` 하위 시스템에서 이름이 `w1-19-*`인 I2C 버스를 찾아 DS28E17의 고유 ID에 기반한 안정적인 `/dev/i2c-` 심볼릭 링크를 만듭니다.

규칙의 줄 연속과 `$attr{name}` 표현은 원문 코드 블록에 그대로 보존되어 있습니다.

DS28E17 udev 링크
i2c-dev 장치 생성KERNEL i2c-[0-9]* 일치ATTRS{name} w1-19-* 확인i2c-$attr{name} 심볼릭 링크 생성

동적 버스 번호 대신 칩 고유 ID를 사용합니다.



An udev rule like the following::

  SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
          SYMLINK+="i2c-$attr{name}"

may be used to create stable /dev/i2c- entries based on the unique id of the
DS28E17 chip.

speed와 stretch 매개변수

37-61

`speed`는 DS28E17이 연결되는 즉시 적용할 기본 I2C 속도를 정합니다. 전원 투입 기본값은 400 kBaud지만, 1-Wire 버스에서 전원이 끊기지 않은 채 사라졌다 다시 나타날 수 있으므로 드라이버는 새 연결이나 재연결을 감지할 때 설정을 다시 적용합니다.

유효한 속도는 100, 400, 900 kBaud입니다. 다른 값은 감지 시 현재 DS28E17 설정을 그대로 두라는 뜻이며 드라이버 기본값은 100입니다.

`stretch`는 새 장치의 기본 clock-stretch 보정값입니다. I2C 전송 busy 대기 시간을 계산할 때 사용하는 배수로, clock stretching을 많이 쓰는 슬레이브 때문에 timeout을 미리 정확히 계산하기 어려운 경우를 보완합니다.

드라이버가 사전 계산 대기 뒤에도 DS28E17 busy flag를 반복 검사하므로 보통 조정할 필요가 없습니다. `ETIMEDOUT`과 `busy timeout` 커널 로그가 함께 나타날 때만 변경하며 유효 범위는 1~9, 기본값은 1입니다.

DS28E17 매개변수
매개변수유효값기본값의미
speed100, 400, 900 kBaud100I2C 버스 속도
speed 기타 값그 외-현재 칩 설정 유지
stretch1~91busy 대기 시간 배수

연결 시 적용되는 기본값과 유효 범위입니다.

Driver parameters are:

speed:
        This sets up the default I2C speed a DS28E17 get configured for as soon
        it is connected. The power-on default        of the DS28E17 is 400kBaud, but
        chips may come and go on the Onewire bus without being de-powered and
        as soon the "w1_ds28e17" driver notices a freshly connected, or
        reconnected DS28E17 device on the Onewire bus, it will re-apply this
        setting.

        Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
        alone the current DS28E17 setting on detect. The default value is 100.

stretch:
        This sets up the default stretch value used for freshly connected
        DS28E17 devices. It is a multiplier used on the calculation of the busy
        wait time for an I2C transfer. This is to account for I2C slave devices
        which make heavy use of the I2C clock stretching feature and thus, the
        needed timeout cannot be pre-calculated correctly. As the w1_ds28e17
        driver checks the DS28E17's busy flag in a loop after the precalculated
        wait time, it should be hardly needed to tweak this setting.

        Leave it at 1 unless you get ETIMEDOUT errors and a "w1_slave_driver
        19-00000002dbd8: busy timeout" in the kernel log.

장치별 sysfs와 참고 자료

62-72

드라이버는 장치마다 `/sys/bus/w1/devices/19-<id>/speed`와 `stretch`를 만들고 모듈 매개변수의 기본값으로 채웁니다. 두 값은 언제든 변경할 수 있습니다.

같은 위치에 I2C 마스터 sysfs 구조를 위한 `i2c-<nnn>` 디렉터리도 생성합니다. 문서 끝의 GitHub URL은 추가 정보를 제공하는 외부 참고 자료입니다.

DS28E17 장치별 sysfs
경로역할
19-<id>/speed장치별 I2C 속도
19-<id>/stretch장치별 stretch 배수
19-<id>/i2c-<nnn>I2C 마스터 구조

family 0x19 장치 아래 생성되는 항목입니다.

        Valid values are 1 to 9. The default is 1.


The driver creates sysfs files /sys/bus/w1/devices/19-<id>/speed and
/sys/bus/w1/devices/19-<id>/stretch for each device, preloaded with the default
settings from the driver parameters. They may be changed anytime. In addition a
directory /sys/bus/w1/devices/19-<id>/i2c-<nnn> for the I2C bus master sysfs
structure is created.


See https://github.com/ianka/w1_ds28e17 for even more information.