74 TSL2561_GAIN_1X = 0x00,
75 TSL2561_GAIN_16X = 0x10,
Structure containing information related to the SMBus protocol.
Definition: tsl2561.h:85
Integrate over 402 milliseconds.
Definition: tsl2561.h:66
Invalid device.
Definition: tsl2561.h:51
tsl2561_gain_t gain
Current gain for measurements.
Definition: tsl2561.h:92
TSL2561CS (Chipscale)
Definition: tsl2561.h:53
void tsl2561_free(tsl2561_info_t **tsl2561_info)
Delete an existing TSL2561 info instance.
Definition: tsl2561.c:247
TSL2560CS (Chipscale)
Definition: tsl2561.h:52
bool init
True if struct has been initialised, otherwise false.
Definition: tsl2561.h:87
esp_err_t tsl2561_set_integration_time_and_gain(tsl2561_info_t *tsl2561_info, tsl2561_integration_time_t integration_time, tsl2561_gain_t gain)
Set the integration time and gain. These values are set together as they are programmed via the same ...
Definition: tsl2561.c:366
TSL2560T/FN/CL (TMB-6 or Dual Flat No-Lead-6 or ChipLED-6)
Definition: tsl2561.h:54
uint16_t tsl2561_infrared_t
The type of an infrared light measurement value.
Definition: tsl2561.h:80
tsl2561_device_type_t device_type
Detected type of device (Chipscale vs T/FN/CL)
Definition: tsl2561.h:90
smbus_info_t * smbus_info
Pointer to associated SMBus info.
Definition: tsl2561.h:89
esp_err_t tsl2561_device_id(const tsl2561_info_t *tsl2561_info, tsl2561_device_type_t *device, tsl2561_revision_t *revision)
Retrieve the Device Type ID and Revision number from the device.
Definition: tsl2561.c:300
tsl2561_info_t * tsl2561_malloc(void)
Construct a new TSL2561 info instance. New instance should be initialised before calling other functi...
Definition: tsl2561.c:232
uint32_t tsl2561_compute_lux(const tsl2561_info_t *tsl2561_info, tsl2561_visible_t visible, tsl2561_infrared_t infrared)
Compute the Lux approximation from a visible and infrared light measurement. The calculation is perfo...
Definition: tsl2561.c:386
tsl2561_device_type_t
Enum for recognised TSL256x devices.
Definition: tsl2561.h:49
esp_err_t tsl2561_read(tsl2561_info_t *tsl2561_info, tsl2561_visible_t *visible, tsl2561_infrared_t *infrared)
Retrieve a visible and infrared light measurement from the device. This function will sleep until the...
Definition: tsl2561.c:320
uint8_t tsl2561_revision_t
The type of the IC's revision value.
Definition: tsl2561.h:78
uint16_t tsl2561_visible_t
The type of a visible light measurement value.
Definition: tsl2561.h:79
Integrate over 13.7 milliseconds.
Definition: tsl2561.h:64
tsl2561_gain_t
Enum for supported gain values.
Definition: tsl2561.h:72
TSL2561T/FN/CL (TMB-6 or Dual Flat No-Lead-6 or ChipLED-6)
Definition: tsl2561.h:55
bool powered
True if the device has been powered up.
Definition: tsl2561.h:88
esp_err_t tsl2561_init(tsl2561_info_t *tsl2561_info, smbus_info_t *smbus_info)
Initialise a TSL2561 info instance with the specified SMBus information.
Definition: tsl2561.c:261
tsl2561_integration_time_t integration_time
Current integration time for measurements.
Definition: tsl2561.h:91
Integrate over 101 milliseconds.
Definition: tsl2561.h:65
tsl2561_integration_time_t
Enum for supported integration durations. These durations assume the default internal oscillator freq...
Definition: tsl2561.h:62