daisy::Apds9960¶
Module: External
Device support for APDS9960 gesture / RGB / proximity sensor. More...
#include <apds9960.h>
Public Classes¶
Name | |
---|---|
struct | Config |
Public Types¶
Name | |
---|---|
enum | Result |
Public Functions¶
Name | |
---|---|
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) |
Detailed Description¶
Device support for APDS9960 gesture / RGB / proximity sensor.
Author: beserge
Date: December 2021
Public Types Documentation¶
enum Result¶
Enumerator | Value | Description |
---|---|---|
OK | 0 | |
ERR |
Public Functions Documentation¶
function Apds9960¶
function ~Apds9960¶
function enable¶
function Init¶
Parameters:
- config Configuration settings
Initialize the APDS9960 device
function SetADCIntegrationTime¶
Parameters:
- iTimeMS Integration time
Sets the integration time for the ADC of the APDS9960, in millis
function GetADCIntegrationTime¶
Return: Integration time
Returns the integration time for the ADC of the APDS9960, in millis
function SetADCGain¶
Parameters:
- aGain Gain
Adjusts the color/ALS gain on the APDS9960 (adjusts the sensitivity to light)
function SetGestureOffset¶
inline void SetGestureOffset(
uint8_t offset_up,
uint8_t offset_down,
uint8_t offset_left,
uint8_t offset_right
)
Parameters:
- offset_up Up offset
- offset_down Down offset
- offset_left Left offset
- offset_right Right offset
Sets gesture sensor offset
function SetGestureDimensions¶
Parameters:
- dims Dimensions
Sets gesture dimensions
function SetGestureFIFOThreshold¶
Parameters:
- thresh Threshold
Sets gesture FIFO Threshold
function SetGestureGain¶
Parameters:
- gain Gain
Sets gesture sensor gain
function SetGestureProximityThreshold¶
Parameters:
- thresh Threshold
Sets gesture sensor threshold
function Enable¶
Parameters:
- en Enable
Enables the device / Disables the device (putting it in lower power sleep mode)
function EnableGesture¶
Parameters:
- en Enable
Enable gesture readings
function EnableProximity¶
Parameters:
- en Enable
Enable proximity readings
function EnableColor¶
Parameters:
- en Enable
Enable color readings
function SetColorInterrupt¶
Parameters:
- en Enable / disable
Enables/disables color interrupt
function SetProximityInterrupt¶
Parameters:
- en Enable / disable
Enables / Disables color interrupt
function ClearInterrupt¶
Clears interrupt
function ResetCounts¶
Resets gesture counts
function Write8¶
function Read8¶
function Read16R¶
function ReadProximity¶
Return: Proximity
Read proximity data
function SetProxGain¶
Parameters:
- pGain Gain
Adjusts the Proximity gain on the APDS9960
function GetProxGain¶
Return: Proxmity gain
Returns the Proximity gain on the APDS9960
function SetProxPulse¶
Parameters:
- pLen Pulse Length
- pulses Number of pulses
Sets number of proxmity pulses
function GestureValid¶
Return: Status (True/False)
Returns validity status of a gesture
function ReadGesture¶
Return: Received gesture (1,4) -> {UP, DOWN, LEFT, RIGHT}
Reads gesture
< Gesture Up
< Gesture Down
< Gesture Left
< Gesture Right
function SetLED¶
Parameters:
- drive LED Drive (0,3) -> {100mA, 50mA, 25mA, 12.5mA}
- boost LED Boost (0,3) -> {100%, 150%, 200%, 300%}
Set LED brightness for proximity/gesture
function CalculateColorTemperature¶
Parameters:
- r Red value
- g Green value
- b Blue value
Return: Color temperature
Converts the raw R/G/B values to color temperature in degrees Kelvin
function CalculateLux¶
Parameters:
- r Red value
- g Green value
- b Blue value
Return: LUX value
Calculate ambient light values
function SetIntLimits¶
Parameters:
- low Low limit
- high High limit
Sets interrupt limits
function ColorDataReady¶
Return: True if color data ready, False otherwise
Returns status of color data
function GetColorDataRed¶
Return: Red channel value
Reads the raw red channel value
function GetColorDataGreen¶
Return: Green channel value
Reads the raw green channel value
function GetColorDataBlue¶
Return: Blue channel value
Reads the raw blue channel value
function GetColorDataClear¶
Return: Clear channel value
Reads the raw clear channel value
function GetColorData¶
Parameters:
- ***r** Red value
- ***g** Green value
- ***b** Blue value
- ***c** Clear channel value
Reads the raw red, green, blue and clear channel values
---¶
Updated on 2024-01-03 at 19:41:01 +0000