요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==============================
OPT4060 driver
==============================
1. Overview
=============================
This driver supports the Texas Instrument RGBW high resolution color sensor over
I2C.
https://www.ti.com/lit/gpn/opt4060
The driver supports:
- Raw values for red, green, blue and clear.
- Illuminance values.
- Scaled color values for red, green and blue.
- IIO events for thresholds.
- IIO triggered buffer using both its own data ready trigger and triggers from
other drivers.
2. Illuminance calculation
=============================
Illuminance is calculated using the wide spectrum green channel.
lux = GREEN_RAW x 2.15e-3
The value is accessed from:
/sys/bus/iio/devices/iio:deviceX/in_illuminance_input
See section 8.4.5.2 in the data sheet for additional details.
3. Color scale values
=============================
The sensor has different sensitivity for the different color components and
compensating factors are exposed from the driver.
The values are accessed from:
/sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale
/sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale
/sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale
A userspace application can multiply the raw values with the scale values so
that for a particular test light source, typically white, the measurement
intensity is the same across the different color channels. This is calculated
in the following way:
R = RED_RAW x SCALE_RED(2.4)
G = GREEN_RAW x SCALE_GREEN(1.0)
B = BLUE_RAW x SCALE_BLUE(1.3)
The data sheet suggests using the scaled values to normalize the scaled R, G
and B values. This is useful to get a value for the ratio between colors
independent of light intensity. A userspace application can do this in the
following way:
R_NORMALIZED = R / (R + G + B)
G_NORMALIZED = G / (R + G + B)
B_NORMALIZED = B / (R + G + B)
See section 8.4.5.2 in the data sheet for additional details.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
OPT4060 RGBW 센서와 드라이버 기능
1-19이 드라이버는 I²C로 연결되는 Texas Instruments OPT4060 고해상도 RGBW 색상 센서를 지원합니다.
제품 데이터시트는 `https://www.ti.com/lit/gpn/opt4060`에서 확인할 수 있습니다.
원문에 나열된 측정값·event·buffer 기능을 정리했습니다.
드라이버는 red·green·blue·clear 채널의 원시 값, 조도 값, red·green·blue의 scale 적용 색상 값을 제공합니다.
또한 threshold용 IIO event와 IIO triggered buffer를 지원합니다. 버퍼는 센서 자체의 data-ready trigger뿐 아니라 다른 드라이버가 제공하는 trigger도 사용할 수 있습니다.
광학 채널 측정에서 event·buffer 소비까지의 전체 흐름입니다.
==============================
OPT4060 driver
==============================
1. Overview
=============================
This driver supports the Texas Instrument RGBW high resolution color sensor over
I2C.
https://www.ti.com/lit/gpn/opt4060
The driver supports:
- Raw values for red, green, blue and clear.
- Illuminance values.
- Scaled color values for red, green and blue.
- IIO events for thresholds.
- IIO triggered buffer using both its own data ready trigger and triggers from
other drivers.
Wide-spectrum green 기반 조도 계산
20-31조도는 wide-spectrum green 채널을 사용해 계산합니다.
lux = GREEN_RAW x 2.15e-3
계산된 값은 `/sys/bus/iio/devices/iio:deviceX/in_illuminance_input`에서 접근합니다.
원시 입력, 변환 계수, 결과 경로를 연결합니다.
Green raw sample이 IIO illuminance 값으로 노출되는 과정입니다.
추가 세부사항은 데이터시트 8.4.5.2절을 참고합니다.
2. Illuminance calculation
=============================
Illuminance is calculated using the wide spectrum green channel.
lux = GREEN_RAW x 2.15e-3
The value is accessed from:
/sys/bus/iio/devices/iio:deviceX/in_illuminance_input
See section 8.4.5.2 in the data sheet for additional details.
RGB scale 보정과 색상 비율 정규화
32-61센서는 색상 성분마다 감도가 다르므로 드라이버가 보정 계수를 노출합니다.
색상별 scale 값에 접근하는 장치 속성입니다.
사용자 공간 응용 프로그램은 raw 값에 scale 값을 곱할 수 있습니다. 그러면 일반적으로 흰색인 특정 시험 광원에서 서로 다른 색상 채널의 측정 intensity가 같아지도록 보정할 수 있습니다.
R = RED_RAW x SCALE_RED(2.4)
G = GREEN_RAW x SCALE_GREEN(1.0)
B = BLUE_RAW x SCALE_BLUE(1.3)
원문 예제의 raw 입력과 scale 계수를 그대로 대응시켰습니다.
데이터시트는 scale을 적용한 R·G·B 값을 다시 정규화하라고 제안합니다. 이렇게 하면 광도와 무관한 색상 사이의 비율을 얻을 수 있습니다.
R_NORMALIZED = R / (R + G + B)
G_NORMALIZED = G / (R + G + B)
B_NORMALIZED = B / (R + G + B)
세 채널 합을 분모로 사용해 intensity 영향을 제거합니다.
Raw RGB를 광도 독립적인 비율로 만드는 순서입니다.
추가 세부사항은 데이터시트 8.4.5.2절을 참고합니다.
3. Color scale values
=============================
The sensor has different sensitivity for the different color components and
compensating factors are exposed from the driver.
The values are accessed from:
/sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale
/sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale
/sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale
A userspace application can multiply the raw values with the scale values so
that for a particular test light source, typically white, the measurement
intensity is the same across the different color channels. This is calculated
in the following way:
R = RED_RAW x SCALE_RED(2.4)
G = GREEN_RAW x SCALE_GREEN(1.0)
B = BLUE_RAW x SCALE_BLUE(1.3)
The data sheet suggests using the scaled values to normalize the scaled R, G
and B values. This is useful to get a value for the ratio between colors
independent of light intensity. A userspace application can do this in the
following way:
R_NORMALIZED = R / (R + G + B)
G_NORMALIZED = G / (R + G + B)
B_NORMALIZED = B / (R + G + B)
See section 8.4.5.2 in the data sheet for additional details.
요약·해설
opt4060.rst:1-61OPT4060 드라이버는 I²C RGBW 센서의 raw·illuminance·scaled RGB 값을 IIO로 제공합니다. Green raw 값은 lux로 변환하고 RGB는 채널별 감도 계수로 보정한 뒤 합계로 정규화해 광도와 무관한 색상 비율을 구할 수 있습니다.
센서 출력과 핵심 계산을 요약합니다.
센서 raw 값에서 조도·색상 비율·버퍼 출력까지의 흐름입니다.