← Documents Documentation/iio/opt4060.rst GitHub 원문 ↗

Linux 6.18.37 · IIO

OPT4060 driver

OPT4060 RGBW raw·조도·색상 scale 값과 threshold event, triggered buffer 및 RGB 정규화를 설명합니다.

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

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

1. 요약·해설

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

요약·해설

opt4060.rst:1-61

OPT4060 드라이버는 I²C RGBW 센서의 raw·illuminance·scaled RGB 값을 IIO로 제공합니다. Green raw 값은 lux로 변환하고 RGB는 채널별 감도 계수로 보정한 뒤 합계로 정규화해 광도와 무관한 색상 비율을 구할 수 있습니다.

문서 개요
항목내용
SourceDocumentation/iio/opt4060.rst
분량61 source lines
채널Red, green, blue, clear
Illuminance`GREEN_RAW × 2.15e-3` lux
추가 기능Threshold events, triggered buffer

센서 출력과 핵심 계산을 요약합니다.

OPT4060 처리 흐름
RGBW raw 값 취득Green channel로 lux 계산RGB에 감도 scale 적용RGB 합으로 normalized ratio 계산Event 또는 triggered buffer로 데이터 소비

센서 raw 값에서 조도·색상 비율·버퍼 출력까지의 흐름입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==============================
2 OPT4060 driver
3 ==============================
4
5 1. Overview
6 =============================
7
8 This driver supports the Texas Instrument RGBW high resolution color sensor over
9 I2C.
10 https://www.ti.com/lit/gpn/opt4060
11
12 The driver supports:
13 - Raw values for red, green, blue and clear.
14 - Illuminance values.
15 - Scaled color values for red, green and blue.
16 - IIO events for thresholds.
17 - IIO triggered buffer using both its own data ready trigger and triggers from
18 other drivers.
19
20 2. Illuminance calculation
21 =============================
22
23 Illuminance is calculated using the wide spectrum green channel.
24
25 lux = GREEN_RAW x 2.15e-3
26
27 The value is accessed from:
28 /sys/bus/iio/devices/iio:deviceX/in_illuminance_input
29
30 See section 8.4.5.2 in the data sheet for additional details.
31
32 3. Color scale values
33 =============================
34
35 The sensor has different sensitivity for the different color components and
36 compensating factors are exposed from the driver.
37
38 The values are accessed from:
39 /sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale
40 /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale
41 /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale
42
43 A userspace application can multiply the raw values with the scale values so
44 that for a particular test light source, typically white, the measurement
45 intensity is the same across the different color channels. This is calculated
46 in the following way:
47
48 R = RED_RAW x SCALE_RED(2.4)
49 G = GREEN_RAW x SCALE_GREEN(1.0)
50 B = BLUE_RAW x SCALE_BLUE(1.3)
51
52 The data sheet suggests using the scaled values to normalize the scaled R, G
53 and B values. This is useful to get a value for the ratio between colors
54 independent of light intensity. A userspace application can do this in the
55 following way:
56
57 R_NORMALIZED = R / (R + G + B)
58 G_NORMALIZED = G / (R + G + B)
59 B_NORMALIZED = B / (R + G + B)
60
61 See section 8.4.5.2 in the data sheet for additional details.
62

3. 한국어 전문 번역

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

OPT4060 RGBW 센서와 드라이버 기능

1-19

이 드라이버는 I²C로 연결되는 Texas Instruments OPT4060 고해상도 RGBW 색상 센서를 지원합니다.

제품 데이터시트는 `https://www.ti.com/lit/gpn/opt4060`에서 확인할 수 있습니다.

OPT4060 드라이버 지원 기능
기능내용
Raw colorRed, green, blue, clear 원시 값
Illuminance조도 값
Scaled colorRed, green, blue 보정 값
IIO eventsThreshold event
IIO triggered buffer자체 data-ready trigger와 다른 driver의 trigger 지원

원문에 나열된 측정값·event·buffer 기능을 정리했습니다.

드라이버는 red·green·blue·clear 채널의 원시 값, 조도 값, red·green·blue의 scale 적용 색상 값을 제공합니다.

또한 threshold용 IIO event와 IIO triggered buffer를 지원합니다. 버퍼는 센서 자체의 data-ready trigger뿐 아니라 다른 드라이버가 제공하는 trigger도 사용할 수 있습니다.

OPT4060 데이터 경로
I²C에서 RGBW raw channels 읽기Wide-spectrum green으로 illuminance 계산RGB channel별 scale 적용Threshold 조건이면 IIO event 발생Data-ready 또는 외부 trigger로 buffer capture

광학 채널 측정에서 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`에서 접근합니다.

OPT4060 illuminance
항목
입력`GREEN_RAW`
계수`2.15e-3`
결과 단위lux
Sysfs`/sys/bus/iio/devices/iio:deviceX/in_illuminance_input`

원시 입력, 변환 계수, 결과 경로를 연결합니다.

조도 값 생성
Wide-spectrum green raw sample 취득`GREEN_RAW × 2.15e-3` 계산Lux 값 생성`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

센서는 색상 성분마다 감도가 다르므로 드라이버가 보정 계수를 노출합니다.

OPT4060 RGB scale sysfs
색상Sysfs attribute예제 scale
Red`/sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale`2.4
Green`/sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale`1.0
Blue`/sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale`1.3

색상별 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)
RGB 보정 계산
결과Raw channelScale
R`RED_RAW``SCALE_RED(2.4)`
G`GREEN_RAW``SCALE_GREEN(1.0)`
B`BLUE_RAW``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)
정규화된 RGB
공식
`R_NORMALIZED``R / (R + G + B)`
`G_NORMALIZED``G / (R + G + B)`
`B_NORMALIZED``B / (R + G + B)`

세 채널 합을 분모로 사용해 intensity 영향을 제거합니다.

색상 비율 계산
Red·green·blue raw sample 읽기채널별 감도 scale 곱하기보정된 R·G·B 생성합계 R + G + B 계산각 채널을 합계로 나눠 normalized ratio 생성

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.