Device driver interface for the VCNL40X0 sensors family. More...

Detailed Description

Device driver interface for the VCNL40X0 sensors family.

Note
VCNL4010, VCNL4020 and VCNL4040 are supported.
Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Definition in file vcnl40x0.h.

#include "saul.h"
#include "periph/i2c.h"
+ Include dependency graph for vcnl40x0.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vcnl40x0_params_t
 Device initialization parameters. More...
 
struct  vcnl40x0_t
 Device descriptor for the VCNL40X0 sensor. More...
 

Enumerations

enum  {
  VCNL40X0_PROXIMITY_RATE_2 = 0, VCNL40X0_PROXIMITY_RATE_4, VCNL40X0_PROXIMITY_RATE_8, VCNL40X0_PROXIMITY_RATE_16,
  VCNL40X0_PROXIMITY_RATE_31, VCNL40X0_PROXIMITY_RATE_62, VCNL40X0_PROXIMITY_RATE_125, VCNL40X0_PROXIMITY_RATE_250
}
 Proximity measure rate. More...
 
enum  {
  VCNL40X0_AMBIENT_RATE_1 = 0, VCNL40X0_AMBIENT_RATE_2, VCNL40X0_AMBIENT_RATE_3, VCNL40X0_AMBIENT_RATE_4,
  VCNL40X0_AMBIENT_RATE_5, VCNL40X0_AMBIENT_RATE_6, VCNL40X0_AMBIENT_RATE_8, VCNL40X0_AMBIENT_RATE_10
}
 Ambient light measurement rate. More...
 
enum  {
  VCNL40X0_AMBIENT_AVERAGE_1 = 0, VCNL40X0_AMBIENT_AVERAGE_2, VCNL40X0_AMBIENT_AVERAGE_4, VCNL40X0_AMBIENT_AVERAGE_8,
  VCNL40X0_AMBIENT_AVERAGE_16, VCNL40X0_AMBIENT_AVERAGE_32, VCNL40X0_AMBIENT_AVERAGE_64, VCNL40X0_AMBIENT_AVERAGE_128
}
 Ambient light number of conversions during one measurement cycle. More...
 
enum  { VCNL40X0_OK = 0, VCNL40X0_ERR_I2C, VCNL40X0_ERR_NODEV }
 Status and error return codes. More...
 

Functions

int vcnl40x0_init (vcnl40x0_t *dev, const vcnl40x0_params_t *params)
 Initialize the given VCNL40X0 device. More...
 
uint16_t vcnl40x0_read_proximity (const vcnl40x0_t *dev)
 Read proximity value from the vcnl40X0 device. More...
 
uint16_t vcnl40x0_read_ambient_light (const vcnl40x0_t *dev)
 Read ambient light value from the vcnl40X0 device. More...
 
uint16_t vcnl40x0_read_illuminance (const vcnl40x0_t *dev)
 Read illuminance value from the vcnl40X0 device. More...