18c2ecf20Sopenharmony_ci* UPISEMI us5182d I2C ALS and Proximity sensor 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciRequired properties: 48c2ecf20Sopenharmony_ci- compatible: must be "upisemi,usd5182" 58c2ecf20Sopenharmony_ci- reg: the I2C address of the device 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciOptional properties: 88c2ecf20Sopenharmony_ci- upisemi,glass-coef: glass attenuation factor - compensation factor of 98c2ecf20Sopenharmony_ci resolution 1000 for material transmittance. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci- upisemi,dark-ths: array of 8 elements containing 16-bit thresholds (adc 128c2ecf20Sopenharmony_ci counts) corresponding to every scale. 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci- upisemi,upper-dark-gain: 8-bit dark gain compensation factor(4 int and 4 158c2ecf20Sopenharmony_ci fractional bits - Q4.4) applied when light > threshold 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci- upisemi,lower-dark-gain: 8-bit dark gain compensation factor(4 int and 4 188c2ecf20Sopenharmony_ci fractional bits - Q4.4) applied when light < threshold 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci- upisemi,continuous: This chip has two power modes: one-shot (chip takes one 218c2ecf20Sopenharmony_ci measurement and then shuts itself down) and continuous ( 228c2ecf20Sopenharmony_ci chip takes continuous measurements). The one-shot mode is 238c2ecf20Sopenharmony_ci more power-friendly but the continuous mode may be more 248c2ecf20Sopenharmony_ci reliable. If this property is specified the continuous 258c2ecf20Sopenharmony_ci mode will be used instead of the default one-shot one for 268c2ecf20Sopenharmony_ci raw reads. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciIf the optional properties are not specified these factors will default to the 298c2ecf20Sopenharmony_civalues in the below example. 308c2ecf20Sopenharmony_ciThe glass-coef defaults to no compensation for the covering material. 318c2ecf20Sopenharmony_ciThe threshold array defaults to experimental values that work with US5182D 328c2ecf20Sopenharmony_cisensor on evaluation board - roughly between 12-32 lux. 338c2ecf20Sopenharmony_ciThere will be no dark-gain compensation by default when ALS > thresh 348c2ecf20Sopenharmony_ci(0 * dark-gain), and a 1.35 compensation factor when ALS < thresh. 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ciExample: 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci usd5182@39 { 398c2ecf20Sopenharmony_ci compatible = "upisemi,usd5182"; 408c2ecf20Sopenharmony_ci reg = <0x39>; 418c2ecf20Sopenharmony_ci upisemi,glass-coef = < 1000 >; 428c2ecf20Sopenharmony_ci upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>; 438c2ecf20Sopenharmony_ci upisemi,upper-dark-gain = /bits/ 8 <0x00>; 448c2ecf20Sopenharmony_ci upisemi,lower-dark-gain = /bits/ 8 <0x16>; 458c2ecf20Sopenharmony_ci }; 46