← Documents Documentation/hwmon/max197.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver max197

MAX197/MAX199 8채널 12비트 ADC의 제어 바이트와 채널별 전압 범위를 설명합니다.

Source pathDocumentation/hwmon/max197.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

max197.rst:1-70

플랫폼 변환 함수가 채널·극성·전체 눈금 제어 바이트를 전달하고 sysfs 범위를 지원 단계로 조정합니다.

문서 개요
항목
SourceDocumentation/hwmon/max197.rst
분량70 source lines
채널8개
해상도12비트

원문 분량과 핵심 인터페이스입니다.

운영 흐름
플랫폼 함수 준비제어 바이트 구성변환 실행min·max 조정입력값 읽기

장치 등록부터 측정·경보 처리까지의 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Kernel driver max197
2 ====================
3
4 Author:
5
6 * Vivien Didelot <[email protected]>
7
8 Supported chips:
9
10 * Maxim MAX197
11
12 Prefix: 'max197'
13
14 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf
15
16 * Maxim MAX199
17
18 Prefix: 'max199'
19
20 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf
21
22 Description
23 -----------
24
25 The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
26 12-Bit DAS with 8+4 Bus Interface and Fault Protection.
27
28 The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
29 while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
30
31 Platform data
32 -------------
33
34 The MAX197 platform data (defined in linux/platform_data/max197.h) should be
35 filled with a pointer to a conversion function, defined like::
36
37 int convert(u8 ctrl);
38
39 ctrl is the control byte to write to start a new conversion.
40 On success, the function must return the 12-bit raw value read from the chip,
41 or a negative error code otherwise.
42
43 Control byte format:
44
45 ======= ========== ============================================
46 Bit Name Description
47 7,6 PD1,PD0 Clock and Power-Down modes
48 5 ACQMOD Internal or External Controlled Acquisition
49 4 RNG Full-scale voltage magnitude at the input
50 3 BIP Unipolar or Bipolar conversion mode
51 2,1,0 A2,A1,A0 Channel
52 ======= ========== ============================================
53
54 Sysfs interface
55 ---------------
56
57 ============== ==============================================================
58 in[0-7]_input The conversion value for the corresponding channel.
59 RO
60
61 in[0-7]_min The lower limit (in mV) for the corresponding channel.
62 For the MAX197, it will be adjusted to -10000, -5000, or 0.
63 For the MAX199, it will be adjusted to -4000, -2000, or 0.
64 RW
65
66 in[0-7]_max The higher limit (in mV) for the corresponding channel.
67 For the MAX197, it will be adjusted to 0, 5000, or 10000.
68 For the MAX199, it will be adjusted to 0, 2000, or 4000.
69 RW
70 ============== ==============================================================
71

3. 한국어 전문 번역

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

MAX197/MAX199 다중 범위 12비트 변환기

1-36

Vivien Didelot가 작성한 이 드라이버는 `max197` 접두사의 Maxim MAX197과 `max199` 접두사의 MAX199를 지원합니다. 두 장치는 모두 8채널, 다중 범위, 5V, 12비트 데이터 수집 시스템이며 8+4 버스 인터페이스와 고장 보호 기능을 갖습니다.

MAX197의 입력 범위는 0 또는 -5V부터 +5V, 그리고 0 또는 -10V부터 +10V입니다. MAX199는 더 좁은 0 또는 -2V부터 +2V, 그리고 0 또는 -4V부터 +4V 범위를 사용합니다.

플랫폼 데이터는 `linux/platform_data/max197.h`에 정의되며 새 변환을 시작하는 제어 바이트 `ctrl`을 받는 `int convert(u8 ctrl);` 함수 포인터를 제공해야 합니다. 성공하면 칩에서 읽은 12비트 원시값을 반환하고 실패하면 음수 오류 코드를 반환합니다.

MAX197 계열 측정 범위
낮은 전체 눈금높은 전체 눈금
MAX1970 또는 -5V부터 +5V0 또는 -10V부터 +10V
MAX1990 또는 -2V부터 +2V0 또는 -4V부터 +4V

단극 또는 양극 모드와 전체 눈금 설정의 조합입니다.

변환 호출
채널·범위·모드 선택ctrl 제어 바이트 구성convert(u8 ctrl) 호출12비트 원시값 반환실패 시 음수 오류 전달

플랫폼 변환 함수가 제어 바이트를 장치에 전달합니다.

Kernel driver max197
====================

Author:

  * Vivien Didelot <[email protected]>

Supported chips:

  * Maxim MAX197

    Prefix: 'max197'

    Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf

  * Maxim MAX199

    Prefix: 'max199'

    Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf

Description
-----------

The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
12-Bit DAS with 8+4 Bus Interface and Fault Protection.

The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.

Platform data
-------------

The MAX197 platform data (defined in linux/platform_data/max197.h) should be
filled with a pointer to a conversion function, defined like::

제어 바이트와 채널별 sysfs 범위

37-70

제어 바이트의 비트 7과 6인 `PD1`, `PD0`은 클록과 전원 차단 모드를 정합니다. 비트 5 `ACQMOD`는 내부 또는 외부 제어 획득, 비트 4 `RNG`는 입력 전체 눈금 전압 크기, 비트 3 `BIP`는 단극 또는 양극 변환 모드를 선택합니다. 비트 2:0의 `A2:A0`은 여덟 채널 중 하나를 지정합니다.

`in[0-7]_input`은 해당 채널의 읽기 전용 변환값입니다. `in[0-7]_min`과 `in[0-7]_max`는 mV 단위의 쓰기 가능한 하한·상한이며, 요청값은 칩이 지원하는 단계로 조정됩니다.

MAX197 하한은 `-10000`, `-5000`, `0` 중 하나이고 상한은 `0`, `5000`, `10000` 중 하나입니다. MAX199 하한은 `-4000`, `-2000`, `0`, 상한은 `0`, `2000`, `4000` 중 하나로 맞춰집니다.

MAX197 제어 바이트
비트이름기능
7,6PD1,PD0클록 및 전원 차단 모드
5ACQMOD내부/외부 제어 획득
4RNG입력 전체 눈금 전압 크기
3BIP단극/양극 변환
2,1,0A2,A1,A0채널 선택

각 비트가 변환 조건을 결정합니다.

sysfs 범위 적용
in0-in7 채널 선택min·max를 mV로 요청칩 모델 확인지원 단계로 조정input 변환값 읽기

사용자 요청을 칩이 지원하는 이산 범위로 맞춥니다.

    int convert(u8 ctrl);

ctrl is the control byte to write to start a new conversion.
On success, the function must return the 12-bit raw value read from the chip,
or a negative error code otherwise.

Control byte format:

======= ========== ============================================
Bit     Name       Description
7,6     PD1,PD0    Clock and Power-Down modes
5       ACQMOD     Internal or External Controlled Acquisition
4       RNG        Full-scale voltage magnitude at the input
3       BIP        Unipolar or Bipolar conversion mode
2,1,0   A2,A1,A0   Channel
======= ========== ============================================

Sysfs interface
---------------

  ============== ==============================================================
  in[0-7]_input  The conversion value for the corresponding channel.
                 RO

  in[0-7]_min    The lower limit (in mV) for the corresponding channel.
                 For the MAX197, it will be adjusted to -10000, -5000, or 0.
                 For the MAX199, it will be adjusted to -4000, -2000, or 0.
                 RW

  in[0-7]_max    The higher limit (in mV) for the corresponding channel.
                 For the MAX197, it will be adjusted to 0, 5000, or 10000.
                 For the MAX199, it will be adjusted to 0, 2000, or 4000.
                 RW
  ============== ==============================================================