IoT Drivers  v3.3.0 (S2022)
Engineering in Software Technology
tsl2591.h
Go to the documentation of this file.
1 
54 #ifndef TSL2591_H_
55 #define TSL2591_H_
56 
57 #include <stdbool.h>
58 
65 typedef enum {
66  TSL2591_GAIN_LOW = 0x00
71 
79 typedef enum {
87 
96 typedef struct
97 {
98  uint16_t fullSpectrumRaw;
99  uint16_t infraredRaw;
100  uint16_t visibleRaw;
102 
109 typedef enum
110 {
111  TSL2591_OK
121 
122 /* ======================================================================================================================= */
141 
142 /* ======================================================================================================================= */
156 
157 /* ======================================================================================================================= */
170 
171 /* ======================================================================================================================= */
184 
185 /* ======================================================================================================================= */
198 
199 /* ======================================================================================================================= */
208 uint8_t tsl2591_getDeviceId(void);
209 
210 /* ======================================================================================================================= */
249 
250 /* ======================================================================================================================= */
258 
259 /* ======================================================================================================================= */
267 
268 /* ======================================================================================================================= */
281 
282 /* ======================================================================================================================= */
295 
296 /* ======================================================================================================================= */
309 
310 /* ======================================================================================================================= */
323 
324 /* ======================================================================================================================= */
337 
338 /* ======================================================================================================================= */
352 
482 #endif /* TSL2591_H_ */
tsl2591_initialise
tsl2591_returnCode_t tsl2591_initialise(void(*callBack)(tsl2591_returnCode_t))
Initialise the driver.
tsl2591_combinedData_t::fullSpectrumRaw
uint16_t fullSpectrumRaw
Definition: tsl2591.h:98
TSL2591_INTEGRATION_TIME_200MS
@ TSL2591_INTEGRATION_TIME_200MS
Definition: tsl2591.h:81
tsl2591_returnCode_t
tsl2591_returnCode_t
TSL2591 Driver return codes.
Definition: tsl2591.h:110
TSL2591_OUT_OF_HEAP
@ TSL2591_OUT_OF_HEAP
Definition: tsl2591.h:119
tsl2591_getGain
tsl2591_gain_t tsl2591_getGain(void)
Retrieve the TSL2591 sensor's current gain setting.
tsl2591_combinedData_t::infraredRaw
uint16_t infraredRaw
Definition: tsl2591.h:99
TSL2591_GAIN_MAX
@ TSL2591_GAIN_MAX
Definition: tsl2591.h:69
TSL2591_GAIN_HIGH
@ TSL2591_GAIN_HIGH
Definition: tsl2591.h:68
TSL2591_INTEGRATION_TIME_400MS
@ TSL2591_INTEGRATION_TIME_400MS
Definition: tsl2591.h:83
tsl2591_gain_t
tsl2591_gain_t
TSL2591 Gain configuration.
Definition: tsl2591.h:65
tsl259_getVisibleRaw
tsl2591_returnCode_t tsl259_getVisibleRaw(uint16_t *visible)
Retrieve the latest visible light spectrum as raw data fetched from the TSL2591 sensor.
TSL2591_INTEGRATION_TIME_600MS
@ TSL2591_INTEGRATION_TIME_600MS
Definition: tsl2591.h:85
tsl2591_integrationTime_t
tsl2591_integrationTime_t
TSL2591 Integration time configuration.
Definition: tsl2591.h:79
tsl2591_getDeviceId
uint8_t tsl2591_getDeviceId(void)
Retrieve the TSL2591 sensor's device ID.
tsl2591_fetchData
tsl2591_returnCode_t tsl2591_fetchData(void)
Start fetching the TSL2591 sensor's light data.
tsl2591_disable
tsl2591_returnCode_t tsl2591_disable(void)
Disable/Power down the TSL2591 sensor.
TSL2591_INTEGRATION_TIME_500MS
@ TSL2591_INTEGRATION_TIME_500MS
Definition: tsl2591.h:84
TSL2591_DRIVER_NOT_INITIALISED
@ TSL2591_DRIVER_NOT_INITIALISED
Definition: tsl2591.h:118
TSL2591_GAIN_MED
@ TSL2591_GAIN_MED
Definition: tsl2591.h:67
tsl2591_getIntegrationTime
tsl2591_integrationTime_t tsl2591_getIntegrationTime(void)
Retrieve the TSL2591 sensor's current integration time.
tsl2591_setGainAndIntegrationTime
tsl2591_returnCode_t tsl2591_setGainAndIntegrationTime(tsl2591_gain_t gain, tsl2591_integrationTime_t integrationTime)
Sets the TSL2591 sensor's Gain and Integration time.
TSL2591_ERROR
@ TSL2591_ERROR
Definition: tsl2591.h:117
tsl2591_getCombinedDataRaw
tsl2591_returnCode_t tsl2591_getCombinedDataRaw(tsl2591_combinedData_t *combinedData)
Retrieve the latest combined light spectrum's as raw data fetched from the TSL2591 sensor.
TSL2591_BUSY
@ TSL2591_BUSY
Definition: tsl2591.h:116
TSL2591_OVERFLOW
@ TSL2591_OVERFLOW
Definition: tsl2591.h:114
tsl2591_destroy
tsl2591_returnCode_t tsl2591_destroy(void)
Destroy the TSL2591 driver.
tsl2591_combinedData_t
TSL2591 Light measure data struct.
Definition: tsl2591.h:97
TSL2591_INTEGRATION_TIME_300MS
@ TSL2591_INTEGRATION_TIME_300MS
Definition: tsl2591.h:82
TSL2591_UNDERFLOW
@ TSL2591_UNDERFLOW
Definition: tsl2591.h:115
tsl2591_getInfraredRaw
tsl2591_returnCode_t tsl2591_getInfraredRaw(uint16_t *infrared)
Retrieve the latest infrared light spectrum as raw data fetched from the TSL2591 sensor.
tsl2591_fetchDeviceId
tsl2591_returnCode_t tsl2591_fetchDeviceId(void)
Start fetching the TSL2591 sensor's device ID.
tsl2591_combinedData_t::visibleRaw
uint16_t visibleRaw
Definition: tsl2591.h:100
tsl2591_getFullSpectrumRaw
tsl2591_returnCode_t tsl2591_getFullSpectrumRaw(uint16_t *fullSpectrum)
Retrieve the latest full light spectrum as raw data fetched from the TSL2591 sensor.
TSL2591_INTEGRATION_TIME_100MS
@ TSL2591_INTEGRATION_TIME_100MS
Definition: tsl2591.h:80
tsl2591_getLux
tsl2591_returnCode_t tsl2591_getLux(float *lux)
Retrieve the latest visible light spectrum as lux fetched from the TSL2591 sensor.
TSL2591_DATA_READY
@ TSL2591_DATA_READY
Definition: tsl2591.h:112
TSL2591_DEV_ID_READY
@ TSL2591_DEV_ID_READY
Definition: tsl2591.h:113
tsl2591_enable
tsl2591_returnCode_t tsl2591_enable(void)
Enable/Power up the TSL2591 sensor.
TSL2591_OK
@ TSL2591_OK
Definition: tsl2591.h:111
TSL2591_GAIN_LOW
@ TSL2591_GAIN_LOW
Definition: tsl2591.h:66