Loading...
Searching...
No Matches
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)))
 

Macro Definition Documentation

◆ MULTIPLY_DATA

#define MULTIPLY_DATA (   data_raw,
  integration_time 
)    ((data_raw) << (integration_time))

Definition at line 82 of file tsl4531x_internals.h.

◆ TSL4531X_ALSDATA1_REG

#define TSL4531X_ALSDATA1_REG   (0x04)

contains DATALOW

Definition at line 38 of file tsl4531x_internals.h.

◆ TSL4531X_ALSDATA2_REG

#define TSL4531X_ALSDATA2_REG   (0x05)

contains DATAHIGH

Definition at line 39 of file tsl4531x_internals.h.

◆ TSL4531X_COMMAND

#define TSL4531X_COMMAND (   addr)    ((1 << 7) | (addr))

Definition at line 65 of file tsl4531x_internals.h.

◆ TSL4531X_CONFIG

#define TSL4531X_CONFIG (   psaveskip,
  tcntrl 
)    (((!!(psaveskip)) << 3) | (tcntrl))

Definition at line 68 of file tsl4531x_internals.h.

◆ TSL4531X_CONFIGURATION_REG

#define TSL4531X_CONFIGURATION_REG   (0x01)

sets power mode

Definition at line 37 of file tsl4531x_internals.h.

◆ TSL4531X_CONTROL

#define TSL4531X_CONTROL (   mode)    (mode)

Definition at line 71 of file tsl4531x_internals.h.

◆ TSL4531X_CONTROL_REG

#define TSL4531X_CONTROL_REG   (0x0)

sets power mode

Definition at line 36 of file tsl4531x_internals.h.

◆ TSL4531X_GET_INTEGRATION_TIME_USEC

#define TSL4531X_GET_INTEGRATION_TIME_USEC (   int_time_setting,
  psaveskip 
)     (uint32_t)1000 * (((0x04 >> int_time_setting) * 105) + ((!psaveskip) * (60 >> int_time_setting)))

Definition at line 96 of file tsl4531x_internals.h.

◆ TSL4531X_GET_PARTNO

#define TSL4531X_GET_PARTNO (   id_reg)    ((id_reg) >> 4)

Definition at line 73 of file tsl4531x_internals.h.

◆ TSL4531X_ID_REG

#define TSL4531X_ID_REG   (0x0A)

contains part no above

Definition at line 40 of file tsl4531x_internals.h.

◆ TSL4531X_MODE_NORMAL

#define TSL4531X_MODE_NORMAL   (0x03)

Definition at line 51 of file tsl4531x_internals.h.

◆ TSL4531X_MODE_POWER_DOWN

#define TSL4531X_MODE_POWER_DOWN   (0x00)

Definition at line 47 of file tsl4531x_internals.h.

◆ TSL4531X_MODE_RESERVED

#define TSL4531X_MODE_RESERVED   (0x01)

Definition at line 48 of file tsl4531x_internals.h.

◆ TSL4531X_MODE_SINGLE_ADC_CYCLE

#define TSL4531X_MODE_SINGLE_ADC_CYCLE   (0x02)

Runs a single ADC cycle then returns to power down.

Definition at line 50 of file tsl4531x_internals.h.

◆ TSL4531X_POWER_MODE

#define TSL4531X_POWER_MODE (   mode)    ((!mode) * (0x03))

Definition at line 85 of file tsl4531x_internals.h.

◆ TSL4531X_PSAVESKIP_OFF

#define TSL4531X_PSAVESKIP_OFF   (0)

Definition at line 56 of file tsl4531x_internals.h.

◆ TSL4531X_PSAVESKIP_ON

#define TSL4531X_PSAVESKIP_ON   (1)

Definition at line 57 of file tsl4531x_internals.h.