Synopsis
CTL_STATUS_t tsl2561_initialize_i2c(TSL2561_DRIVER_t *self,
                                    CTL_I2C_BUS_t *bus,
                                    int addr);
Description

tsl2561_initialize_i2c initializes the TS2561 ambient light sensor self on I2C bus bus using the 8-bit I2C address addr.

During initialization, tsl2561_initialize_i2c attempts to communicate with the sensor to set the fastest integration time with lowest gain.

Once the light sensor interface is initialized, you can use all standard light sensor methods from the sensor API on the interface's core member.

Return Value

tsl2561_initialize_i2c returns a standard status code.

Thread Safety

tsl2561_initialize_i2c is thread-safe if a mutex is associated with the I2C bus bus.

See Also

<ctl_sensors.h>