Adafruit VCNL4040 Arduino Library
|
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Wire.h>
Go to the source code of this file.
Classes | |
class | Adafruit_VCNL4040 |
Class that stores state and functions for interacting with the VCNL4040 I2C Digital Potentiometer. More... | |
Macros | |
#define | VCNL4040_I2CADDR_DEFAULT 0x60 |
VCNL4040 default i2c address. | |
#define | VCNL4040_ALS_CONFIG 0x00 |
Ambient light sensor configuration register. | |
#define | VCNL4040_ALS_THDH 0x01 |
Ambient light high threshold register. | |
#define | VCNL4040_ALS_THDL 0x02 |
Ambient light low threshold register. | |
#define | VCNL4040_PS_CONF1_L 0x03 |
Proximity sensor configuration 1/2 register. | |
#define | VCNL4040_PS_MS_H 0x04 |
Proximity sensor configuration 1/2 register. | |
#define | VCNL4040_PS_THDL 0x06 |
Proximity sensor low threshold register. | |
#define | VCNL4040_PS_THDH 0x07 |
Proximity sensor high threshold register. | |
#define | VCNL4040_PS_DATA 0x08 |
Proximity sensor data register. | |
#define | VCNL4040_ALS_DATA 0x09 |
Ambient light sensor data register. | |
#define | VCNL4040_WHITE_DATA 0x0A |
White light sensor data register. | |
#define | VCNL4040_INT_FLAG 0x0B |
Interrupt status register. | |
#define | VCNL4040_DEVICE_ID 0x0C |
Device ID. | |
Typedefs | |
typedef enum led_current | VCNL4040_LEDCurrent |
Proximity LED current values. More... | |
typedef enum led_duty_cycle | VCNL4040_LEDDutyCycle |
Proximity LED duty cycle values. More... | |
typedef enum ambient_integration_time | VCNL4040_AmbientIntegration |
Ambient light integration time values. More... | |
typedef enum proximity_integration_time | VCNL4040_ProximityIntegration |
Proximity measurement integration time values. More... | |
typedef enum proximity_type | VCNL4040_ProximityType |
Proximity interrupt types. More... | |
typedef enum interrupt_type | VCNL4040_InterruptType |
Interrupt types. More... | |
Enumerations | |
enum | led_current { VCNL4040_LED_CURRENT_50MA, VCNL4040_LED_CURRENT_75MA, VCNL4040_LED_CURRENT_100MA, VCNL4040_LED_CURRENT_120MA, VCNL4040_LED_CURRENT_140MA, VCNL4040_LED_CURRENT_160MA, VCNL4040_LED_CURRENT_180MA, VCNL4040_LED_CURRENT_200MA } |
Proximity LED current values. More... | |
enum | led_duty_cycle { VCNL4040_LED_DUTY_1_40, VCNL4040_LED_DUTY_1_80, VCNL4040_LED_DUTY_1_160, VCNL4040_LED_DUTY_1_320 } |
Proximity LED duty cycle values. More... | |
enum | ambient_integration_time { VCNL4040_AMBIENT_INTEGRATION_TIME_80MS, VCNL4040_AMBIENT_INTEGRATION_TIME_160MS, VCNL4040_AMBIENT_INTEGRATION_TIME_320MS, VCNL4040_AMBIENT_INTEGRATION_TIME_640MS } |
Ambient light integration time values. More... | |
enum | proximity_integration_time { VCNL4040_PROXIMITY_INTEGRATION_TIME_1T, VCNL4040_PROXIMITY_INTEGRATION_TIME_1_5T, VCNL4040_PROXIMITY_INTEGRATION_TIME_2T, VCNL4040_PROXIMITY_INTEGRATION_TIME_2_5T, VCNL4040_PROXIMITY_INTEGRATION_TIME_3T, VCNL4040_PROXIMITY_INTEGRATION_TIME_3_5T, VCNL4040_PROXIMITY_INTEGRATION_TIME_4T, VCNL4040_PROXIMITY_INTEGRATION_TIME_8T } |
Proximity measurement integration time values. More... | |
enum | proximity_type { VCNL4040_PROXIMITY_INT_DISABLE, VCNL4040_PROXIMITY_INT_CLOSE, VCNL4040_PROXIMITY_INT_AWAY, VCNL4040_PROXIMITY_INT_CLOSE_AWAY } |
Proximity interrupt types. More... | |
enum | interrupt_type { VCNL4040_PROXIMITY_AWAY, VCNL4040_PROXIMITY_CLOSE, VCNL4040_AMBIENT_HIGH = 4, VCNL4040_AMBIENT_LOW } |
Interrupt types. More... | |
I2C Driver for VCNL4040 proximity and ambient light sensor
This is a library for the Adafruit VCNL4040 breakout: https://www.adafruit.com/product/4161
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
BSD license (see license.txt)
typedef enum led_current VCNL4040_LEDCurrent |
Proximity LED current values.
Allowed values for setProximityLEDCurrent
.
typedef enum led_duty_cycle VCNL4040_LEDDutyCycle |
Proximity LED duty cycle values.
Allowed values for setProximityLEDDutyCycle
.
typedef enum ambient_integration_time VCNL4040_AmbientIntegration |
Ambient light integration time values.
Allowed values for setAmbientIntegrationTime
.
typedef enum proximity_integration_time VCNL4040_ProximityIntegration |
Proximity measurement integration time values.
Allowed values for setProximityIntegrationTime
.
typedef enum proximity_type VCNL4040_ProximityType |
Proximity interrupt types.
Allowed values for enableProximityInterrupts
.
typedef enum interrupt_type VCNL4040_InterruptType |
Interrupt types.
Values to be matched against the byte returned from getInterruptStatus
.
enum led_current |
Proximity LED current values.
Allowed values for setProximityLEDCurrent
.
enum led_duty_cycle |
Proximity LED duty cycle values.
Allowed values for setProximityLEDDutyCycle
.
Ambient light integration time values.
Allowed values for setAmbientIntegrationTime
.
Proximity measurement integration time values.
Allowed values for setProximityIntegrationTime
.
enum proximity_type |
Proximity interrupt types.
Allowed values for enableProximityInterrupts
.
enum interrupt_type |
Interrupt types.
Values to be matched against the byte returned from getInterruptStatus
.