요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
Kernel driver max31827
======================
Supported chips:
* Maxim MAX31827
Prefix: 'max31827'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
* Maxim MAX31828
Prefix: 'max31828'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
* Maxim MAX31829
Prefix: 'max31829'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
Authors:
- Daniel Matyas <[email protected]>
Description
-----------
The chips supported by this driver are quite similar. The only difference
between them is found in the default power-on behaviour of the chips. While the
MAX31827's fault queue is set to 1, the other two chip's fault queue is set to
4. Besides this, the MAX31829's alarm active state is high, while the other two
chip's alarms are active on low. It is important to note that the chips can be
configured to operate in the same manner with 1 write operation to the
configuration register. From here on, we will refer to all these chips as
MAX31827.
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme. This
sensor measures the temperature of the chip itself.
MAX31827 has low and over temperature alarms with an effective value and a
hysteresis value: -40 and -30 degrees for under temperature alarm and +100 and
+90 degrees for over temperature alarm.
The alarm can be configured in comparator and interrupt mode from the
devicetree. In Comparator mode, the OT/UT status bits have a value of 1 when the
temperature rises above the TH value or falls below TL, which is also subject to
the Fault Queue selection. OT status returns to 0 when the temperature drops
below the TH_HYST value or when shutdown mode is entered. Similarly, UT status
returns to 0 when the temperature rises above TL_HYST value or when shutdown
mode is entered.
In interrupt mode exceeding TH also sets OT status to 1, which remains set until
a read operation is performed on the configuration/status register (max or min
attribute); at this point, it returns to 0. Once OT status is set to 1 from
exceeding TH and reset, it is set to 1 again only when the temperature drops
below TH_HYST. The output remains asserted until it is reset by a read. It is
set again if the temperature rises above TH, and so on. The same logic applies
to the operation of the UT status bit.
Putting the MAX31827 into shutdown mode also resets the OT/UT status bits. Note
that if the mode is changed while OT/UT status bits are set, an OT/UT status
reset may be required before it begins to behave normally. To prevent this,
it is recommended to perform a read of the configuration/status register to
clear the status bits before changing the operating mode.
The conversions can be manual with the one-shot functionality and automatic with
a set frequency. When powered on, the chip measures temperatures with 1 conv/s.
The conversion rate can be modified with update_interval attribute of the chip.
Conversion/second = 1/update_interval. Thus, the available options according to
the data sheet are:
- 64000 (ms) = 1 conv/64 sec
- 32000 (ms) = 1 conv/32 sec
- 16000 (ms) = 1 conv/16 sec
- 4000 (ms) = 1 conv/4 sec
- 1000 (ms) = 1 conv/sec (default)
- 250 (ms) = 4 conv/sec
- 125 (ms) = 8 conv/sec
Enabling the device when it is already enabled has the side effect of setting
the conversion frequency to 1 conv/s. The conversion time varies depending on
the resolution.
The conversion time doubles with every bit of increased resolution. The
available resolutions are:
- 8 bit -> 8.75 ms conversion time
- 9 bit -> 17.5 ms conversion time
- 10 bit -> 35 ms conversion time
- 12 bit (default) -> 140 ms conversion time
There is a temp1_resolution attribute which indicates the unit change in the
input temperature in milli-degrees C.
- 1000 mC -> 8 bit
- 500 mC -> 9 bit
- 250 mC -> 10 bit
- 62 mC -> 12 bit (default) - actually this is 62.5, but the fil returns 62
When chip is in shutdown mode and a read operation is requested, one-shot is
triggered, the device waits for <conversion time> ms, and only after that is
the temperature value register read. Note that the conversion times are rounded
up to the nearest possible integer.
The LSB of the temperature values is 0.0625 degrees Celsius, but the values of
the temperatures are displayed in milli-degrees. This means, that some data is
lost. The step between 2 consecutive values is 62 or 63. This effect can be seen
in the writing of alarm values too. For positive numbers the user-input value
will always be rounded down to the nearest possible value, for negative numbers
the user-input will always be rounded up to the nearest possible value.
Bus timeout resets the I2C-compatible interface when SCL is low for more than
30ms (nominal).
Alarm polarity determines if the active state of the alarm is low or high. The
behavior for both settings is dependent on the Fault Queue setting. The ALARM
pin is an open-drain output and requires a pullup resistor to operate.
The Fault Queue bits select how many consecutive temperature faults must occur
before overtemperature or undertemperature faults are indicated in the
corresponding status bits.
PEC Support
-----------
When reading a register value, the PEC byte is computed and sent by the chip.
PEC on word data transaction represents a significant increase in bandwidth
usage (+33% for both write and reads) in normal conditions.
Since this operation implies there will be an extra delay to each
transaction, PEC can be disabled or enabled through sysfs.
Just write 1 to the "pec" file for enabling PEC and 0 for disabling it.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
MAX31827/MAX31828/MAX31829 기본 동작 차이
1-47GPL-2.0 문서의 이 드라이버는 Maxim MAX31827, MAX31828, MAX31829를 각각 같은 이름의 접두사로 지원합니다. 세 모델 모두 I2C `0x40-0x5f`를 검색하며 저자는 Daniel Matyas입니다.
모델의 차이는 전원 인가 기본값입니다. MAX31827의 Fault Queue는 1이고 MAX31828·MAX31829는 4입니다. MAX31829 경보는 active-high이고 나머지 두 모델은 active-low입니다. 구성 레지스터에 한 번 쓰면 세 모델을 같은 방식으로 동작시킬 수 있으므로 이후 설명은 모두 MAX31827로 부릅니다.
MAX31827은 6 WLP 패키지의 칩 자체 온도 센서입니다. 저온 경보의 유효값과 히스테리시스 기본값은 -40°C와 -30°C, 과온 경보는 +100°C와 +90°C입니다.
전원 인가 시 Fault Queue와 경보 극성이 다릅니다.
구성 레지스터 기록으로 모델별 기본 차이를 없앨 수 있습니다.
.. SPDX-License-Identifier: GPL-2.0
Kernel driver max31827
======================
Supported chips:
* Maxim MAX31827
Prefix: 'max31827'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
* Maxim MAX31828
Prefix: 'max31828'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
* Maxim MAX31829
Prefix: 'max31829'
Addresses scanned: I2C 0x40 - 0x5f
Datasheet: Publicly available at the Analog Devices website
Authors:
- Daniel Matyas <[email protected]>
Description
-----------
The chips supported by this driver are quite similar. The only difference
between them is found in the default power-on behaviour of the chips. While the
MAX31827's fault queue is set to 1, the other two chip's fault queue is set to
4. Besides this, the MAX31829's alarm active state is high, while the other two
chip's alarms are active on low. It is important to note that the chips can be
configured to operate in the same manner with 1 write operation to the
configuration register. From here on, we will refer to all these chips as
MAX31827.
비교기·인터럽트 모드의 OT/UT 상태 전이
48-79경보는 devicetree에서 비교기 또는 인터럽트 모드로 구성합니다. 비교기 모드에서 온도가 `TH`보다 높거나 `TL`보다 낮으면 Fault Queue 조건을 거쳐 `OT` 또는 `UT` 상태가 1이 됩니다.
비교기 모드의 `OT`는 온도가 `TH_HYST` 아래로 내려가거나 shutdown 모드에 들어가면 0으로 돌아옵니다. `UT`는 온도가 `TL_HYST` 위로 오르거나 shutdown에 들어가면 0이 됩니다.
인터럽트 모드에서 TH 초과로 설정된 OT는 구성/상태 레지스터, 즉 max 또는 min 속성을 읽을 때까지 유지되고 읽으면 0이 됩니다. 이후 온도가 TH_HYST 아래로 내려가야 다음 TH 초과에서 다시 설정될 수 있습니다. 출력은 읽기로 재설정될 때까지 유지되며 UT도 같은 논리로 동작합니다.
shutdown 진입도 OT/UT를 재설정합니다. 상태 비트가 설정된 채 모드를 바꾸면 정상 동작 전에 별도 재설정이 필요할 수 있으므로, 모드 변경 전에 구성/상태 레지스터를 읽어 비트를 지우는 것이 권장됩니다.
상태 비트의 해제 조건이 핵심 차이입니다.
남은 상태 비트가 새 모드에 영향을 주지 않게 합니다.
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme. This
sensor measures the temperature of the chip itself.
MAX31827 has low and over temperature alarms with an effective value and a
hysteresis value: -40 and -30 degrees for under temperature alarm and +100 and
+90 degrees for over temperature alarm.
The alarm can be configured in comparator and interrupt mode from the
devicetree. In Comparator mode, the OT/UT status bits have a value of 1 when the
temperature rises above the TH value or falls below TL, which is also subject to
the Fault Queue selection. OT status returns to 0 when the temperature drops
below the TH_HYST value or when shutdown mode is entered. Similarly, UT status
returns to 0 when the temperature rises above TL_HYST value or when shutdown
mode is entered.
In interrupt mode exceeding TH also sets OT status to 1, which remains set until
a read operation is performed on the configuration/status register (max or min
attribute); at this point, it returns to 0. Once OT status is set to 1 from
exceeding TH and reset, it is set to 1 again only when the temperature drops
below TH_HYST. The output remains asserted until it is reset by a read. It is
set again if the temperature rises above TH, and so on. The same logic applies
to the operation of the UT status bit.
Putting the MAX31827 into shutdown mode also resets the OT/UT status bits. Note
that if the mode is changed while OT/UT status bits are set, an OT/UT status
reset may be required before it begins to behave normally. To prevent this,
it is recommended to perform a read of the configuration/status register to
clear the status bits before changing the operating mode.
The conversions can be manual with the one-shot functionality and automatic with
a set frequency. When powered on, the chip measures temperatures with 1 conv/s.
The conversion rate can be modified with update_interval attribute of the chip.
변환 주기·해상도·원샷과 값 반올림
80-123변환은 원샷 수동 방식 또는 지정 주기의 자동 방식입니다. 전원 인가 기본값은 초당 1회이며 `update_interval`로 바꿉니다. 초당 변환 수는 `1/update_interval`입니다.
지원 간격은 64000ms(64초당 1회), 32000ms, 16000ms, 4000ms, 1000ms(기본 초당 1회), 250ms(초당 4회), 125ms(초당 8회)입니다. 이미 활성화된 장치를 다시 활성화하면 변환 주기가 초당 1회로 돌아가는 부작용이 있습니다.
해상도가 1비트 늘 때마다 변환 시간은 두 배가 됩니다. 8비트는 8.75ms, 9비트는 17.5ms, 10비트는 35ms, 기본 12비트는 140ms입니다. `temp1_resolution`은 밀리섭씨 단위 변화량을 표시하며 8·9·10·12비트에 각각 1000, 500, 250, 62mC입니다. 실제 12비트 단계는 62.5mC지만 파일은 62를 반환합니다.
shutdown 상태에서 읽기를 요청하면 원샷 변환을 시작하고 정수로 올림한 변환 시간만큼 기다린 뒤 온도 레지스터를 읽습니다. 온도 LSB는 0.0625°C이지만 표시 단위가 m°C라 일부 정밀도가 사라져 연속 값 차이가 62 또는 63이 됩니다. 경보값 쓰기에서도 양수는 가능한 값으로 내림, 음수는 올림됩니다.
해상도와 변환 시간·표시 단계의 관계입니다.
읽기 요청이 변환과 대기를 자동으로 수행합니다.
Conversion/second = 1/update_interval. Thus, the available options according to
the data sheet are:
- 64000 (ms) = 1 conv/64 sec
- 32000 (ms) = 1 conv/32 sec
- 16000 (ms) = 1 conv/16 sec
- 4000 (ms) = 1 conv/4 sec
- 1000 (ms) = 1 conv/sec (default)
- 250 (ms) = 4 conv/sec
- 125 (ms) = 8 conv/sec
Enabling the device when it is already enabled has the side effect of setting
the conversion frequency to 1 conv/s. The conversion time varies depending on
the resolution.
The conversion time doubles with every bit of increased resolution. The
available resolutions are:
- 8 bit -> 8.75 ms conversion time
- 9 bit -> 17.5 ms conversion time
- 10 bit -> 35 ms conversion time
- 12 bit (default) -> 140 ms conversion time
There is a temp1_resolution attribute which indicates the unit change in the
input temperature in milli-degrees C.
- 1000 mC -> 8 bit
- 500 mC -> 9 bit
- 250 mC -> 10 bit
- 62 mC -> 12 bit (default) - actually this is 62.5, but the fil returns 62
When chip is in shutdown mode and a read operation is requested, one-shot is
triggered, the device waits for <conversion time> ms, and only after that is
the temperature value register read. Note that the conversion times are rounded
up to the nearest possible integer.
The LSB of the temperature values is 0.0625 degrees Celsius, but the values of
the temperatures are displayed in milli-degrees. This means, that some data is
lost. The step between 2 consecutive values is 62 or 63. This effect can be seen
in the writing of alarm values too. For positive numbers the user-input value
will always be rounded down to the nearest possible value, for negative numbers
the user-input will always be rounded up to the nearest possible value.
Bus timeout resets the I2C-compatible interface when SCL is low for more than
버스 타임아웃·경보 극성·Fault Queue·PEC
124-144SCL이 명목상 30ms보다 오래 low이면 버스 타임아웃이 I2C 호환 인터페이스를 재설정합니다.
경보 극성은 활성 상태가 low인지 high인지 정하고 두 설정 모두 Fault Queue 값의 영향을 받습니다. `ALARM` 핀은 오픈 드레인 출력이므로 동작하려면 풀업 저항이 필요합니다. Fault Queue 비트는 과온·저온 상태를 보고하기 전에 연속으로 발생해야 하는 온도 고장 횟수를 선택합니다.
레지스터를 읽을 때 칩이 PEC 바이트를 계산해 전송합니다. 워드 데이터에서 PEC는 정상 조건의 읽기와 쓰기 모두 대역폭을 33% 늘리고 각 트랜잭션에 지연을 추가합니다. sysfs `pec` 파일에 1을 쓰면 활성화하고 0을 쓰면 비활성화합니다.
버스 복구와 무결성 검사 기능입니다.
무결성과 지연·대역폭 비용을 비교합니다.
30ms (nominal).
Alarm polarity determines if the active state of the alarm is low or high. The
behavior for both settings is dependent on the Fault Queue setting. The ALARM
pin is an open-drain output and requires a pullup resistor to operate.
The Fault Queue bits select how many consecutive temperature faults must occur
before overtemperature or undertemperature faults are indicated in the
corresponding status bits.
PEC Support
-----------
When reading a register value, the PEC byte is computed and sent by the chip.
PEC on word data transaction represents a significant increase in bandwidth
usage (+33% for both write and reads) in normal conditions.
Since this operation implies there will be an extra delay to each
transaction, PEC can be disabled or enabled through sysfs.
Just write 1 to the "pec" file for enabling PEC and 0 for disabling it.
요약·해설
max31827.rst:1-144비교기·인터럽트 경보를 안전하게 재설정하고 8-12비트 변환과 PEC 통신 비용을 관리합니다.
원문 분량과 핵심 인터페이스입니다.
장치 등록부터 측정·경보 처리까지의 순서입니다.