요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Kernel driver pcf8591
=====================
Supported chips:
* Philips/NXP PCF8591
Prefix: 'pcf8591'
Addresses scanned: none
Datasheet: Publicly available at the NXP website
http://www.nxp.com/pip/PCF8591_6.html
Authors:
- Aurelien Jarno <[email protected]>
- valuable contributions by Jan M. Sendler <[email protected]>,
- Jean Delvare <[email protected]>
Description
-----------
The PCF8591 is an 8-bit A/D and D/A converter (4 analog inputs and one
analog output) for the I2C bus produced by Philips Semiconductors (now NXP).
It is designed to provide a byte I2C interface to up to 4 separate devices.
The PCF8591 has 4 analog inputs programmable as single-ended or
differential inputs:
- mode 0 : four single ended inputs
Pins AIN0 to AIN3 are single ended inputs for channels 0 to 3
- mode 1 : three differential inputs
Pins AIN3 is the common negative differential input
Pins AIN0 to AIN2 are positive differential inputs for channels 0 to 2
- mode 2 : single ended and differential mixed
Pins AIN0 and AIN1 are single ended inputs for channels 0 and 1
Pins AIN2 is the positive differential input for channel 3
Pins AIN3 is the negative differential input for channel 3
- mode 3 : two differential inputs
Pins AIN0 is the positive differential input for channel 0
Pins AIN1 is the negative differential input for channel 0
Pins AIN2 is the positive differential input for channel 1
Pins AIN3 is the negative differential input for channel 1
See the datasheet for details.
Module parameters
-----------------
* input_mode int
Analog input mode:
- 0 = four single ended inputs
- 1 = three differential inputs
- 2 = single ended and differential mixed
- 3 = two differential inputs
Accessing PCF8591 via /sys interface
-------------------------------------
The PCF8591 is plainly impossible to detect! Thus the driver won't even
try. You have to explicitly instantiate the device at the relevant
address (in the interval [0x48..0x4f]) either through platform data, or
using the sysfs interface. See Documentation/i2c/instantiating-devices.rst
for details.
Directories are being created for each instantiated PCF8591:
/sys/bus/i2c/devices/<0>-<1>/
where <0> is the bus the chip is connected to (e. g. i2c-0)
and <1> the chip address ([48..4f])
Inside these directories, there are such files:
in0_input, in1_input, in2_input, in3_input, out0_enable, out0_output, name
Name contains chip name.
The in0_input, in1_input, in2_input and in3_input files are RO. Reading gives
the value of the corresponding channel. Depending on the current analog inputs
configuration, files in2_input and in3_input may not exist. Values range
from 0 to 255 for single ended inputs and -128 to +127 for differential inputs
(8-bit ADC).
The out0_enable file is RW. Reading gives "1" for analog output enabled and
"0" for analog output disabled. Writing accepts "0" and "1" accordingly.
The out0_output file is RW. Writing a number between 0 and 255 (8-bit DAC), send
the value to the digital-to-analog converter. Note that a voltage will
only appears on AOUT pin if aout0_enable equals 1. Reading returns the last
value written.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
8비트 ADC/DAC와 네 입력 모드
1-50Aurelien Jarno가 작성하고 Jan M. Sendler와 Jean Delvare가 기여한 `pcf8591` 드라이버는 Philips/NXP PCF8591을 지원합니다. 주소를 자동 검색하지 않으며 NXP 웹사이트에서 데이터시트를 구할 수 있습니다.
PCF8591은 I2C 버스용 8비트 A/D 및 D/A 변환기로 아날로그 입력 4개와 아날로그 출력 1개를 갖습니다. 바이트 단위 I2C 인터페이스로 최대 네 개의 개별 입력 장치를 처리하도록 설계되었습니다.
모드 0은 AIN0~AIN3을 채널 0~3의 단일 종단 입력으로 사용합니다. 모드 1은 AIN3을 공통 음의 차동 입력, AIN0~AIN2를 채널 0~2의 양의 차동 입력으로 사용합니다.
모드 2는 AIN0과 AIN1을 채널 0·1의 단일 종단 입력으로 쓰고 AIN2와 AIN3을 채널 3의 양·음 차동 입력으로 사용합니다. 모드 3은 AIN0/AIN1을 채널 0, AIN2/AIN3을 채널 1의 양·음 차동 쌍으로 사용합니다.
네 핀의 단일 종단·차동 연결을 구조화했습니다.
input_mode에 맞춰 핀과 채널을 연결합니다.
Kernel driver pcf8591
=====================
Supported chips:
* Philips/NXP PCF8591
Prefix: 'pcf8591'
Addresses scanned: none
Datasheet: Publicly available at the NXP website
http://www.nxp.com/pip/PCF8591_6.html
Authors:
- Aurelien Jarno <[email protected]>
- valuable contributions by Jan M. Sendler <[email protected]>,
- Jean Delvare <[email protected]>
Description
-----------
The PCF8591 is an 8-bit A/D and D/A converter (4 analog inputs and one
analog output) for the I2C bus produced by Philips Semiconductors (now NXP).
It is designed to provide a byte I2C interface to up to 4 separate devices.
The PCF8591 has 4 analog inputs programmable as single-ended or
differential inputs:
- mode 0 : four single ended inputs
Pins AIN0 to AIN3 are single ended inputs for channels 0 to 3
- mode 1 : three differential inputs
Pins AIN3 is the common negative differential input
Pins AIN0 to AIN2 are positive differential inputs for channels 0 to 2
- mode 2 : single ended and differential mixed
Pins AIN0 and AIN1 are single ended inputs for channels 0 and 1
Pins AIN2 is the positive differential input for channel 3
Pins AIN3 is the negative differential input for channel 3
- mode 3 : two differential inputs
Pins AIN0 is the positive differential input for channel 0
Pins AIN1 is the negative differential input for channel 0
Pins AIN2 is the positive differential input for channel 1
Pins AIN3 is the negative differential input for channel 1
See the datasheet for details.
input_mode와 명시적 장치 생성
51-72정수형 모듈 매개변수 `input_mode`는 아날로그 입력 구성을 선택합니다. 0은 단일 종단 4개, 1은 차동 3개, 2는 단일 종단과 차동 혼합, 3은 차동 2개입니다.
PCF8591은 자동 감지가 불가능하므로 드라이버는 검색을 시도하지 않습니다. 플랫폼 데이터나 sysfs 인터페이스를 사용해 실제 주소에 장치를 명시적으로 생성해야 합니다.
허용 I2C 주소 범위는 `0x48..0x4f`입니다. 구체적인 생성 방법은 `Documentation/i2c/instantiating-devices.rst`를 참고합니다.
입력 모드와 주소 지정 요구사항입니다.
버스와 주소를 알고 있을 때만 장치를 등록합니다.
Module parameters
-----------------
* input_mode int
Analog input mode:
- 0 = four single ended inputs
- 1 = three differential inputs
- 2 = single ended and differential mixed
- 3 = two differential inputs
Accessing PCF8591 via /sys interface
-------------------------------------
The PCF8591 is plainly impossible to detect! Thus the driver won't even
try. You have to explicitly instantiate the device at the relevant
address (in the interval [0x48..0x4f]) either through platform data, or
using the sysfs interface. See Documentation/i2c/instantiating-devices.rst
for details.
ADC 입력과 DAC 출력 sysfs
73-98생성된 각 PCF8591에는 `/sys/bus/i2c/devices/<0>-<1>/` 디렉터리가 생깁니다. `<0>`은 `i2c-0` 같은 버스이고 `<1>`은 `48..4f`의 칩 주소입니다.
디렉터리에는 `in0_input`부터 `in3_input`, `out0_enable`, `out0_output`, `name`이 존재할 수 있습니다. `name`은 칩 이름을 담습니다.
입력 파일은 읽기 전용이며 해당 채널의 값을 반환합니다. 현재 입력 모드에 따라 `in2_input`과 `in3_input`은 없을 수 있습니다. 8비트 ADC 값 범위는 단일 종단 입력에서 0~255, 차동 입력에서 -128~+127입니다.
`out0_enable`은 읽기·쓰기가 가능하며 아날로그 출력 활성화는 1, 비활성화는 0입니다. `out0_output`도 읽기·쓰기가 가능하고 0~255 값을 8비트 DAC로 보냅니다.
AOUT 핀에 실제 전압이 나타나려면 `out0_enable`이 1이어야 합니다. `out0_output`을 읽으면 마지막으로 쓴 값을 반환합니다.
입력 범위와 출력 활성화 조건을 정리합니다.
값을 기록하고 출력 활성화를 별도로 제어합니다.
Directories are being created for each instantiated PCF8591:
/sys/bus/i2c/devices/<0>-<1>/
where <0> is the bus the chip is connected to (e. g. i2c-0)
and <1> the chip address ([48..4f])
Inside these directories, there are such files:
in0_input, in1_input, in2_input, in3_input, out0_enable, out0_output, name
Name contains chip name.
The in0_input, in1_input, in2_input and in3_input files are RO. Reading gives
the value of the corresponding channel. Depending on the current analog inputs
configuration, files in2_input and in3_input may not exist. Values range
from 0 to 255 for single ended inputs and -128 to +127 for differential inputs
(8-bit ADC).
The out0_enable file is RW. Reading gives "1" for analog output enabled and
"0" for analog output disabled. Writing accepts "0" and "1" accordingly.
The out0_output file is RW. Writing a number between 0 and 255 (8-bit DAC), send
the value to the digital-to-analog converter. Note that a voltage will
only appears on AOUT pin if aout0_enable equals 1. Reading returns the last
value written.
요약·해설
pcf8591.rst:1-98AIN0~AIN3을 단일 종단 또는 차동으로 조합하고 0x48~0x4f에 장치를 직접 생성해 8비트 입력과 출력을 사용합니다.
원문 분량과 핵심 장치 구성을 정리합니다.
장치 인식부터 측정·제어까지의 핵심 순서입니다.