CTL_STATUS_t ltr501als_initialize_i2c(CTL_LIGHT_SENSOR_t *self,
                                      CTL_I2C_BUS_t *bus,
                                      int addr);

ltr501als_initialize_i2c initializes the LTR-501ALS ambient light sensor self on I2C bus bus using the 8-bit I2C address addr.

During initialization, ltr501als_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

ltr501als_initialize_i2c returns a standard status code.

Thread Safety

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

See Also