Device support for APDS9960 gesture / RGB / proximity sensor. More...
Device support for APDS9960 gesture / RGB / proximity sensor.
#include <apds9960.h>
Classes | |
struct | Config |
Public Types | |
enum | Result { OK = 0 , ERR } |
Public Member Functions | |
Apds9960 () | |
~Apds9960 () | |
void | enable (bool en=true) |
Result | Init (Config config) |
void | SetADCIntegrationTime (uint16_t iTimeMS) |
float | GetADCIntegrationTime () |
void | SetADCGain (uint8_t aGain) |
void | SetGestureOffset (uint8_t offset_up, uint8_t offset_down, uint8_t offset_left, uint8_t offset_right) |
void | SetGestureDimensions (uint8_t dims) |
void | SetGestureFIFOThreshold (uint8_t thresh) |
void | SetGestureGain (uint8_t gain) |
void | SetGestureProximityThreshold (uint8_t thresh) |
void | Enable (bool en) |
void | EnableGesture (bool en) |
void | EnableProximity (bool en) |
void | EnableColor (bool en) |
void | SetColorInterrupt (bool en) |
void | SetProximityInterrupt (bool en) |
void | ClearInterrupt () |
void | ResetCounts () |
void | Write8 (uint8_t reg, uint8_t data) |
uint8_t | Read8 (uint8_t reg) |
uint16_t | Read16R (uint8_t reg) |
uint8_t | ReadProximity () |
void | SetProxGain (uint8_t pGain) |
uint8_t | GetProxGain () |
void | SetProxPulse (uint8_t pLen, uint8_t pulses) |
bool | GestureValid () |
uint8_t | ReadGesture () |
void | SetLED (uint8_t drive, uint8_t boost) |
uint16_t | CalculateColorTemperature (uint16_t r, uint16_t g, uint16_t b) |
uint16_t | CalculateLux (uint16_t r, uint16_t g, uint16_t b) |
void | SetIntLimits (uint16_t low, uint16_t high) |
bool | ColorDataReady () |
uint16_t | GetColorDataRed () |
uint16_t | GetColorDataGreen () |
uint16_t | GetColorDataBlue () |
uint16_t | GetColorDataClear () |
void | GetColorData (uint16_t *r, uint16_t *g, uint16_t *b, uint16_t *c) |
enum daisy::Apds9960::Result |
|
inline |
|
inline |
|
inline |
Converts the raw R/G/B values to color temperature in degrees Kelvin
r | Red value |
g | Green value |
b | Blue value |
|
inline |
Calculate ambient light values
r | Red value |
g | Green value |
b | Blue value |
|
inline |
Clears interrupt
|
inline |
Returns status of color data
|
inline |
Enables the device / Disables the device (putting it in lower power sleep mode)
en | Enable |
void daisy::Apds9960< Transport >::enable | ( | bool | en = true | ) |
|
inline |
Enable color readings
en | Enable |
|
inline |
Enable gesture readings
en | Enable |
|
inline |
Enable proximity readings
en | Enable |
|
inline |
Returns validity status of a gesture
|
inline |
Returns the integration time for the ADC of the APDS9960, in millis
|
inline |
Reads the raw red, green, blue and clear channel values
*r | Red value |
*g | Green value |
*b | Blue value |
*c | Clear channel value |
|
inline |
Reads the raw blue channel value
|
inline |
Reads the raw clear channel value
|
inline |
Reads the raw green channel value
|
inline |
Reads the raw red channel value
|
inline |
Returns the Proximity gain on the APDS9960
|
inline |
Initialize the APDS9960 device
config | Configuration settings |
|
inline |
|
inline |
|
inline |
Reads gesture
< Gesture Up
< Gesture Down
< Gesture Left
< Gesture Right
|
inline |
Read proximity data
|
inline |
Resets gesture counts
|
inline |
Adjusts the color/ALS gain on the APDS9960 (adjusts the sensitivity to light)
aGain | Gain |
|
inline |
Sets the integration time for the ADC of the APDS9960, in millis
iTimeMS | Integration time |
|
inline |
Enables/disables color interrupt
en | Enable / disable |
|
inline |
Sets gesture dimensions
dims | Dimensions |
|
inline |
Sets gesture FIFO Threshold
thresh | Threshold |
|
inline |
Sets gesture sensor gain
gain | Gain |
|
inline |
Sets gesture sensor offset
offset_up | Up offset |
offset_down | Down offset |
offset_left | Left offset |
offset_right | Right offset |
|
inline |
Sets gesture sensor threshold
thresh | Threshold |
|
inline |
Sets interrupt limits
low | Low limit |
high | High limit |
|
inline |
Set LED brightness for proximity/gesture
drive | LED Drive (0,3) -> {100mA, 50mA, 25mA, 12.5mA} |
boost | LED Boost (0,3) -> {100%, 150%, 200%, 300%} |
|
inline |
Adjusts the Proximity gain on the APDS9960
pGain | Gain |
|
inline |
Enables / Disables color interrupt
en | Enable / disable |
|
inline |
Sets number of proxmity pulses
pLen | Pulse Length |
pulses | Number of pulses |
|
inline |