Go to the documentation of this file.
224 #define APDS99XX_ID (0x29)
225 #define APDS99XX_T_PRX_PULSE (16)
226 #define APDS99XX_T_PRX_CNV (2720)
227 #define APDS99XX_T_WAIT_STEP (2720)
228 #define APDS99XX_T_ALS_STEP (2720)
229 #define APDS99XX_CNTS_P_STEP (1023)
231 #elif MODULE_APDS9901
232 #define APDS99XX_ID (0x20)
233 #define APDS99XX_T_PRX_PULSE (16)
234 #define APDS99XX_T_PRX_CNV (2720)
235 #define APDS99XX_T_WAIT_STEP (2720)
236 #define APDS99XX_T_ALS_STEP (2720)
237 #define APDS99XX_CNTS_P_STEP (1023)
239 #elif MODULE_APDS9930
240 #define APDS99XX_ID (0x39)
241 #define APDS99XX_T_PRX_PULSE (16)
242 #define APDS99XX_T_PRX_CNV (2730)
243 #define APDS99XX_T_WAIT_STEP (2730)
244 #define APDS99XX_T_ALS_STEP (2730)
245 #define APDS99XX_CNTS_P_STEP (1023)
247 #elif MODULE_APDS9950
248 #define APDS99XX_ID (0x69)
249 #define APDS99XX_T_PRX_PULSE (14)
250 #define APDS99XX_T_PRX_CNV (2400)
251 #define APDS99XX_T_WAIT_STEP (2400)
252 #define APDS99XX_T_ALS_STEP (2400)
253 #define APDS99XX_CNTS_P_STEP (1024)
255 #elif MODULE_APDS9960 || DOXYGEN
256 #define APDS99XX_ID (0xab)
257 #define APDS99XX_T_PRX_PULSE (36)
259 #define APDS99XX_T_PRX_CNV (841)
261 #define APDS99XX_T_WAIT_STEP (2780)
262 #define APDS99XX_T_ALS_STEP (2780)
263 #define APDS99XX_CNTS_P_STEP (1025)
266 #error "Please provide a valid aps99xx variant (apds9900, apds9901, adps9930, apds9950, apds9960)"
273 #define APDS99XX_I2C_ADDRESS (0x39)
293 #if MODULE_APDS9950 || MODULE_APDS9960 || DOXYGEN
296 #if MODULE_APDS9900 || MODULE_APDS9901 || APDS9930 || DOXYGEN
306 #if MODULE_APDS9930 || MODULE_APDS9960 || DOXYGEN
352 #if MODULE_APDS99XX_FULL || DOXYGEN
426 #if MODULE_APDS99XX_FULL || DOXYGEN
435 #if MODULE_APDS9950 || MODULE_APDS9960 || DOXYGEN
504 #if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930 || DOXYGEN
527 #if MODULE_APDS9950 || MODULE_APDS9960 || DOXYGEN
628 #if MODULE_APDS99XX_FULL || DOXYGEN
@ APDS99XX_PRX_DRIVE_50
50.0 mA
apds99xx_als_gain_t
Ambient light sensing (ALS) gain.
APDS99XX sensor device data structure type.
uint16_t prx_thresh_low
Low threshold for proximity values (only the low byte is used for APDS9960)
apds99xx_params_t params
device initialization parameters
int apds99xx_read_rgb_raw(const apds99xx_t *dev, apds99xx_rgb_t *rgb)
Read one raw RGB color data sample (APDS9950 and APDS9960 only)
@ APDS99XX_PRX_GAIN_8
8 x gain (APDS9930, APDS9960 only)
apds99xx_prx_drive_t
Proximity sensing (PRX) LED drive strength.
uint8_t als_pers
Number of consecutive ALS values that have to be outside the thresholds to generate an interrupt:
APDS99XX device initialization parameters.
@ APDS99XX_ALS_GAIN_16
16 x gain
@ APDS99XX_ERROR_RAW_DATA
reading raw data failed
int apds99xx_data_ready_als(const apds99xx_t *dev)
Ambient light sensing (ALS) data-ready status function.
@ APDS99XX_ERROR_NO_DATA
no data are available
bool prx_int
Proximity interrupt happened.
int apds99xx_read_als_raw(const apds99xx_t *dev, uint16_t *raw)
Read one raw data sample of ambient light sensing (ALS)
int apds99xx_power_down(const apds99xx_t *dev)
Power down the sensor.
uint16_t blue
B photodiode count value (blue)
int apds99xx_data_ready_prx(const apds99xx_t *dev)
Proximity sensing (PRX) data-ready status function.
@ APDS99XX_ALS_GAIN_8
8 x gain
@ APDS99XX_PRX_DRIVE_100
100.0 mA (default)
@ APDS99XX_ERROR_I2C
I2C communication error.
RGB count value data structure (APDS9950 and APDS9960 only)
gpio_t int_pin
interrupt pin: GPIO_UNDEF if not used
uint16_t wait_steps
Waiting time in steps.
uint16_t als_steps
ALS integration time in steps.
bool als_int
ALS interrupt happened.
int apds99xx_int_source(apds99xx_t *dev, apds99xx_int_source_t *src)
Get the source of an interrupt.
void(* apds99xx_isr_t)(void *arg)
Interrupt service routine function prototype.
apds99xx_error_codes_t
Definition of error codes.
int apds99xx_read_prx_raw(const apds99xx_t *dev, uint16_t *prx)
Read one data sample of proximity sensing (PRX)
@ APDS99XX_ALS_GAIN_1
1 x gain (default)
apds99xx_prx_gain_t
Proximity sensing (PRX) gain.
@ APDS99XX_ALS_GAIN_120
120 x gain (APDS9900, APDS9901, APDS9930 only)
uint16_t prx_thresh_high
High threshold for proximity values (only the low byte is used for APDS9960)
@ APDS99XX_PRX_GAIN_2
2 x gain (APDS9930, APDS9960 only)
uint16_t red
R photodiode count value (red)
apds99xx_als_gain_t als_gain
Gain used for ALS.
@ APDS99XX_PRX_GAIN_4
4 x gain (APDS9930, APDS9960 only)
@ APDS99XX_ERROR_WRONG_ID
wrong id read
@ APDS99XX_PRX_GAIN_1
1 x gain (default)
int apds99xx_int_config(apds99xx_t *dev, apds99xx_int_config_t *cfg, apds99xx_isr_t isr, void *isr_arg)
Configure the interrupts of the sensor.
uint8_t prx_pulses
IR LED pulses for proximity sensing.
apds99xx_prx_gain_t prx_gain
Gain used for proximity sensing.
bool gpio_init
GPIO is already initialized.
bool wait_long
Long waiting time.
uint16_t green
G photodiode count value (green)
@ APDS99XX_PRX_DRIVE_25
25.0 mA
uint8_t prx_pers
Number of consecutive proximity values that have to be outside the thresholds to generate an interrup...
int apds99xx_read_illuminance(const apds99xx_t *dev, uint16_t *lux)
Read one data sample of illuminance in lux.
@ APDS99XX_PRX_DRIVE_12_5
12.5 mA
int apds99xx_power_up(const apds99xx_t *dev)
Power up the sensor.
Low-level GPIO peripheral driver interface definitions.
void * isr_arg
user ISR argument
@ APDS99XX_ALS_GAIN_64
64 x gain (APDS9950, APDS9960 only)
unsigned dev
I2C device (default I2C_DEV(0))
bool prx_int_en
Proximity interrupt enabled.
uint16_t als_thresh_high
High threshold value for ALS interrupts.
apds99xx_prx_drive_t prx_drive
IR LED current for proximity sensing (default APDS99XX_PRX_DRIVE_100)
int apds99xx_init(apds99xx_t *dev, const apds99xx_params_t *params)
Initialize the APDS99XX sensor device.
uint16_t als_thresh_low
Low threshold value for ALS interrupts.
bool als_int_en
ALS interrupt enabled.
apds99xx_isr_t isr
user ISR
Low-level I2C peripheral driver interface definition.