TSLLUX(4) Device Drivers Manual TSLLUX(4)

tsllux
Taos TSL256x Light-to-Digital Coverter

tsllux* at iic? addr 0x29 flags 0x0
tsllux* at iic? addr 0x39 flags 0x0
tsllux* at iic? addr 0x49 flags 0x0

The tsllux driver provides support for the Taos TSL2560 and TSL2561 light-to-digital converter (ambient light sensor) with the envsys(4) API.

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 (CS), 6-lead TMB (T), dual flat no-lead (FN), and 6-lead ChipLED (CL). The ‘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 0x1 in the kernel configuration file or by using a sysctl(8) variable; see below.

The tsllux driver exports some sysctl(8) variables to control the behavior of the sensor and driver:

hw.tsllux0.cs_package (boolean, read-write)
This variable indicates if the driver instance has been configured to use the coeffecients appropriate for the ‘CS’ package variant.
hw.tsllux0.auto_gain (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.
hw.tsllux0.gain (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 1 and 16. The default gain is 1. Writing to this variable implicitly disables auto-gain.
hw.tsllux0.integration_time (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 13 (13.7ms), 101 (101ms), and 402 (402ms). The default value is 101. Note that that due to the granularity of sleep timing in the kernel, the tsllux 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 hz(9).

envsys(4), iic(4)

The tsllux driver first appeared in NetBSD 9.0.

The tsllux driver was written by Jason R Thorpe <thorpej@NetBSD.org>.

The driver does not currently support the sensor's interrupt features or the sensor's manual integration timing feature.
May 21, 2018 NetBSD 9.4