Device driver for the AMS TSL4531 sensor. More...

Detailed Description

Device driver for the AMS TSL4531 sensor.

Juan I Carrano
Daniel Petry

Definition in file tsl4531x.h.

#include <stdint.h>
#include "periph/i2c.h"
+ Include dependency graph for tsl4531x.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tsl4531x_params_t
 Device initialization parameters. More...
struct  tsl4531x_t
 Device descriptor. More...


enum  tsl4531x_intgn_time_t { TSL4531X_INTEGRATE_400MS = 0, TSL4531X_INTEGRATE_200MS = 1, TSL4531X_INTEGRATE_100MS = 2 }
 Integration times.


int tsl4531x_init (tsl4531x_t *dev, const tsl4531x_params_t *params)
 Initialize the TSL4531x device. More...
int tsl4531x_set_low_power_mode (tsl4531x_t *dev, uint8_t low_power_on)
 Set the low power mode of the driver on or off. More...
int tsl4531x_start_sample (tsl4531x_t *dev)
 Start collecting sample in low power mode. More...
uint32_t tsl4531x_time_until_sample_ready (tsl4531x_t *dev)
 Deliver time in microseconds until sample is ready, or zero if it is ready. More...
int tsl4531x_get_sample (const tsl4531x_t *dev)
 Reads the sample from the device immediately. More...
int tsl4531x_simple_read (tsl4531x_t *dev)
 Reads the sample from the device. More...

Fixed values for different members of the TSL4531x series

Part numbers

#define TSL45311_PARTNO   (0x8)
#define TSL45313_PARTNO   (0x9)
#define TSL45315_PARTNO   (0xA)
#define TSL45317_PARTNO   (0xB)
#define TSL45311_ADDR   (0x39)
 TSL4531x I2C addresses.
#define TSL45313_ADDR   (0x39)
#define TSL45315_ADDR   (0x29)
#define TSL45317_ADDR   (0x29)