minix/drivers/tsl2550
Thomas Cort 75bd3009d3 libi2cdriver: add functions for IC register access
Many i2c device drivers used similar code to access registers on
the ICs they drive. This commit implements that functionality in
libi2cdriver and updates the drivers to use the library instead of
their own register access functions. The net result is 375+ fewer
lines of code and less work for people developing new drivers.

The two exceptions were cat24c256 and parts of tda19988. They access
the bus in uncommon ways. It doesn't make sense at this time to
move their read/write functions into libi2cdriver.

Change-Id: Id8280b71af33b710a49944d7f20a7262be9f5988
2013-09-18 08:10:26 -04:00
..
Makefile tsl2550: driver for the TSL2550 light sensor 2013-08-22 16:53:49 -04:00
README.txt tsl2550: driver for the TSL2550 light sensor 2013-08-22 16:53:49 -04:00
tsl2550.c libi2cdriver: add functions for IC register access 2013-09-18 08:10:26 -04:00

TSL2550 Driver (Ambient Light Sensor)
=====================================

Overview
--------

This is the driver for the ambient light sensor commonly found on the
WeatherCape expansion board for the BeagleBone.

Interface
---------

This driver implements the character device interface. It supports reading
through /dev/tsl2550b{1,3}s39. When read from, it returns a string containing
a data label, a colon, and the sensor value.

Example output of `cat /dev/tsl2550b3s39`:

ILLUMINANCE     : 830

Illuminance is expressed in lux. Valid values are 0 to 1846.

Limitations
-----------

Extended mode isn't implemented. Normal mode should be sufficient for most
applications.

Testing the Code
----------------

The driver should have been started by a script in /etc/rc.capes/ If not,
this is how you start up an instance:

cd /dev && MAKEDEV tsl2550b3s39
/bin/service up /usr/sbin/tsl2550 -label tsl2550.3.39 -dev /dev/tsl2550b3s39 \
	-args 'bus=3 address=0x39'

Getting the sensor value:

cat /dev/tsl2550b3s39

Killing an instance:

/bin/service down tsl2550.3.39