1============================== 2OPT4060 driver 3============================== 4 51. Overview 6============================= 7 8This driver supports the Texas Instrument RGBW high resolution color sensor over 9I2C. 10https://www.ti.com/lit/gpn/opt4060 11 12The 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 18other drivers. 19 202. Illuminance calculation 21============================= 22 23Illuminance is calculated using the wide spectrum green channel. 24 25lux = GREEN_RAW x 2.15e-3 26 27The value is accessed from: 28/sys/bus/iio/devices/iio:deviceX/in_illuminance_input 29 30See section 8.4.5.2 in the data sheet for additional details. 31 323. Color scale values 33============================= 34 35The sensor has different sensitivity for the different color components and 36compensating factors are exposed from the driver. 37 38The 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 43A userspace application can multiply the raw values with the scale values so 44that for a particular test light source, typically white, the measurement 45intensity is the same across the different color channels. This is calculated 46in the following way: 47 48R = RED_RAW x SCALE_RED(2.4) 49G = GREEN_RAW x SCALE_GREEN(1.0) 50B = BLUE_RAW x SCALE_BLUE(1.3) 51 52The data sheet suggests using the scaled values to normalize the scaled R, G 53and B values. This is useful to get a value for the ratio between colors 54independent of light intensity. A userspace application can do this in the 55following way: 56 57R_NORMALIZED = R / (R + G + B) 58G_NORMALIZED = G / (R + G + B) 59B_NORMALIZED = B / (R + G + B) 60 61See section 8.4.5.2 in the data sheet for additional details. 62