LibDriver APDS9960
Loading...
Searching...
No Matches
driver_apds9960.h
Go to the documentation of this file.
1
36
37#ifndef DRIVER_APDS9960_H
38#define DRIVER_APDS9960_H
39
40#include <stdio.h>
41#include <stdint.h>
42#include <string.h>
43
44#ifdef __cplusplus
45extern "C"{
46#endif
47
53
58
62#ifndef APDS9960_GESTURE_THRESHOLD
63 #define APDS9960_GESTURE_THRESHOLD 10
64#endif
65
66#ifndef APDS9960_GESTURE_SENSITIVITY_1
67 #define APDS9960_GESTURE_SENSITIVITY_1 50
68#endif
69
70#ifndef APDS9960_GESTURE_SENSITIVITY_2
71 #define APDS9960_GESTURE_SENSITIVITY_2 20
72#endif
73
77typedef enum
78{
82
96
119
142
153
164
175
186
195
206
220
231
242
253
264
275
290
301
311
320
342
346typedef struct apds9960_handle_s
347{
348 uint8_t (*iic_init)(void);
349 uint8_t (*iic_deinit)(void);
350 uint8_t (*iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
351 uint8_t (*iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
352 void (*delay_ms)(uint32_t ms);
353 void (*debug_print)(const char *const fmt, ...);
354 void (*receive_callback)(uint8_t type);
355 uint8_t inited;
367
383
387
394
401#define DRIVER_APDS9960_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
402
409#define DRIVER_APDS9960_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
410
417#define DRIVER_APDS9960_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
418
425#define DRIVER_APDS9960_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
426
433#define DRIVER_APDS9960_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
434
441#define DRIVER_APDS9960_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
442
449#define DRIVER_APDS9960_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
450
457#define DRIVER_APDS9960_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
458
462
469
478uint8_t apds9960_info(apds9960_info_t *info);
479
491
504uint8_t apds9960_init(apds9960_handle_t *handle);
505
517uint8_t apds9960_deinit(apds9960_handle_t *handle);
518
533uint8_t apds9960_read_rgbc(apds9960_handle_t *handle, uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear);
534
546uint8_t apds9960_read_proximity(apds9960_handle_t *handle, uint8_t *proximity);
547
560uint8_t apds9960_read_gesture_fifo(apds9960_handle_t *handle, uint8_t (*data)[4], uint8_t *len);
561
575uint8_t apds9960_gesture_decode(apds9960_handle_t *handle, uint8_t (*data)[4], uint8_t len);
576
588uint8_t apds9960_set_gesture_decode_threshold(apds9960_handle_t *handle, uint8_t threshold);
589
601uint8_t apds9960_get_gesture_decode_threshold(apds9960_handle_t *handle, uint8_t *threshold);
602
614uint8_t apds9960_set_gesture_decode_sensitivity_1(apds9960_handle_t *handle, int32_t sensitivity);
615
627uint8_t apds9960_get_gesture_decode_sensitivity_1(apds9960_handle_t *handle, int32_t *sensitivity);
628
640uint8_t apds9960_set_gesture_decode_sensitivity_2(apds9960_handle_t *handle, int32_t sensitivity);
641
653uint8_t apds9960_get_gesture_decode_sensitivity_2(apds9960_handle_t *handle, int32_t *sensitivity);
654
668
682
694uint8_t apds9960_set_adc_integration_time(apds9960_handle_t *handle, uint8_t integration_time);
695
707uint8_t apds9960_get_adc_integration_time(apds9960_handle_t *handle, uint8_t *integration_time);
708
720uint8_t apds9960_adc_integration_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg);
721
733uint8_t apds9960_adc_integration_time_convert_to_data(apds9960_handle_t *handle, uint8_t reg, float *ms);
734
746uint8_t apds9960_set_wait_time(apds9960_handle_t *handle, uint8_t wait_time);
747
759uint8_t apds9960_get_wait_time(apds9960_handle_t *handle, uint8_t *wait_time);
760
773uint8_t apds9960_wait_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg);
774
787uint8_t apds9960_wait_time_convert_to_data(apds9960_handle_t *handle, uint8_t reg, float *ms);
788
800uint8_t apds9960_set_als_interrupt_low_threshold(apds9960_handle_t *handle, uint16_t threshold);
801
813uint8_t apds9960_get_als_interrupt_low_threshold(apds9960_handle_t *handle, uint16_t *threshold);
814
826uint8_t apds9960_set_als_interrupt_high_threshold(apds9960_handle_t *handle, uint16_t threshold);
827
839uint8_t apds9960_get_als_interrupt_high_threshold(apds9960_handle_t *handle, uint16_t *threshold);
840
852uint8_t apds9960_set_proximity_interrupt_low_threshold(apds9960_handle_t *handle, uint8_t threshold);
853
865uint8_t apds9960_get_proximity_interrupt_low_threshold(apds9960_handle_t *handle, uint8_t *threshold);
866
879
891uint8_t apds9960_get_proximity_interrupt_high_threshold(apds9960_handle_t *handle, uint8_t *threshold);
892
905
918
931
944
957
970
983
996
1009uint8_t apds9960_set_proximity_pulse_count(apds9960_handle_t *handle, uint16_t count);
1010
1022uint8_t apds9960_get_proximity_pulse_count(apds9960_handle_t *handle, uint16_t *count);
1023
1036
1049
1062
1075
1088
1101
1115
1129
1142
1155
1167uint8_t apds9960_get_status(apds9960_handle_t *handle, uint8_t *status);
1168
1180uint8_t apds9960_set_proximity_up_right_offset(apds9960_handle_t *handle, int8_t offset);
1181
1193uint8_t apds9960_get_proximity_up_right_offset(apds9960_handle_t *handle, int8_t *offset);
1194
1206uint8_t apds9960_set_proximity_down_left_offset(apds9960_handle_t *handle, int8_t offset);
1207
1219uint8_t apds9960_get_proximity_down_left_offset(apds9960_handle_t *handle, int8_t *offset);
1220
1233
1246
1259
1272
1286
1300
1312uint8_t apds9960_set_gesture_proximity_enter_threshold(apds9960_handle_t *handle, uint8_t threshold);
1313
1325uint8_t apds9960_get_gesture_proximity_enter_threshold(apds9960_handle_t *handle, uint8_t *threshold);
1326
1338uint8_t apds9960_set_gesture_proximity_exit_threshold(apds9960_handle_t *handle, uint8_t threshold);
1339
1351uint8_t apds9960_get_gesture_proximity_exit_threshold(apds9960_handle_t *handle, uint8_t *threshold);
1352
1365
1378
1391
1404
1417uint8_t apds9960_set_gesture_exit_mask(apds9960_handle_t *handle, uint8_t mask);
1418
1430uint8_t apds9960_get_gesture_exit_mask(apds9960_handle_t *handle, uint8_t *mask);
1431
1444
1457
1470
1483
1496
1509
1521uint8_t apds9960_set_gesture_up_offset(apds9960_handle_t *handle, int8_t offset);
1522
1534uint8_t apds9960_get_gesture_up_offset(apds9960_handle_t *handle, int8_t *offset);
1535
1547uint8_t apds9960_set_gesture_down_offset(apds9960_handle_t *handle, int8_t offset);
1548
1560uint8_t apds9960_get_gesture_down_offset(apds9960_handle_t *handle, int8_t *offset);
1561
1573uint8_t apds9960_set_gesture_left_offset(apds9960_handle_t *handle, int8_t offset);
1574
1586uint8_t apds9960_get_gesture_left_offset(apds9960_handle_t *handle, int8_t *offset);
1587
1599uint8_t apds9960_set_gesture_right_offset(apds9960_handle_t *handle, int8_t offset);
1600
1612uint8_t apds9960_get_gesture_right_offset(apds9960_handle_t *handle, int8_t *offset);
1613
1626
1639
1652uint8_t apds9960_set_gesture_pulse_count(apds9960_handle_t *handle, uint16_t count);
1653
1665uint8_t apds9960_get_gesture_pulse_count(apds9960_handle_t *handle, uint16_t *count);
1666
1679
1692
1704
1717
1730
1743
1756
1768uint8_t apds9960_get_gesture_fifo_level(apds9960_handle_t *handle, uint8_t *level);
1769
1781uint8_t apds9960_get_gesture_status(apds9960_handle_t *handle, uint8_t *status);
1782
1794
1806
1818
1830
1834
1841
1855uint8_t apds9960_set_reg(apds9960_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1856
1870uint8_t apds9960_get_reg(apds9960_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1871
1875
1879
1880#ifdef __cplusplus
1881}
1882#endif
1883
1884#endif
uint8_t apds9960_get_proximity_interrupt_high_threshold(apds9960_handle_t *handle, uint8_t *threshold)
get the proximity interrupt high threshold
uint8_t apds9960_set_gesture_dimension(apds9960_handle_t *handle, apds9960_gesture_dimension_select_t s)
set the gesture dimension
apds9960_led_boost_t
apds9960 led boost enumeration definition
uint8_t apds9960_set_gesture_gain(apds9960_handle_t *handle, apds9960_gesture_gain_control_t gain)
set the gesture gain
uint8_t apds9960_set_gesture_decode_sensitivity_2(apds9960_handle_t *handle, int32_t sensitivity)
set the gesture decode sensitivity 2
uint8_t apds9960_read_gesture_fifo(apds9960_handle_t *handle, uint8_t(*data)[4], uint8_t *len)
read data from the gesture fifo
uint8_t apds9960_get_als_interrupt_high_threshold(apds9960_handle_t *handle, uint16_t *threshold)
get the als interrupt high threshold
uint8_t apds9960_set_als_interrupt_high_threshold(apds9960_handle_t *handle, uint16_t threshold)
set the als interrupt high threshold
uint8_t apds9960_deinit(apds9960_handle_t *handle)
close the chip
uint8_t apds9960_set_gesture_wait_time(apds9960_handle_t *handle, apds9960_gesture_wait_time_t t)
set the gesture wait time
apds9960_gesture_led_current_t
apds9960 gesture led current enumeration definition
uint8_t apds9960_get_led_current(apds9960_handle_t *handle, apds9960_led_current_t *current)
get the led current
uint8_t apds9960_set_gesture_exit_persistence(apds9960_handle_t *handle, apds9960_gesture_exit_persistence_t persistence)
set the gesture exit persistence
uint8_t apds9960_get_gesture_led_current(apds9960_handle_t *handle, apds9960_gesture_led_current_t *current)
get the gesture led current
uint8_t apds9960_gesture_decode(apds9960_handle_t *handle, uint8_t(*data)[4], uint8_t len)
decode gestures from the fifo data
uint8_t apds9960_get_conf(apds9960_handle_t *handle, apds9960_conf_t conf, apds9960_bool_t *enable)
get the configuration
apds9960_interrupt_status_t
apds9960 interrupt status enumeration definition
uint8_t apds9960_set_proximity_pulse_length(apds9960_handle_t *handle, apds9960_proximity_pulse_length_t len)
set the proximity pulse length
uint8_t apds9960_adc_integration_time_convert_to_data(apds9960_handle_t *handle, uint8_t reg, float *ms)
convert the register raw data to the integration time
uint8_t apds9960_get_gesture_up_offset(apds9960_handle_t *handle, int8_t *offset)
get the gesture up offset
uint8_t apds9960_get_proximity_pulse_count(apds9960_handle_t *handle, uint16_t *count)
get the proximity pulse count
uint8_t apds9960_get_gesture_exit_mask(apds9960_handle_t *handle, uint8_t *mask)
get the gesture exit mask
uint8_t apds9960_get_gesture_decode_threshold(apds9960_handle_t *handle, uint8_t *threshold)
get the gesture decode threshold
uint8_t apds9960_get_proximity_down_left_offset(apds9960_handle_t *handle, int8_t *offset)
get the proximity down left offset
apds9960_proximity_interrupt_cycle_t
apds9960 proximity interrupt cycle enumeration definition
uint8_t apds9960_set_saturation_interrupt(apds9960_handle_t *handle, apds9960_saturation_interrupt_t saturation, apds9960_bool_t enable)
set the saturation interrupt
uint8_t apds9960_set_proximity_down_left_offset(apds9960_handle_t *handle, int8_t offset)
set the proximity down left offset
uint8_t apds9960_set_als_interrupt_cycle(apds9960_handle_t *handle, apds9960_als_interrupt_cycle_t cycle)
set the als interrupt cycle
uint8_t apds9960_get_gesture_gain(apds9960_handle_t *handle, apds9960_gesture_gain_control_t *gain)
get the gesture gain
uint8_t apds9960_get_gesture_status(apds9960_handle_t *handle, uint8_t *status)
get the gesture status
uint8_t apds9960_gesture_fifo_clear(apds9960_handle_t *handle)
clear the gesture fifo status
apds9960_proximity_gain_t
apds9960 proximity gain enumeration definition
uint8_t apds9960_get_proximity_interrupt_cycle(apds9960_handle_t *handle, apds9960_proximity_interrupt_cycle_t *cycle)
get the proximity interrupt cycle
uint8_t apds9960_wait_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg)
convert the wait time to the register raw data
uint8_t apds9960_get_proximity_gain(apds9960_handle_t *handle, apds9960_proximity_gain_t *gain)
get the proximity gain
apds9960_gesture_dimension_select_t
apds9960 gesture dimension select enumeration definition
uint8_t apds9960_read_proximity(apds9960_handle_t *handle, uint8_t *proximity)
read the proximity data
uint8_t apds9960_set_proximity_gain(apds9960_handle_t *handle, apds9960_proximity_gain_t gain)
set the proximity gain
uint8_t apds9960_adc_integration_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg)
convert the adc integration time to the register raw data
uint8_t apds9960_init(apds9960_handle_t *handle)
initialize the chip
uint8_t apds9960_set_proximity_interrupt_cycle(apds9960_handle_t *handle, apds9960_proximity_interrupt_cycle_t cycle)
set the proximity interrupt cycle
uint8_t apds9960_set_gesture_right_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture right offset
uint8_t apds9960_get_saturation_interrupt(apds9960_handle_t *handle, apds9960_saturation_interrupt_t saturation, apds9960_bool_t *enable)
get the saturation interrupt
uint8_t apds9960_set_gesture_fifo_threshold(apds9960_handle_t *handle, apds9960_gesture_fifo_threshold_t threshold)
set the gesture fifo threshold
uint8_t apds9960_set_proximity_pulse_count(apds9960_handle_t *handle, uint16_t count)
set the proximity pulse count
uint8_t apds9960_set_proximity_up_right_offset(apds9960_handle_t *handle, int8_t offset)
set the proximity up right offset
uint8_t apds9960_set_gesture_pulse_length(apds9960_handle_t *handle, apds9960_gesture_pulse_length_t len)
set the gesture pulse length
uint8_t apds9960_irq_handler(apds9960_handle_t *handle)
irq handler
uint8_t apds9960_set_proximity_gain_compensation(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the proximity gain compensation
uint8_t apds9960_get_als_interrupt_cycle(apds9960_handle_t *handle, apds9960_als_interrupt_cycle_t *cycle)
get the als interrupt cycle
uint8_t apds9960_set_gesture_led_current(apds9960_handle_t *handle, apds9960_gesture_led_current_t current)
set the gesture led current
uint8_t apds9960_get_gesture_pulse_length(apds9960_handle_t *handle, apds9960_gesture_pulse_length_t *len)
get the gesture pulse length
uint8_t apds9960_force_interrupt(apds9960_handle_t *handle)
force an interrupt
uint8_t apds9960_get_gesture_dimension_select(apds9960_handle_t *handle, apds9960_gesture_dimension_select_t *s)
get the gesture dimension
apds9960_gesture_pulse_length_t
apds9960 gesture pulse length enumeration definition
uint8_t apds9960_get_proximity_pulse_length(apds9960_handle_t *handle, apds9960_proximity_pulse_length_t *len)
get the proximity pulse length
uint8_t apds9960_get_gesture_proximity_exit_threshold(apds9960_handle_t *handle, uint8_t *threshold)
get the gesture proximity exit threshold
uint8_t apds9960_get_als_interrupt_low_threshold(apds9960_handle_t *handle, uint16_t *threshold)
get the als interrupt low threshold
uint8_t apds9960_set_gesture_pulse_count(apds9960_handle_t *handle, uint16_t count)
set the gesture pulse count
uint8_t apds9960_wait_time_convert_to_data(apds9960_handle_t *handle, uint8_t reg, float *ms)
convert the register raw data to the wait time
uint8_t apds9960_get_gesture_exit_persistence(apds9960_handle_t *handle, apds9960_gesture_exit_persistence_t *persistence)
get the gesture exit persistence
uint8_t apds9960_set_wait_long(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the wait long
apds9960_gesture_wait_time_t
apds9960 gesture wait time enumeration definition
uint8_t apds9960_set_gesture_exit_mask(apds9960_handle_t *handle, uint8_t mask)
set the gesture exit mask
apds9960_bool_t
apds9960 bool enumeration definition
uint8_t apds9960_set_als_color_gain(apds9960_handle_t *handle, apds9960_als_color_gain_t gain)
set the als color gain
uint8_t apds9960_get_status(apds9960_handle_t *handle, uint8_t *status)
get the status
uint8_t apds9960_set_gesture_proximity_enter_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the gesture proximity enter threshold
struct apds9960_info_s apds9960_info_t
apds9960 information structure definition
uint8_t apds9960_get_gesture_down_offset(apds9960_handle_t *handle, int8_t *offset)
get the gesture down offset
uint8_t apds9960_get_proximity_up_right_offset(apds9960_handle_t *handle, int8_t *offset)
get the proximity up right offset
uint8_t apds9960_set_gesture_mode(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the gesture mode
uint8_t apds9960_get_led_boost(apds9960_handle_t *handle, apds9960_led_boost_t *boost)
get the led boost
uint8_t apds9960_set_led_boost(apds9960_handle_t *handle, apds9960_led_boost_t boost)
set the led boost
struct apds9960_handle_s apds9960_handle_t
apds9960 handle structure definition
uint8_t apds9960_get_wait_long(apds9960_handle_t *handle, apds9960_bool_t *enable)
get the wait long status
uint8_t apds9960_get_gesture_right_offset(apds9960_handle_t *handle, int8_t *offset)
get the gesture right offset
uint8_t apds9960_set_sleep_after_interrupt(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable sleeping after interrupt
uint8_t apds9960_get_wait_time(apds9960_handle_t *handle, uint8_t *wait_time)
get the wait time
uint8_t apds9960_read_rgbc(apds9960_handle_t *handle, uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
read the rgbc data
apds9960_gesture_status_t
apds9960 gesture status enumeration definition
uint8_t apds9960_all_non_gesture_interrupt_clear(apds9960_handle_t *handle)
clear the all not gesture interrupt
uint8_t apds9960_als_interrupt_clear(apds9960_handle_t *handle)
clear the als interrupt
uint8_t apds9960_set_conf(apds9960_handle_t *handle, apds9960_conf_t conf, apds9960_bool_t enable)
set the configuration
uint8_t apds9960_set_als_interrupt_low_threshold(apds9960_handle_t *handle, uint16_t threshold)
set the als interrupt low threshold
uint8_t apds9960_get_als_color_gain(apds9960_handle_t *handle, apds9960_als_color_gain_t *gain)
get the als color gain
uint8_t apds9960_set_gesture_up_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture up offset
apds9960_proximity_mask_t
apds9960 proximity mask enumeration definition
uint8_t apds9960_set_gesture_interrupt(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the gesture interrupt
apds9960_gesture_exit_persistence_t
apds9960 gesture exit persistence enumeration definition
uint8_t apds9960_get_adc_integration_time(apds9960_handle_t *handle, uint8_t *integration_time)
get the adc integration time
uint8_t apds9960_set_proximity_interrupt_low_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the proximity interrupt low threshold
uint8_t apds9960_get_gesture_mode(apds9960_handle_t *handle, apds9960_bool_t *enable)
get the gesture mode status
apds9960_als_interrupt_cycle_t
apds9960 als interrupt cycle enumeration definition
uint8_t apds9960_get_proximity_gain_compensation(apds9960_handle_t *handle, apds9960_bool_t *enable)
get the proximity gain compensation status
apds9960_gesture_gain_control_t
apds9960 gesture gain control enumeration definition
uint8_t apds9960_set_gesture_left_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture left offset
uint8_t apds9960_set_adc_integration_time(apds9960_handle_t *handle, uint8_t integration_time)
set the adc integration time
uint8_t apds9960_get_proximity_mask(apds9960_handle_t *handle, apds9960_proximity_mask_t mask, apds9960_bool_t *enable)
get the proximity mask status
uint8_t apds9960_get_proximity_interrupt_low_threshold(apds9960_handle_t *handle, uint8_t *threshold)
get the proximity interrupt low threshold
uint8_t apds9960_set_gesture_decode_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the gesture decode threshold
uint8_t apds9960_get_gesture_decode_sensitivity_2(apds9960_handle_t *handle, int32_t *sensitivity)
get the gesture decode sensitivity 2
uint8_t apds9960_set_led_current(apds9960_handle_t *handle, apds9960_led_current_t current)
set the led current
uint8_t apds9960_get_gesture_fifo_threshold(apds9960_handle_t *handle, apds9960_gesture_fifo_threshold_t *threshold)
get the gesture fifo threshold
apds9960_saturation_interrupt_t
apds9960 saturation interrupt enumeration definition
uint8_t apds9960_get_gesture_decode_sensitivity_1(apds9960_handle_t *handle, int32_t *sensitivity)
get the gesture decode sensitivity 1
uint8_t apds9960_set_proximity_interrupt_high_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the proximity interrupt high threshold
apds9960_status_t
apds9960 status enumeration definition
uint8_t apds9960_get_gesture_proximity_enter_threshold(apds9960_handle_t *handle, uint8_t *threshold)
get the gesture proximity enter threshold
apds9960_conf_t
apds9960 conf enumeration definition
uint8_t apds9960_proximity_interrupt_clear(apds9960_handle_t *handle)
clear the proximity interrupt
uint8_t apds9960_get_gesture_left_offset(apds9960_handle_t *handle, int8_t *offset)
get the gesture left offset
uint8_t apds9960_set_wait_time(apds9960_handle_t *handle, uint8_t wait_time)
set the wait time
uint8_t apds9960_set_gesture_proximity_exit_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the gesture proximity exit threshold
apds9960_proximity_pulse_length_t
apds9960 proximity pulse length enumeration definition
uint8_t apds9960_get_gesture_wait_time(apds9960_handle_t *handle, apds9960_gesture_wait_time_t *t)
get the gesture wait time
apds9960_led_current_t
apds9960 led current enumeration definition
uint8_t apds9960_set_proximity_mask(apds9960_handle_t *handle, apds9960_proximity_mask_t mask, apds9960_bool_t enable)
enable or disable the proximity mask
uint8_t apds9960_info(apds9960_info_t *info)
get chip's information
apds9960_als_color_gain_t
apds9960 als and color gain enumeration definition
uint8_t apds9960_get_gesture_fifo_level(apds9960_handle_t *handle, uint8_t *level)
get the gesture fifo level
apds9960_gesture_fifo_threshold_t
apds9960 gesture fifo threshold enumeration definition
uint8_t apds9960_get_gesture_pulse_count(apds9960_handle_t *handle, uint16_t *count)
get the gesture pulse count
uint8_t apds9960_set_gesture_decode_sensitivity_1(apds9960_handle_t *handle, int32_t sensitivity)
set the gesture decode sensitivity 1
uint8_t apds9960_get_sleep_after_interrupt(apds9960_handle_t *handle, apds9960_bool_t *enable)
get the sleeping after interrupt status
uint8_t apds9960_set_gesture_down_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture down offset
uint8_t apds9960_get_gesture_interrupt(apds9960_handle_t *handle, apds9960_bool_t *enable)
get the gesture interrupt status
@ APDS9960_LED_BOOST_200_PERCENTAGE
@ APDS9960_LED_BOOST_150_PERCENTAGE
@ APDS9960_LED_BOOST_300_PERCENTAGE
@ APDS9960_LED_BOOST_100_PERCENTAGE
@ APDS9960_GESTURE_LED_CURRENT_25_MA
@ APDS9960_GESTURE_LED_CURRENT_100_MA
@ APDS9960_GESTURE_LED_CURRENT_12P5_MA
@ APDS9960_GESTURE_LED_CURRENT_50_MA
@ APDS9960_INTERRUPT_STATUS_CPSAT
@ APDS9960_INTERRUPT_STATUS_GESTURE_NEAR
@ APDS9960_INTERRUPT_STATUS_AVALID
@ APDS9960_INTERRUPT_STATUS_GVALID
@ APDS9960_INTERRUPT_STATUS_GESTURE_RIGHT
@ APDS9960_INTERRUPT_STATUS_GESTURE_LEFT
@ APDS9960_INTERRUPT_STATUS_GESTURE_DOWN
@ APDS9960_INTERRUPT_STATUS_AINT
@ APDS9960_INTERRUPT_STATUS_GINT
@ APDS9960_INTERRUPT_STATUS_PGSAT
@ APDS9960_INTERRUPT_STATUS_GESTURE_FAR
@ APDS9960_INTERRUPT_STATUS_PVALID
@ APDS9960_INTERRUPT_STATUS_GESTURE_UP
@ APDS9960_INTERRUPT_STATUS_PINT
@ APDS9960_INTERRUPT_STATUS_GFOV
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_7
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_14
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_8
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_EVERY
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_15
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_3
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_10
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_11
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_5
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_9
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_ANY
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_4
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_6
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_12
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_2
@ APDS9960_PROXIMITY_INTERRUPT_CYCLE_13
@ APDS9960_PROXIMITY_GAIN_8X
@ APDS9960_PROXIMITY_GAIN_1X
@ APDS9960_PROXIMITY_GAIN_2X
@ APDS9960_PROXIMITY_GAIN_4X
@ APDS9960_GESTURE_DIMENSION_SELECT_ONLY_UP_DOWN_PAIRS_ACTIVE
@ APDS9960_GESTURE_DIMENSION_SELECT_ONLY_LEFT_RIGHT_PAIRS_ACTIVE
@ APDS9960_GESTURE_DIMENSION_SELECT_BOTH_PAIRS_ACTIVE
@ APDS9960_GESTURE_PULSE_LENGTH_4_US
@ APDS9960_GESTURE_PULSE_LENGTH_32_US
@ APDS9960_GESTURE_PULSE_LENGTH_16_US
@ APDS9960_GESTURE_PULSE_LENGTH_8_US
@ APDS9960_GESTURE_WAIT_TIME_0_MS
@ APDS9960_GESTURE_WAIT_TIME_5P6_MS
@ APDS9960_GESTURE_WAIT_TIME_8P4_MS
@ APDS9960_GESTURE_WAIT_TIME_22P4_MS
@ APDS9960_GESTURE_WAIT_TIME_2P8_MS
@ APDS9960_GESTURE_WAIT_TIME_39P2_MS
@ APDS9960_GESTURE_WAIT_TIME_30P8_MS
@ APDS9960_GESTURE_WAIT_TIME_14_MS
@ APDS9960_BOOL_FALSE
@ APDS9960_BOOL_TRUE
@ APDS9960_GESTURE_STATUS_FIFO_VALID
@ APDS9960_GESTURE_STATUS_FIFO_OVERFLOW
@ APDS9960_PROXIMITY_MASK_RIGHT
@ APDS9960_PROXIMITY_MASK_DOWN
@ APDS9960_PROXIMITY_MASK_UP
@ APDS9960_PROXIMITY_MASK_LEFT
@ APDS9960_GESTURE_EXIT_PERSISTENCE_1ST
@ APDS9960_GESTURE_EXIT_PERSISTENCE_2ND
@ APDS9960_GESTURE_EXIT_PERSISTENCE_7TH
@ APDS9960_GESTURE_EXIT_PERSISTENCE_4TH
@ APDS9960_ALS_INTERRUPT_CYCLE_25
@ APDS9960_ALS_INTERRUPT_CYCLE_35
@ APDS9960_ALS_INTERRUPT_CYCLE_2
@ APDS9960_ALS_INTERRUPT_CYCLE_55
@ APDS9960_ALS_INTERRUPT_CYCLE_10
@ APDS9960_ALS_INTERRUPT_CYCLE_EVERY
@ APDS9960_ALS_INTERRUPT_CYCLE_15
@ APDS9960_ALS_INTERRUPT_CYCLE_ANY
@ APDS9960_ALS_INTERRUPT_CYCLE_5
@ APDS9960_ALS_INTERRUPT_CYCLE_40
@ APDS9960_ALS_INTERRUPT_CYCLE_20
@ APDS9960_ALS_INTERRUPT_CYCLE_50
@ APDS9960_ALS_INTERRUPT_CYCLE_45
@ APDS9960_ALS_INTERRUPT_CYCLE_30
@ APDS9960_ALS_INTERRUPT_CYCLE_3
@ APDS9960_ALS_INTERRUPT_CYCLE_60
@ APDS9960_GESTURE_GAIN_4X
@ APDS9960_GESTURE_GAIN_8X
@ APDS9960_GESTURE_GAIN_1X
@ APDS9960_GESTURE_GAIN_2X
@ APDS9960_SATURATION_INTERRUPT_PROXIMITY
@ APDS9960_SATURATION_INTERRUPT_CLEAR_PHOTODIODE
@ APDS9960_STATUS_PVALID
@ APDS9960_STATUS_CPSAT
@ APDS9960_STATUS_PINT
@ APDS9960_STATUS_AVALID
@ APDS9960_STATUS_GINT
@ APDS9960_STATUS_PGSAT
@ APDS9960_STATUS_AINT
@ APDS9960_CONF_WAIT_ENABLE
@ APDS9960_CONF_ALS_ENABLE
@ APDS9960_CONF_PROXIMITY_DETECT_ENABLE
@ APDS9960_CONF_GESTURE_ENABLE
@ APDS9960_CONF_PROXIMITY_INTERRUPT_ENABLE
@ APDS9960_CONF_ALS_INTERRUPT_ENABLE
@ APDS9960_CONF_POWER_ON
@ APDS9960_PROXIMITY_PULSE_LENGTH_4_US
@ APDS9960_PROXIMITY_PULSE_LENGTH_16_US
@ APDS9960_PROXIMITY_PULSE_LENGTH_32_US
@ APDS9960_PROXIMITY_PULSE_LENGTH_8_US
@ APDS9960_LED_CURRENT_12P5_MA
@ APDS9960_LED_CURRENT_50_MA
@ APDS9960_LED_CURRENT_25_MA
@ APDS9960_LED_CURRENT_100_MA
@ APDS9960_ALS_COLOR_GAIN_4X
@ APDS9960_ALS_COLOR_GAIN_64X
@ APDS9960_ALS_COLOR_GAIN_16X
@ APDS9960_ALS_COLOR_GAIN_1X
@ APDS9960_GESTURE_FIFO_THRESHOLD_8_DATASET
@ APDS9960_GESTURE_FIFO_THRESHOLD_1_DATASET
@ APDS9960_GESTURE_FIFO_THRESHOLD_4_DATASET
@ APDS9960_GESTURE_FIFO_THRESHOLD_16_DATASET
uint8_t apds9960_set_reg(apds9960_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
uint8_t apds9960_get_reg(apds9960_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
apds9960 handle structure definition
void(* delay_ms)(uint32_t ms)
void(* receive_callback)(uint8_t type)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
apds9960 information structure definition
char manufacturer_name[32]