q ambient light sensor with the .Xr envsys 4 API.
p The TSL2560 is designed to work with SMBus at 100 kHz. The TSL2561 is designed to work with I2C Fast-Mode at 400 kHz. The sensors come in a variety of packages, including 6-lead Chipscale
q CS , 6-lead TMB
q T , dual flat no-lead
q FN , and 6-lead ChipLED
q CL . The .Sq CS package requires a different set of coefficients for calculating the Lux value from the raw sensor data. This behavior is enabled by specifying the flag .Dv 0x1 in the kernel configuration file or by using a .Xr sysctl 8 variable; see below.
p The .Nm driver exports some .Xr sysctl 8 variables to control the behavior of the sensor and driver: l -tag -width "XX" t hw.tsllux0.cs_package Pq boolean, read-write This variable indicates if the driver instance has been configured to use the coeffecients appropriate for the .Sq CS package variant. t hw.tsllux0.auto_gain Pq boolean, read-write This variable indicates if the driver has been configured to use an auto-gain algorithm to improve sensitivity of the sensor while taking care to avoid sensor saturation. Auto-gain is disabled by default. t hw.tsllux0.gain Pq integer, read-write This variable indicates the selected sensor gain. If auto-gain is enabled, this will reflect the current gain setting selected by the auto-gain algorithm. Otherwise, it reflects the previously-configured gain. Valid values are .Dv 1 and .Dv 16 . The default gain is .Dv 1 . Writing to this variable implicitly disables auto-gain. t hw.tsllux0.integration_time Pq integer, read-write This variable indicates the selected analog-to-digital converter integration time. Longer integration times correspond to more accurate readings, at the cost of more costly read operation. Valid values are .Dv 13 Pq 13.7ms , .Dv 101 Pq 101ms , and .Dv 402 Pq 402ms . The default value is .Dv 101 . Note that that due to the granularity of sleep timing in the kernel, the .Nm driver will busy-wait for wait times less than 1 Hz, and add an additional sleep clock tick for wait times greater than 1 Hz. See .Xr hz 9 . .El .Sh SEE ALSO .Xr envsys 4 , .Xr iic 4 .Sh HISTORY The .Nm driver first appeared in .Nx 9.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Jason R Thorpe Aq Mt thorpej (at] NetBSD.org . .Sh BUGS The driver does not currently support the sensor's interrupt features or the sensor's manual integration timing feature.