요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Kernel driver w1_ds2438
=======================
Supported chips:
* Maxim DS2438 Smart Battery Monitor
supported family codes:
================ ====
W1_FAMILY_DS2438 0x26
================ ====
Author: Mariusz Bialonczyk <manio@skyboo.net>
Description
-----------
The DS2438 chip provides several functions that are desirable to carry in
a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
Because the ability of temperature, current and voltage measurement, the chip
is also often used in weather stations and applications such as: rain gauge,
wind speed/direction measuring, humidity sensing, etc.
Current support is provided through the following sysfs files (all files
except "iad" and "offset" are readonly):
"iad"
-----
This file controls the 'Current A/D Control Bit' (IAD) in the
Status/Configuration Register.
Writing a zero value will clear the IAD bit and disables the current
measurements.
Writing value "1" is setting the IAD bit (enables the measurements).
The IAD bit is enabled by default in the DS2438.
When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
An I/O error is returned when there is a problem setting the new value.
"page0"
-------
This file provides full 8 bytes of the chip Page 0 (00h).
This page contains the most frequently accessed information of the DS2438.
Internally when this file is read, the additional CRC byte is also obtained
from the slave device. If it is correct, the 8 bytes page data are passed
to userspace, otherwise an I/O error is returned.
"page1"
-------
This file provides full 8 bytes of the chip Page 1 (01h).
This page contains the ICA, elapsed time meter and current offset data of the DS2438.
Internally when this file is read, the additional CRC byte is also obtained
from the slave device. If it is correct, the 8 bytes page data are passed
to userspace, otherwise an I/O error is returned.
"offset"
--------
This file controls the 2-byte Offset Register of the chip.
Writing a 2-byte value will change the Offset Register, which changes the
current measurement done by the chip. Changing this register to the two's complement
of the current register while forcing zero current through the load will calibrate
the chip, canceling offset errors in the current ADC.
"temperature"
-------------
Opening and reading this file initiates the CONVERT_T (temperature conversion)
command of the chip, afterwards the temperature is read from the device
registers and provided as an ASCII decimal value.
Important: The returned value has to be divided by 256 to get a real
temperature in degrees Celsius.
"vad", "vdd"
------------
Opening and reading this file initiates the CONVERT_V (voltage conversion)
command of the chip.
Depending on a sysfs filename a different input for the A/D will be selected:
vad:
general purpose A/D input (VAD)
vdd:
battery input (VDD)
After the voltage conversion the value is returned as decimal ASCII.
Note: To get a volts the value has to be divided by 100.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
배터리 모니터 기능
1-21`w1_ds2438`은 Maxim DS2438 Smart Battery Monitor를 지원합니다. family symbol은 `W1_FAMILY_DS2438`, 코드는 `0x26`이며 작성자는 Mariusz Bialonczyk입니다.
DS2438은 배터리 팩에 필요한 여러 기능과 40바이트 비휘발성 EEPROM을 제공합니다. 온도·전류·전압을 측정할 수 있어 우량계, 풍속·풍향계, 습도 센서 같은 기상 관측 장치에도 자주 쓰입니다.
장치 식별과 주요 기능입니다.
Kernel driver w1_ds2438
=======================
Supported chips:
* Maxim DS2438 Smart Battery Monitor
supported family codes:
================ ====
W1_FAMILY_DS2438 0x26
================ ====
Author: Mariusz Bialonczyk <manio@skyboo.net>
Description
-----------
The DS2438 chip provides several functions that are desirable to carry in
a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
Because the ability of temperature, current and voltage measurement, the chip
is also often used in weather stations and applications such as: rain gauge,
iad, page0, page1
22-53현재 지원은 sysfs 파일로 제공되며 `iad`와 `offset`만 쓰기 가능하고 나머지는 읽기 전용입니다.
`iad`는 상태/구성 레지스터의 Current A/D Control Bit를 제어합니다. 0을 쓰면 IAD 비트를 지워 전류 측정을 끄고, `1`을 쓰면 비트를 설정해 측정을 켭니다. DS2438의 기본값은 활성화입니다. 비트 2~7은 무시되므로 ASCII 쓰기가 안전하며 설정 실패 시 I/O 오류를 반환합니다.
`page0`은 칩의 00h 페이지 8바이트 전체를 제공합니다. 자주 접근하는 DS2438 정보가 들어 있으며, 읽을 때 추가 CRC 바이트를 받아 검증한 뒤 성공한 경우만 8바이트를 사용자 공간에 넘깁니다.
`page1`은 01h 페이지 8바이트 전체를 제공합니다. ICA, 경과 시간 계기, 전류 오프셋 데이터가 들어 있으며 CRC 처리와 오류 반환 방식은 `page0`과 같습니다.
상태 제어와 원시 페이지 접근입니다.
wind speed/direction measuring, humidity sensing, etc.
Current support is provided through the following sysfs files (all files
except "iad" and "offset" are readonly):
"iad"
-----
This file controls the 'Current A/D Control Bit' (IAD) in the
Status/Configuration Register.
Writing a zero value will clear the IAD bit and disables the current
measurements.
Writing value "1" is setting the IAD bit (enables the measurements).
The IAD bit is enabled by default in the DS2438.
When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
An I/O error is returned when there is a problem setting the new value.
"page0"
-------
This file provides full 8 bytes of the chip Page 0 (00h).
This page contains the most frequently accessed information of the DS2438.
Internally when this file is read, the additional CRC byte is also obtained
from the slave device. If it is correct, the 8 bytes page data are passed
to userspace, otherwise an I/O error is returned.
"page1"
-------
This file provides full 8 bytes of the chip Page 1 (01h).
This page contains the ICA, elapsed time meter and current offset data of the DS2438.
Internally when this file is read, the additional CRC byte is also obtained
from the slave device. If it is correct, the 8 bytes page data are passed
to userspace, otherwise an I/O error is returned.
오프셋 보정과 온도
54-71`offset`은 칩의 2바이트 Offset Register를 제어합니다. 새 2바이트를 쓰면 전류 측정값이 바뀝니다. 부하 전류를 0으로 강제한 상태에서 현재 레지스터 값의 2의 보수를 쓰면 전류 ADC의 오프셋 오차를 상쇄하도록 보정할 수 있습니다.
`temperature`를 열어 읽으면 칩에 `CONVERT_T` 명령을 시작한 뒤 장치 레지스터에서 온도를 읽어 ASCII 십진수로 제공합니다. 실제 섭씨 온도는 반환값을 256으로 나누어 얻습니다.
원시 정수는 1/256 °C 단위입니다.
"offset"
--------
This file controls the 2-byte Offset Register of the chip.
Writing a 2-byte value will change the Offset Register, which changes the
current measurement done by the chip. Changing this register to the two's complement
of the current register while forcing zero current through the load will calibrate
the chip, canceling offset errors in the current ADC.
"temperature"
-------------
Opening and reading this file initiates the CONVERT_T (temperature conversion)
command of the chip, afterwards the temperature is read from the device
registers and provided as an ASCII decimal value.
Important: The returned value has to be divided by 256 to get a real
temperature in degrees Celsius.
VAD와 VDD 전압 변환
72-86`vad`와 `vdd`를 열어 읽으면 `CONVERT_V` 전압 변환 명령을 시작합니다.
`vad`는 범용 A/D 입력 VAD를 선택하고 `vdd`는 배터리 입력 VDD를 선택합니다. 변환 결과는 ASCII 십진수이며 볼트 값은 반환값을 100으로 나누어 얻습니다.
sysfs 값에서 실제 단위로 바꾸는 방법입니다.
"vad", "vdd"
------------
Opening and reading this file initiates the CONVERT_V (voltage conversion)
command of the chip.
Depending on a sysfs filename a different input for the A/D will be selected:
vad:
general purpose A/D input (VAD)
vdd:
battery input (VDD)
After the voltage conversion the value is returned as decimal ASCII.
Note: To get a volts the value has to be divided by 100.
요약·해설
w1_ds2438.rst:1-86DS2438의 전류·온도·전압 측정과 페이지·오프셋 sysfs를 설명합니다.