Class daisy::Apds9960¶
template <typename Transport>
Device support for APDS9960 gesture / RGB / proximity sensor. More...
#include <apds9960.h>
Classes¶
| Type | Name |
|---|---|
| struct | Config |
Public Types¶
| Type | Name |
|---|---|
| enum | Result |
Public Functions¶
| Type | Name |
|---|---|
| Apds9960 () |
|
| 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 | ClearInterrupt () |
| bool | ColorDataReady () |
| void | Enable (bool en) |
| void | EnableColor (bool en) |
| void | EnableGesture (bool en) |
| void | EnableProximity (bool en) |
| bool | GestureValid () |
| float | GetADCIntegrationTime () |
| void | GetColorData (uint16_t * r, uint16_t * g, uint16_t * b, uint16_t * c) |
| uint16_t | GetColorDataBlue () |
| uint16_t | GetColorDataClear () |
| uint16_t | GetColorDataGreen () |
| uint16_t | GetColorDataRed () |
| uint8_t | GetProxGain () |
| Result | Init (Config config) |
| uint16_t | Read16R (uint8_t reg) |
| uint8_t | Read8 (uint8_t reg) |
| uint8_t | ReadGesture () |
| uint8_t | ReadProximity () |
| void | ResetCounts () |
| void | SetADCGain (uint8_t aGain) |
| void | SetADCIntegrationTime (uint16_t iTimeMS) |
| void | SetColorInterrupt (bool en) |
| void | SetGestureDimensions (uint8_t dims) |
| void | SetGestureFIFOThreshold (uint8_t thresh) |
| void | SetGestureGain (uint8_t gain) |
| void | SetGestureOffset (uint8_t offset_up, uint8_t offset_down, uint8_t offset_left, uint8_t offset_right) |
| void | SetGestureProximityThreshold (uint8_t thresh) |
| void | SetIntLimits (uint16_t low, uint16_t high) |
| void | SetLED (uint8_t drive, uint8_t boost) |
| void | SetProxGain (uint8_t pGain) |
| void | SetProxPulse (uint8_t pLen, uint8_t pulses) |
| void | SetProximityInterrupt (bool en) |
| void | Write8 (uint8_t reg, uint8_t data) |
| void | enable (bool en=true) |
| ~Apds9960 () |
Detailed Description¶
Author:
beserge
Date:
December 2021
Public Types Documentation¶
enum Result¶
Public Functions Documentation¶
function Apds9960¶
function CalculateColorTemperature¶
Converts the raw R/G/B values to color temperature in degrees Kelvin
Parameters:
rRed valuegGreen valuebBlue value
Returns:
Color temperature
function CalculateLux¶
Calculate ambient light values
Parameters:
rRed valuegGreen valuebBlue value
Returns:
LUX value
function ClearInterrupt¶
Clears interrupt
function ColorDataReady¶
Returns status of color data
Returns:
True if color data ready, False otherwise
function Enable¶
Enables the device / Disables the device (putting it in lower power sleep mode)
Parameters:
enEnable
function EnableColor¶
Enable color readings
Parameters:
enEnable
function EnableGesture¶
Enable gesture readings
Parameters:
enEnable
function EnableProximity¶
Enable proximity readings
Parameters:
enEnable
function GestureValid¶
Returns validity status of a gesture
Returns:
Status (True/False)
function GetADCIntegrationTime¶
Returns the integration time for the ADC of the APDS9960, in millis
Returns:
Integration time
function GetColorData¶
inline void daisy::Apds9960::GetColorData (
uint16_t * r,
uint16_t * g,
uint16_t * b,
uint16_t * c
)
Reads the raw red, green, blue and clear channel values
Parameters:
*rRed value*gGreen value*bBlue value*cClear channel value
function GetColorDataBlue¶
Reads the raw blue channel value
Returns:
Blue channel value
function GetColorDataClear¶
Reads the raw clear channel value
Returns:
Clear channel value
function GetColorDataGreen¶
Reads the raw green channel value
Returns:
Green channel value
function GetColorDataRed¶
Reads the raw red channel value
Returns:
Red channel value
function GetProxGain¶
Returns the Proximity gain on the APDS9960
Returns:
Proxmity gain
function Init¶
Initialize the APDS9960 device
Parameters:
configConfiguration settings
function Read16R¶
function Read8¶
function ReadGesture¶
Reads gesture
Returns:
Received gesture (1,4) -> {UP, DOWN, LEFT, RIGHT}
function ReadProximity¶
Read proximity data
Returns:
Proximity
function ResetCounts¶
Resets gesture counts
function SetADCGain¶
Adjusts the color/ALS gain on the APDS9960 (adjusts the sensitivity to light)
Parameters:
aGainGain
function SetADCIntegrationTime¶
Sets the integration time for the ADC of the APDS9960, in millis
Parameters:
iTimeMSIntegration time
function SetColorInterrupt¶
Enables/disables color interrupt
Parameters:
enEnable / disable
function SetGestureDimensions¶
Sets gesture dimensions
Parameters:
dimsDimensions
function SetGestureFIFOThreshold¶
Sets gesture FIFO Threshold
Parameters:
threshThreshold
function SetGestureGain¶
Sets gesture sensor gain
Parameters:
gainGain
function SetGestureOffset¶
inline void daisy::Apds9960::SetGestureOffset (
uint8_t offset_up,
uint8_t offset_down,
uint8_t offset_left,
uint8_t offset_right
)
Sets gesture sensor offset
Parameters:
-
offset_upUp offset -
offset_downDown offset offset_leftLeft offsetoffset_rightRight offset
function SetGestureProximityThreshold¶
Sets gesture sensor threshold
Parameters:
threshThreshold
function SetIntLimits¶
Sets interrupt limits
Parameters:
lowLow limithighHigh limit
function SetLED¶
Set LED brightness for proximity/gesture
Parameters:
driveLED Drive (0,3) -> {100mA, 50mA, 25mA, 12.5mA}boostLED Boost (0,3) -> {100%, 150%, 200%, 300%}
function SetProxGain¶
Adjusts the Proximity gain on the APDS9960
Parameters:
pGainGain
function SetProxPulse¶
Sets number of proxmity pulses
Parameters:
pLenPulse LengthpulsesNumber of pulses
function SetProximityInterrupt¶
Enables / Disables color interrupt
Parameters:
enEnable / disable
function Write8¶
function enable¶
function ~Apds9960¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/apds9960.h