tsl4531x_internals.h File Reference

Internal addresses, registers, constants for the TSL4531x sensor. More...

Detailed Description

Internal addresses, registers, constants for the TSL4531x sensor.

Internal addresses, registers, constants for the TSL4531x sensor.

Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr
Daniel Petry danie.nosp@m.lpet.nosp@m.ry@ca.nosp@m.ntab.nosp@m..net
Juan I Carrano j.car.nosp@m.rano.nosp@m.@fu-b.nosp@m.erli.nosp@m.n.de

Derived from the internals.h file for the tsl2561 driver.

Definition in file tsl4531x_internals.h.

Go to the source code of this file.

TSL4531x internal registers

#define TSL4531X_CONTROL_REG   (0x0)
 sets power mode
 
#define TSL4531X_CONFIGURATION_REG   (0x01)
 sets power mode
 
#define TSL4531X_ALSDATA1_REG   (0x04)
 contains DATALOW
 
#define TSL4531X_ALSDATA2_REG   (0x05)
 contains DATAHIGH
 
#define TSL4531X_ID_REG   (0x0A)
 contains part no above
 

TSL4531x power modes

#define TSL4531X_MODE_POWER_DOWN   (0x00)
 
#define TSL4531X_MODE_RESERVED   (0x01)
 
#define TSL4531X_MODE_SINGLE_ADC_CYCLE   (0x02)
 Runs a single ADC cycle then returns to power down.
 
#define TSL4531X_MODE_NORMAL   (0x03)
 
#define TSL4531X_PSAVESKIP_OFF   (0)
 
#define TSL4531X_PSAVESKIP_ON   (1)
 

TSL4531x macros

#define TSL4531X_COMMAND(addr)   ((1 << 7) | (addr))
 
#define TSL4531X_CONFIG(psaveskip, tcntrl)   (((!!(psaveskip)) << 3) | (tcntrl))
 
#define TSL4531X_CONTROL(mode)   (mode)
 
#define TSL4531X_GET_PARTNO(id_reg)   ((id_reg) >> 4)
 
#define MULTIPLY_DATA(data_raw, integration_time)   ((data_raw) << (integration_time))
 
#define TSL4531X_POWER_MODE(mode)   ((!mode) * (0x03))
 
#define TSL4531X_GET_INTEGRATION_TIME_USEC(int_time_setting, psaveskip)   (uint32_t)1000 * (((0x04 >> int_time_setting) * 105) + ((!psaveskip) * (60 >> int_time_setting)))