LibDriver APDS9960
Loading...
Searching...
No Matches
apds9960 basic driver function

apds9960 basic driver modules More...

Collaboration diagram for apds9960 basic driver function:

Data Structures

struct  apds9960_handle_s
 apds9960 handle structure definition More...
struct  apds9960_info_s
 apds9960 information structure definition More...

Macros

#define APDS9960_GESTURE_THRESHOLD   10
 apds9960 gesture algorithm params definition
#define APDS9960_GESTURE_SENSITIVITY_1   50
#define APDS9960_GESTURE_SENSITIVITY_2   20

Typedefs

typedef struct apds9960_handle_s apds9960_handle_t
 apds9960 handle structure definition
typedef struct apds9960_info_s apds9960_info_t
 apds9960 information structure definition

Enumerations

enum  apds9960_bool_t { APDS9960_BOOL_FALSE = 0x00 , APDS9960_BOOL_TRUE = 0x01 }
 apds9960 bool enumeration definition More...
enum  apds9960_conf_t {
  APDS9960_CONF_GESTURE_ENABLE = 6 , APDS9960_CONF_PROXIMITY_INTERRUPT_ENABLE = 5 , APDS9960_CONF_ALS_INTERRUPT_ENABLE = 4 , APDS9960_CONF_WAIT_ENABLE = 3 ,
  APDS9960_CONF_PROXIMITY_DETECT_ENABLE = 2 , APDS9960_CONF_ALS_ENABLE = 1 , APDS9960_CONF_POWER_ON = 0
}
 apds9960 conf enumeration definition More...
enum  apds9960_proximity_interrupt_cycle_t {
  APDS9960_PROXIMITY_INTERRUPT_CYCLE_EVERY = 0 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_ANY = 1 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_2 = 2 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_3 = 3 ,
  APDS9960_PROXIMITY_INTERRUPT_CYCLE_4 = 4 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_5 = 5 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_6 = 6 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_7 = 7 ,
  APDS9960_PROXIMITY_INTERRUPT_CYCLE_8 = 8 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_9 = 9 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_10 = 10 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_11 = 11 ,
  APDS9960_PROXIMITY_INTERRUPT_CYCLE_12 = 12 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_13 = 13 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_14 = 14 , APDS9960_PROXIMITY_INTERRUPT_CYCLE_15 = 15
}
 apds9960 proximity interrupt cycle enumeration definition More...
enum  apds9960_als_interrupt_cycle_t {
  APDS9960_ALS_INTERRUPT_CYCLE_EVERY = 0 , APDS9960_ALS_INTERRUPT_CYCLE_ANY = 1 , APDS9960_ALS_INTERRUPT_CYCLE_2 = 2 , APDS9960_ALS_INTERRUPT_CYCLE_3 = 3 ,
  APDS9960_ALS_INTERRUPT_CYCLE_5 = 4 , APDS9960_ALS_INTERRUPT_CYCLE_10 = 5 , APDS9960_ALS_INTERRUPT_CYCLE_15 = 6 , APDS9960_ALS_INTERRUPT_CYCLE_20 = 7 ,
  APDS9960_ALS_INTERRUPT_CYCLE_25 = 8 , APDS9960_ALS_INTERRUPT_CYCLE_30 = 9 , APDS9960_ALS_INTERRUPT_CYCLE_35 = 10 , APDS9960_ALS_INTERRUPT_CYCLE_40 = 11 ,
  APDS9960_ALS_INTERRUPT_CYCLE_45 = 12 , APDS9960_ALS_INTERRUPT_CYCLE_50 = 13 , APDS9960_ALS_INTERRUPT_CYCLE_55 = 14 , APDS9960_ALS_INTERRUPT_CYCLE_60 = 15
}
 apds9960 als interrupt cycle enumeration definition More...
enum  apds9960_proximity_pulse_length_t { APDS9960_PROXIMITY_PULSE_LENGTH_4_US = 0x00 , APDS9960_PROXIMITY_PULSE_LENGTH_8_US = 0x01 , APDS9960_PROXIMITY_PULSE_LENGTH_16_US = 0x02 , APDS9960_PROXIMITY_PULSE_LENGTH_32_US = 0x03 }
 apds9960 proximity pulse length enumeration definition More...
enum  apds9960_led_current_t { APDS9960_LED_CURRENT_100_MA = 0x00 , APDS9960_LED_CURRENT_50_MA = 0x01 , APDS9960_LED_CURRENT_25_MA = 0x02 , APDS9960_LED_CURRENT_12P5_MA = 0x03 }
 apds9960 led current enumeration definition More...
enum  apds9960_proximity_gain_t { APDS9960_PROXIMITY_GAIN_1X = 0x00 , APDS9960_PROXIMITY_GAIN_2X = 0x01 , APDS9960_PROXIMITY_GAIN_4X = 0x02 , APDS9960_PROXIMITY_GAIN_8X = 0x03 }
 apds9960 proximity gain enumeration definition More...
enum  apds9960_als_color_gain_t { APDS9960_ALS_COLOR_GAIN_1X = 0x00 , APDS9960_ALS_COLOR_GAIN_4X = 0x01 , APDS9960_ALS_COLOR_GAIN_16X = 0x02 , APDS9960_ALS_COLOR_GAIN_64X = 0x03 }
 apds9960 als and color gain enumeration definition More...
enum  apds9960_saturation_interrupt_t { APDS9960_SATURATION_INTERRUPT_PROXIMITY = 7 , APDS9960_SATURATION_INTERRUPT_CLEAR_PHOTODIODE = 6 }
 apds9960 saturation interrupt enumeration definition More...
enum  apds9960_led_boost_t { APDS9960_LED_BOOST_100_PERCENTAGE = 0x00 , APDS9960_LED_BOOST_150_PERCENTAGE = 0x01 , APDS9960_LED_BOOST_200_PERCENTAGE = 0x02 , APDS9960_LED_BOOST_300_PERCENTAGE = 0x03 }
 apds9960 led boost enumeration definition More...
enum  apds9960_status_t {
  APDS9960_STATUS_CPSAT = 7 , APDS9960_STATUS_PGSAT = 6 , APDS9960_STATUS_PINT = 5 , APDS9960_STATUS_AINT = 4 ,
  APDS9960_STATUS_GINT = 2 , APDS9960_STATUS_PVALID = 1 , APDS9960_STATUS_AVALID = 0
}
 apds9960 status enumeration definition More...
enum  apds9960_proximity_mask_t { APDS9960_PROXIMITY_MASK_UP = 3 , APDS9960_PROXIMITY_MASK_DOWN = 2 , APDS9960_PROXIMITY_MASK_LEFT = 1 , APDS9960_PROXIMITY_MASK_RIGHT = 0 }
 apds9960 proximity mask enumeration definition More...
enum  apds9960_gesture_fifo_threshold_t { APDS9960_GESTURE_FIFO_THRESHOLD_1_DATASET = 0 , APDS9960_GESTURE_FIFO_THRESHOLD_4_DATASET = 1 , APDS9960_GESTURE_FIFO_THRESHOLD_8_DATASET = 2 , APDS9960_GESTURE_FIFO_THRESHOLD_16_DATASET = 3 }
 apds9960 gesture fifo threshold enumeration definition More...
enum  apds9960_gesture_exit_persistence_t { APDS9960_GESTURE_EXIT_PERSISTENCE_1ST = 0 , APDS9960_GESTURE_EXIT_PERSISTENCE_2ND = 1 , APDS9960_GESTURE_EXIT_PERSISTENCE_4TH = 2 , APDS9960_GESTURE_EXIT_PERSISTENCE_7TH = 3 }
 apds9960 gesture exit persistence enumeration definition More...
enum  apds9960_gesture_gain_control_t { APDS9960_GESTURE_GAIN_1X = 0 , APDS9960_GESTURE_GAIN_2X = 1 , APDS9960_GESTURE_GAIN_4X = 2 , APDS9960_GESTURE_GAIN_8X = 3 }
 apds9960 gesture gain control enumeration definition More...
enum  apds9960_gesture_led_current_t { APDS9960_GESTURE_LED_CURRENT_100_MA = 0x00 , APDS9960_GESTURE_LED_CURRENT_50_MA = 0x01 , APDS9960_GESTURE_LED_CURRENT_25_MA = 0x02 , APDS9960_GESTURE_LED_CURRENT_12P5_MA = 0x03 }
 apds9960 gesture led current enumeration definition More...
enum  apds9960_gesture_wait_time_t {
  APDS9960_GESTURE_WAIT_TIME_0_MS = 0x00 , APDS9960_GESTURE_WAIT_TIME_2P8_MS = 0x01 , APDS9960_GESTURE_WAIT_TIME_5P6_MS = 0x02 , APDS9960_GESTURE_WAIT_TIME_8P4_MS = 0x03 ,
  APDS9960_GESTURE_WAIT_TIME_14_MS = 0x04 , APDS9960_GESTURE_WAIT_TIME_22P4_MS = 0x05 , APDS9960_GESTURE_WAIT_TIME_30P8_MS = 0x06 , APDS9960_GESTURE_WAIT_TIME_39P2_MS = 0x07
}
 apds9960 gesture wait time enumeration definition More...
enum  apds9960_gesture_pulse_length_t { APDS9960_GESTURE_PULSE_LENGTH_4_US = 0x00 , APDS9960_GESTURE_PULSE_LENGTH_8_US = 0x01 , APDS9960_GESTURE_PULSE_LENGTH_16_US = 0x02 , APDS9960_GESTURE_PULSE_LENGTH_32_US = 0x03 }
 apds9960 gesture pulse length enumeration definition More...
enum  apds9960_gesture_dimension_select_t { APDS9960_GESTURE_DIMENSION_SELECT_BOTH_PAIRS_ACTIVE = 0x00 , APDS9960_GESTURE_DIMENSION_SELECT_ONLY_UP_DOWN_PAIRS_ACTIVE = 0x01 , APDS9960_GESTURE_DIMENSION_SELECT_ONLY_LEFT_RIGHT_PAIRS_ACTIVE = 0x02 }
 apds9960 gesture dimension select enumeration definition More...
enum  apds9960_gesture_status_t { APDS9960_GESTURE_STATUS_FIFO_OVERFLOW = 0x01 , APDS9960_GESTURE_STATUS_FIFO_VALID = 0x00 }
 apds9960 gesture status enumeration definition More...
enum  apds9960_interrupt_status_t {
  APDS9960_INTERRUPT_STATUS_GESTURE_LEFT = 15 , APDS9960_INTERRUPT_STATUS_GESTURE_RIGHT = 14 , APDS9960_INTERRUPT_STATUS_GESTURE_UP = 13 , APDS9960_INTERRUPT_STATUS_GESTURE_DOWN = 12 ,
  APDS9960_INTERRUPT_STATUS_GESTURE_NEAR = 11 , APDS9960_INTERRUPT_STATUS_GESTURE_FAR = 10 , APDS9960_INTERRUPT_STATUS_GFOV = 9 , APDS9960_INTERRUPT_STATUS_GVALID = 8 ,
  APDS9960_INTERRUPT_STATUS_CPSAT = 7 , APDS9960_INTERRUPT_STATUS_PGSAT = 6 , APDS9960_INTERRUPT_STATUS_PINT = 5 , APDS9960_INTERRUPT_STATUS_AINT = 4 ,
  APDS9960_INTERRUPT_STATUS_GINT = 2 , APDS9960_INTERRUPT_STATUS_PVALID = 1 , APDS9960_INTERRUPT_STATUS_AVALID = 0
}
 apds9960 interrupt status enumeration definition More...

Functions

uint8_t apds9960_info (apds9960_info_t *info)
 get chip's information
uint8_t apds9960_irq_handler (apds9960_handle_t *handle)
 irq handler
uint8_t apds9960_init (apds9960_handle_t *handle)
 initialize the chip
uint8_t apds9960_deinit (apds9960_handle_t *handle)
 close the chip
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
uint8_t apds9960_read_proximity (apds9960_handle_t *handle, uint8_t *proximity)
 read the proximity data
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_gesture_decode (apds9960_handle_t *handle, uint8_t(*data)[4], uint8_t len)
 decode gestures from the fifo data
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_threshold (apds9960_handle_t *handle, uint8_t *threshold)
 get the gesture decode threshold
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_gesture_decode_sensitivity_1 (apds9960_handle_t *handle, int32_t *sensitivity)
 get the gesture decode sensitivity 1
uint8_t apds9960_set_gesture_decode_sensitivity_2 (apds9960_handle_t *handle, int32_t sensitivity)
 set the gesture decode sensitivity 2
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_conf (apds9960_handle_t *handle, apds9960_conf_t conf, apds9960_bool_t enable)
 set the configuration
uint8_t apds9960_get_conf (apds9960_handle_t *handle, apds9960_conf_t conf, apds9960_bool_t *enable)
 get the configuration
uint8_t apds9960_set_adc_integration_time (apds9960_handle_t *handle, uint8_t integration_time)
 set the adc integration time
uint8_t apds9960_get_adc_integration_time (apds9960_handle_t *handle, uint8_t *integration_time)
 get the adc integration time
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_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_set_wait_time (apds9960_handle_t *handle, uint8_t wait_time)
 set the wait time
uint8_t apds9960_get_wait_time (apds9960_handle_t *handle, uint8_t *wait_time)
 get the wait time
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_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_set_als_interrupt_low_threshold (apds9960_handle_t *handle, uint16_t threshold)
 set the als interrupt low 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_als_interrupt_high_threshold (apds9960_handle_t *handle, uint16_t threshold)
 set the als interrupt high threshold
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_proximity_interrupt_low_threshold (apds9960_handle_t *handle, uint8_t threshold)
 set the proximity interrupt low threshold
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_proximity_interrupt_high_threshold (apds9960_handle_t *handle, uint8_t threshold)
 set the proximity interrupt high threshold
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_proximity_interrupt_cycle (apds9960_handle_t *handle, apds9960_proximity_interrupt_cycle_t cycle)
 set the proximity interrupt cycle
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_set_als_interrupt_cycle (apds9960_handle_t *handle, apds9960_als_interrupt_cycle_t cycle)
 set the als interrupt cycle
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_wait_long (apds9960_handle_t *handle, apds9960_bool_t enable)
 enable or disable the wait long
uint8_t apds9960_get_wait_long (apds9960_handle_t *handle, apds9960_bool_t *enable)
 get the wait long status
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_get_proximity_pulse_length (apds9960_handle_t *handle, apds9960_proximity_pulse_length_t *len)
 get the proximity pulse length
uint8_t apds9960_set_proximity_pulse_count (apds9960_handle_t *handle, uint16_t count)
 set the proximity pulse count
uint8_t apds9960_get_proximity_pulse_count (apds9960_handle_t *handle, uint16_t *count)
 get the proximity pulse count
uint8_t apds9960_set_led_current (apds9960_handle_t *handle, apds9960_led_current_t current)
 set the led current
uint8_t apds9960_get_led_current (apds9960_handle_t *handle, apds9960_led_current_t *current)
 get the led current
uint8_t apds9960_set_proximity_gain (apds9960_handle_t *handle, apds9960_proximity_gain_t gain)
 set the proximity gain
uint8_t apds9960_get_proximity_gain (apds9960_handle_t *handle, apds9960_proximity_gain_t *gain)
 get the proximity gain
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_als_color_gain (apds9960_handle_t *handle, apds9960_als_color_gain_t *gain)
 get the als color gain
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_get_saturation_interrupt (apds9960_handle_t *handle, apds9960_saturation_interrupt_t saturation, apds9960_bool_t *enable)
 get the saturation interrupt
uint8_t apds9960_set_led_boost (apds9960_handle_t *handle, apds9960_led_boost_t boost)
 set the led boost
uint8_t apds9960_get_led_boost (apds9960_handle_t *handle, apds9960_led_boost_t *boost)
 get the led boost
uint8_t apds9960_get_status (apds9960_handle_t *handle, uint8_t *status)
 get the status
uint8_t apds9960_set_proximity_up_right_offset (apds9960_handle_t *handle, int8_t offset)
 set the proximity up right 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_proximity_down_left_offset (apds9960_handle_t *handle, int8_t offset)
 set the proximity down left offset
uint8_t apds9960_get_proximity_down_left_offset (apds9960_handle_t *handle, int8_t *offset)
 get the proximity down left offset
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_proximity_gain_compensation (apds9960_handle_t *handle, apds9960_bool_t *enable)
 get the proximity gain compensation status
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_sleep_after_interrupt (apds9960_handle_t *handle, apds9960_bool_t *enable)
 get the sleeping after interrupt status
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_get_proximity_mask (apds9960_handle_t *handle, apds9960_proximity_mask_t mask, apds9960_bool_t *enable)
 get the proximity mask status
uint8_t apds9960_set_gesture_proximity_enter_threshold (apds9960_handle_t *handle, uint8_t threshold)
 set the gesture proximity enter threshold
uint8_t apds9960_get_gesture_proximity_enter_threshold (apds9960_handle_t *handle, uint8_t *threshold)
 get the gesture proximity enter threshold
uint8_t apds9960_set_gesture_proximity_exit_threshold (apds9960_handle_t *handle, uint8_t threshold)
 set the gesture proximity exit threshold
uint8_t apds9960_get_gesture_proximity_exit_threshold (apds9960_handle_t *handle, uint8_t *threshold)
 get the gesture proximity exit threshold
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_get_gesture_fifo_threshold (apds9960_handle_t *handle, apds9960_gesture_fifo_threshold_t *threshold)
 get the gesture fifo threshold
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_exit_persistence (apds9960_handle_t *handle, apds9960_gesture_exit_persistence_t *persistence)
 get the gesture exit persistence
uint8_t apds9960_set_gesture_exit_mask (apds9960_handle_t *handle, uint8_t mask)
 set the gesture exit mask
uint8_t apds9960_get_gesture_exit_mask (apds9960_handle_t *handle, uint8_t *mask)
 get the gesture exit mask
uint8_t apds9960_set_gesture_gain (apds9960_handle_t *handle, apds9960_gesture_gain_control_t gain)
 set the gesture gain
uint8_t apds9960_get_gesture_gain (apds9960_handle_t *handle, apds9960_gesture_gain_control_t *gain)
 get the gesture gain
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_led_current (apds9960_handle_t *handle, apds9960_gesture_led_current_t *current)
 get the gesture led current
uint8_t apds9960_set_gesture_wait_time (apds9960_handle_t *handle, apds9960_gesture_wait_time_t t)
 set the gesture wait time
uint8_t apds9960_get_gesture_wait_time (apds9960_handle_t *handle, apds9960_gesture_wait_time_t *t)
 get the gesture wait time
uint8_t apds9960_set_gesture_up_offset (apds9960_handle_t *handle, int8_t offset)
 set the gesture up offset
uint8_t apds9960_get_gesture_up_offset (apds9960_handle_t *handle, int8_t *offset)
 get the gesture up offset
uint8_t apds9960_set_gesture_down_offset (apds9960_handle_t *handle, int8_t offset)
 set the gesture down offset
uint8_t apds9960_get_gesture_down_offset (apds9960_handle_t *handle, int8_t *offset)
 get the gesture down offset
uint8_t apds9960_set_gesture_left_offset (apds9960_handle_t *handle, int8_t offset)
 set the gesture left offset
uint8_t apds9960_get_gesture_left_offset (apds9960_handle_t *handle, int8_t *offset)
 get the gesture left offset
uint8_t apds9960_set_gesture_right_offset (apds9960_handle_t *handle, int8_t offset)
 set the gesture right offset
uint8_t apds9960_get_gesture_right_offset (apds9960_handle_t *handle, int8_t *offset)
 get the gesture 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_get_gesture_pulse_length (apds9960_handle_t *handle, apds9960_gesture_pulse_length_t *len)
 get the gesture pulse length
uint8_t apds9960_set_gesture_pulse_count (apds9960_handle_t *handle, uint16_t count)
 set the gesture pulse count
uint8_t apds9960_get_gesture_pulse_count (apds9960_handle_t *handle, uint16_t *count)
 get the gesture pulse count
uint8_t apds9960_set_gesture_dimension (apds9960_handle_t *handle, apds9960_gesture_dimension_select_t s)
 set the gesture dimension
uint8_t apds9960_get_gesture_dimension_select (apds9960_handle_t *handle, apds9960_gesture_dimension_select_t *s)
 get the gesture dimension
uint8_t apds9960_gesture_fifo_clear (apds9960_handle_t *handle)
 clear the gesture fifo status
uint8_t apds9960_set_gesture_interrupt (apds9960_handle_t *handle, apds9960_bool_t enable)
 enable or disable the gesture interrupt
uint8_t apds9960_get_gesture_interrupt (apds9960_handle_t *handle, apds9960_bool_t *enable)
 get the gesture interrupt status
uint8_t apds9960_set_gesture_mode (apds9960_handle_t *handle, apds9960_bool_t enable)
 enable or disable the gesture mode
uint8_t apds9960_get_gesture_mode (apds9960_handle_t *handle, apds9960_bool_t *enable)
 get the gesture mode status
uint8_t apds9960_get_gesture_fifo_level (apds9960_handle_t *handle, uint8_t *level)
 get the gesture fifo level
uint8_t apds9960_get_gesture_status (apds9960_handle_t *handle, uint8_t *status)
 get the gesture status
uint8_t apds9960_force_interrupt (apds9960_handle_t *handle)
 force an interrupt
uint8_t apds9960_proximity_interrupt_clear (apds9960_handle_t *handle)
 clear the proximity interrupt
uint8_t apds9960_als_interrupt_clear (apds9960_handle_t *handle)
 clear the als interrupt
uint8_t apds9960_all_non_gesture_interrupt_clear (apds9960_handle_t *handle)
 clear the all not gesture interrupt

Detailed Description

apds9960 basic driver modules

Macro Definition Documentation

◆ APDS9960_GESTURE_SENSITIVITY_1

#define APDS9960_GESTURE_SENSITIVITY_1   50

50

Definition at line 67 of file driver_apds9960.h.

◆ APDS9960_GESTURE_SENSITIVITY_2

#define APDS9960_GESTURE_SENSITIVITY_2   20

20

Definition at line 71 of file driver_apds9960.h.

◆ APDS9960_GESTURE_THRESHOLD

#define APDS9960_GESTURE_THRESHOLD   10

apds9960 gesture algorithm params definition

10

Definition at line 63 of file driver_apds9960.h.

Typedef Documentation

◆ apds9960_handle_t

apds9960 handle structure definition

◆ apds9960_info_t

apds9960 information structure definition

Enumeration Type Documentation

◆ apds9960_als_color_gain_t

apds9960 als and color gain enumeration definition

Enumerator
APDS9960_ALS_COLOR_GAIN_1X 

1x

APDS9960_ALS_COLOR_GAIN_4X 

4x

APDS9960_ALS_COLOR_GAIN_16X 

16x

APDS9960_ALS_COLOR_GAIN_64X 

64x

Definition at line 179 of file driver_apds9960.h.

◆ apds9960_als_interrupt_cycle_t

apds9960 als interrupt cycle enumeration definition

Enumerator
APDS9960_ALS_INTERRUPT_CYCLE_EVERY 

every als cycle

APDS9960_ALS_INTERRUPT_CYCLE_ANY 

any als value outside of threshold range

APDS9960_ALS_INTERRUPT_CYCLE_2 

2 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_3 

3 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_5 

5 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_10 

10 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_15 

15 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_20 

20 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_25 

25 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_30 

30 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_35 

35 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_40 

40 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_45 

45 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_50 

50 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_55 

55 consecutive als values out of range

APDS9960_ALS_INTERRUPT_CYCLE_60 

60 consecutive als values out of range

Definition at line 123 of file driver_apds9960.h.

◆ apds9960_bool_t

apds9960 bool enumeration definition

Enumerator
APDS9960_BOOL_FALSE 

false

APDS9960_BOOL_TRUE 

true

Definition at line 77 of file driver_apds9960.h.

◆ apds9960_conf_t

apds9960 conf enumeration definition

Enumerator
APDS9960_CONF_GESTURE_ENABLE 

gesture enable

APDS9960_CONF_PROXIMITY_INTERRUPT_ENABLE 

proximity interrupt enable

APDS9960_CONF_ALS_INTERRUPT_ENABLE 

als interrupt enable

APDS9960_CONF_WAIT_ENABLE 

wait enable

APDS9960_CONF_PROXIMITY_DETECT_ENABLE 

proximity detect enable

APDS9960_CONF_ALS_ENABLE 

als enable

APDS9960_CONF_POWER_ON 

power on

Definition at line 86 of file driver_apds9960.h.

◆ apds9960_gesture_dimension_select_t

apds9960 gesture dimension select enumeration definition

Enumerator
APDS9960_GESTURE_DIMENSION_SELECT_BOTH_PAIRS_ACTIVE 

both pairs are active

APDS9960_GESTURE_DIMENSION_SELECT_ONLY_UP_DOWN_PAIRS_ACTIVE 

only the up down pair is active

APDS9960_GESTURE_DIMENSION_SELECT_ONLY_LEFT_RIGHT_PAIRS_ACTIVE 

only the left right pair is active

Definition at line 305 of file driver_apds9960.h.

◆ apds9960_gesture_exit_persistence_t

apds9960 gesture exit persistence enumeration definition

Enumerator
APDS9960_GESTURE_EXIT_PERSISTENCE_1ST 

1st 'gesture end' occurrence results in gesture state machine exit

APDS9960_GESTURE_EXIT_PERSISTENCE_2ND 

2nd 'gesture end' occurrence results in gesture state machine exit

APDS9960_GESTURE_EXIT_PERSISTENCE_4TH 

4th 'gesture end' occurrence results in gesture state machine exit

APDS9960_GESTURE_EXIT_PERSISTENCE_7TH 

7th 'gesture end' occurrence results in gesture state machine exit

Definition at line 246 of file driver_apds9960.h.

◆ apds9960_gesture_fifo_threshold_t

apds9960 gesture fifo threshold enumeration definition

Enumerator
APDS9960_GESTURE_FIFO_THRESHOLD_1_DATASET 

interrupt is generated after 1 dataset is added to fifo

APDS9960_GESTURE_FIFO_THRESHOLD_4_DATASET 

interrupt is generated after 4 dataset is added to fifo

APDS9960_GESTURE_FIFO_THRESHOLD_8_DATASET 

interrupt is generated after 8 dataset is added to fifo

APDS9960_GESTURE_FIFO_THRESHOLD_16_DATASET 

interrupt is generated after 16 dataset is added to fifo

Definition at line 235 of file driver_apds9960.h.

◆ apds9960_gesture_gain_control_t

apds9960 gesture gain control enumeration definition

Enumerator
APDS9960_GESTURE_GAIN_1X 

1x

APDS9960_GESTURE_GAIN_2X 

2x

APDS9960_GESTURE_GAIN_4X 

4x

APDS9960_GESTURE_GAIN_8X 

8x

Definition at line 257 of file driver_apds9960.h.

◆ apds9960_gesture_led_current_t

apds9960 gesture led current enumeration definition

Enumerator
APDS9960_GESTURE_LED_CURRENT_100_MA 

100 mA

APDS9960_GESTURE_LED_CURRENT_50_MA 

50 mA

APDS9960_GESTURE_LED_CURRENT_25_MA 

25 mA

APDS9960_GESTURE_LED_CURRENT_12P5_MA 

12.5 mA

Definition at line 268 of file driver_apds9960.h.

◆ apds9960_gesture_pulse_length_t

apds9960 gesture pulse length enumeration definition

Enumerator
APDS9960_GESTURE_PULSE_LENGTH_4_US 

4 us

APDS9960_GESTURE_PULSE_LENGTH_8_US 

8 us

APDS9960_GESTURE_PULSE_LENGTH_16_US 

16 us

APDS9960_GESTURE_PULSE_LENGTH_32_US 

32 us

Definition at line 294 of file driver_apds9960.h.

◆ apds9960_gesture_status_t

apds9960 gesture status enumeration definition

Enumerator
APDS9960_GESTURE_STATUS_FIFO_OVERFLOW 

gesture fifo overflow

APDS9960_GESTURE_STATUS_FIFO_VALID 

gesture fifo data

Definition at line 315 of file driver_apds9960.h.

◆ apds9960_gesture_wait_time_t

apds9960 gesture wait time enumeration definition

Enumerator
APDS9960_GESTURE_WAIT_TIME_0_MS 

0 ms

APDS9960_GESTURE_WAIT_TIME_2P8_MS 

2.8 ms

APDS9960_GESTURE_WAIT_TIME_5P6_MS 

5.6 ms

APDS9960_GESTURE_WAIT_TIME_8P4_MS 

8.4 ms

APDS9960_GESTURE_WAIT_TIME_14_MS 

14 ms

APDS9960_GESTURE_WAIT_TIME_22P4_MS 

22.4 ms

APDS9960_GESTURE_WAIT_TIME_30P8_MS 

30.8 ms

APDS9960_GESTURE_WAIT_TIME_39P2_MS 

39.2 ms

Definition at line 279 of file driver_apds9960.h.

◆ apds9960_interrupt_status_t

apds9960 interrupt status enumeration definition

Enumerator
APDS9960_INTERRUPT_STATUS_GESTURE_LEFT 

gesture left

APDS9960_INTERRUPT_STATUS_GESTURE_RIGHT 

gesture right

APDS9960_INTERRUPT_STATUS_GESTURE_UP 

gesture up

APDS9960_INTERRUPT_STATUS_GESTURE_DOWN 

gesture down

APDS9960_INTERRUPT_STATUS_GESTURE_NEAR 

gesture near

APDS9960_INTERRUPT_STATUS_GESTURE_FAR 

gesture far

APDS9960_INTERRUPT_STATUS_GFOV 

gesture fifo overflow

APDS9960_INTERRUPT_STATUS_GVALID 

gesture fifo data

APDS9960_INTERRUPT_STATUS_CPSAT 

clear photo diode saturation

APDS9960_INTERRUPT_STATUS_PGSAT 

indicates that an analog saturation event occurred during a previous proximity or gesture cycle

APDS9960_INTERRUPT_STATUS_PINT 

proximity interrupt

APDS9960_INTERRUPT_STATUS_AINT 

als interrupt

APDS9960_INTERRUPT_STATUS_GINT 

gesture interrupt

APDS9960_INTERRUPT_STATUS_PVALID 

proximity valid

APDS9960_INTERRUPT_STATUS_AVALID 

als valid

Definition at line 324 of file driver_apds9960.h.

◆ apds9960_led_boost_t

apds9960 led boost enumeration definition

Enumerator
APDS9960_LED_BOOST_100_PERCENTAGE 

100%

APDS9960_LED_BOOST_150_PERCENTAGE 

150%

APDS9960_LED_BOOST_200_PERCENTAGE 

200%

APDS9960_LED_BOOST_300_PERCENTAGE 

300%

Definition at line 199 of file driver_apds9960.h.

◆ apds9960_led_current_t

apds9960 led current enumeration definition

Enumerator
APDS9960_LED_CURRENT_100_MA 

100 mA

APDS9960_LED_CURRENT_50_MA 

50 mA

APDS9960_LED_CURRENT_25_MA 

25 mA

APDS9960_LED_CURRENT_12P5_MA 

12.5 mA

Definition at line 157 of file driver_apds9960.h.

◆ apds9960_proximity_gain_t

apds9960 proximity gain enumeration definition

Enumerator
APDS9960_PROXIMITY_GAIN_1X 

1x

APDS9960_PROXIMITY_GAIN_2X 

2x

APDS9960_PROXIMITY_GAIN_4X 

4x

APDS9960_PROXIMITY_GAIN_8X 

8x

Definition at line 168 of file driver_apds9960.h.

◆ apds9960_proximity_interrupt_cycle_t

apds9960 proximity interrupt cycle enumeration definition

Enumerator
APDS9960_PROXIMITY_INTERRUPT_CYCLE_EVERY 

every proximity cycle

APDS9960_PROXIMITY_INTERRUPT_CYCLE_ANY 

any proximity value outside of threshold range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_2 

2 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_3 

3 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_4 

4 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_5 

5 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_6 

6 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_7 

7 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_8 

8 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_9 

9 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_10 

10 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_11 

11 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_12 

12 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_13 

13 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_14 

14 consecutive proximity values out of range

APDS9960_PROXIMITY_INTERRUPT_CYCLE_15 

15 consecutive proximity values out of range

Definition at line 100 of file driver_apds9960.h.

◆ apds9960_proximity_mask_t

apds9960 proximity mask enumeration definition

Enumerator
APDS9960_PROXIMITY_MASK_UP 

proximity mask up

APDS9960_PROXIMITY_MASK_DOWN 

proximity mask down

APDS9960_PROXIMITY_MASK_LEFT 

proximity mask left

APDS9960_PROXIMITY_MASK_RIGHT 

proximity mask right

Definition at line 224 of file driver_apds9960.h.

◆ apds9960_proximity_pulse_length_t

apds9960 proximity pulse length enumeration definition

Enumerator
APDS9960_PROXIMITY_PULSE_LENGTH_4_US 

4 us

APDS9960_PROXIMITY_PULSE_LENGTH_8_US 

8 us

APDS9960_PROXIMITY_PULSE_LENGTH_16_US 

16 us

APDS9960_PROXIMITY_PULSE_LENGTH_32_US 

32 us

Definition at line 146 of file driver_apds9960.h.

◆ apds9960_saturation_interrupt_t

apds9960 saturation interrupt enumeration definition

Enumerator
APDS9960_SATURATION_INTERRUPT_PROXIMITY 

proximity saturation interrupt

APDS9960_SATURATION_INTERRUPT_CLEAR_PHOTODIODE 

clear photo diode saturation interrupt

Definition at line 190 of file driver_apds9960.h.

◆ apds9960_status_t

apds9960 status enumeration definition

Enumerator
APDS9960_STATUS_CPSAT 

clear photo diode saturation

APDS9960_STATUS_PGSAT 

indicates that an analog saturation event occurred during a previous proximity or gesture cycle

APDS9960_STATUS_PINT 

proximity interrupt

APDS9960_STATUS_AINT 

als interrupt

APDS9960_STATUS_GINT 

gesture interrupt

APDS9960_STATUS_PVALID 

proximity valid

APDS9960_STATUS_AVALID 

als valid

Definition at line 210 of file driver_apds9960.h.

Function Documentation

◆ apds9960_adc_integration_time_convert_to_data()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]regregister raw data
[out]*mspointer to an adc integration time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1119 of file driver_apds9960.c.

◆ apds9960_adc_integration_time_convert_to_register()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]msintegration time
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1092 of file driver_apds9960.c.

◆ apds9960_all_non_gesture_interrupt_clear()

uint8_t apds9960_all_non_gesture_interrupt_clear ( apds9960_handle_t * handle)

clear the all not gesture interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 all non gesture interrupt clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4654 of file driver_apds9960.c.

◆ apds9960_als_interrupt_clear()

uint8_t apds9960_als_interrupt_clear ( apds9960_handle_t * handle)

clear the als interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 als interrupt clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4618 of file driver_apds9960.c.

◆ apds9960_deinit()

uint8_t apds9960_deinit ( apds9960_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 263 of file driver_apds9960.c.

◆ apds9960_force_interrupt()

uint8_t apds9960_force_interrupt ( apds9960_handle_t * handle)

force an interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 force interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4546 of file driver_apds9960.c.

◆ apds9960_gesture_decode()

uint8_t apds9960_gesture_decode ( apds9960_handle_t * handle,
uint8_t(*) data[4],
uint8_t len )

decode gestures from the fifo data

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]**datapointer to data buffer
[in]lenlength of the data buffer
Returns
status code
  • 0 success
  • 1 decode gesture from fifo failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 decode failed
Note
none

Definition at line 532 of file driver_apds9960.c.

◆ apds9960_gesture_fifo_clear()

uint8_t apds9960_gesture_fifo_clear ( apds9960_handle_t * handle)

clear the gesture fifo status

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 gesture fifo clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4264 of file driver_apds9960.c.

◆ apds9960_get_adc_integration_time()

uint8_t apds9960_get_adc_integration_time ( apds9960_handle_t * handle,
uint8_t * integration_time )

get the adc integration time

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*integration_timepointer to an adc integration time buffer
Returns
status code
  • 0 success
  • 1 get adc integration time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1055 of file driver_apds9960.c.

◆ apds9960_get_als_color_gain()

uint8_t apds9960_get_als_color_gain ( apds9960_handle_t * handle,
apds9960_als_color_gain_t * gain )

get the als color gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*gainpointer to an als color gain buffer
Returns
status code
  • 0 success
  • 1 get als color gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2236 of file driver_apds9960.c.

◆ apds9960_get_als_interrupt_cycle()

uint8_t apds9960_get_als_interrupt_cycle ( apds9960_handle_t * handle,
apds9960_als_interrupt_cycle_t * cycle )

get the als interrupt cycle

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*cyclepointer to an als interrupt cycle buffer
Returns
status code
  • 0 success
  • 1 get als interrupt cycle failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1737 of file driver_apds9960.c.

◆ apds9960_get_als_interrupt_high_threshold()

uint8_t apds9960_get_als_interrupt_high_threshold ( apds9960_handle_t * handle,
uint16_t * threshold )

get the als interrupt high threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a high threshold buffer
Returns
status code
  • 0 success
  • 1 get als interrupt high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1425 of file driver_apds9960.c.

◆ apds9960_get_als_interrupt_low_threshold()

uint8_t apds9960_get_als_interrupt_low_threshold ( apds9960_handle_t * handle,
uint16_t * threshold )

get the als interrupt low threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a low threshold buffer
Returns
status code
  • 0 success
  • 1 get als interrupt low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1350 of file driver_apds9960.c.

◆ apds9960_get_conf()

uint8_t apds9960_get_conf ( apds9960_handle_t * handle,
apds9960_conf_t conf,
apds9960_bool_t * enable )

get the configuration

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]confchip configuration
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get conf failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 981 of file driver_apds9960.c.

◆ apds9960_get_gesture_decode_sensitivity_1()

uint8_t apds9960_get_gesture_decode_sensitivity_1 ( apds9960_handle_t * handle,
int32_t * sensitivity )

get the gesture decode sensitivity 1

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*sensitivitypointer to a gesture decode sensitivity buffer
Returns
status code
  • 0 success
  • 1 get gesture decode sensitivity 1 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 853 of file driver_apds9960.c.

◆ apds9960_get_gesture_decode_sensitivity_2()

uint8_t apds9960_get_gesture_decode_sensitivity_2 ( apds9960_handle_t * handle,
int32_t * sensitivity )

get the gesture decode sensitivity 2

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*sensitivitypointer to a gesture decode sensitivity buffer
Returns
status code
  • 0 success
  • 1 get gesture decode sensitivity 2 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 907 of file driver_apds9960.c.

◆ apds9960_get_gesture_decode_threshold()

uint8_t apds9960_get_gesture_decode_threshold ( apds9960_handle_t * handle,
uint8_t * threshold )

get the gesture decode threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a gesture decode threshold buffer
Returns
status code
  • 0 success
  • 1 get gesture decode threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 799 of file driver_apds9960.c.

◆ apds9960_get_gesture_dimension_select()

uint8_t apds9960_get_gesture_dimension_select ( apds9960_handle_t * handle,
apds9960_gesture_dimension_select_t * s )

get the gesture dimension

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*spointer to a gesture dimension buffer
Returns
status code
  • 0 success
  • 1 get gesture dimension failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4228 of file driver_apds9960.c.

◆ apds9960_get_gesture_down_offset()

uint8_t apds9960_get_gesture_down_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the gesture down offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a gesture down offset buffer
Returns
status code
  • 0 success
  • 1 get gesture down offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3787 of file driver_apds9960.c.

◆ apds9960_get_gesture_exit_mask()

uint8_t apds9960_get_gesture_exit_mask ( apds9960_handle_t * handle,
uint8_t * mask )

get the gesture exit mask

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*maskpointer to an exit mask buffer
Returns
status code
  • 0 success
  • 1 get gesture exit mask failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3369 of file driver_apds9960.c.

◆ apds9960_get_gesture_exit_persistence()

uint8_t apds9960_get_gesture_exit_persistence ( apds9960_handle_t * handle,
apds9960_gesture_exit_persistence_t * persistence )

get the gesture exit persistence

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*persistencepointer to a gesture exit persistence buffer
Returns
status code
  • 0 success
  • 1 get gesture exit persistence failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3280 of file driver_apds9960.c.

◆ apds9960_get_gesture_fifo_level()

uint8_t apds9960_get_gesture_fifo_level ( apds9960_handle_t * handle,
uint8_t * level )

get the gesture fifo level

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*levelpointer to a gesture fifo level buffer
Returns
status code
  • 0 success
  • 1 get gesture fifo level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4473 of file driver_apds9960.c.

◆ apds9960_get_gesture_fifo_threshold()

uint8_t apds9960_get_gesture_fifo_threshold ( apds9960_handle_t * handle,
apds9960_gesture_fifo_threshold_t * threshold )

get the gesture fifo threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a gesture fifo threshold buffer
Returns
status code
  • 0 success
  • 1 get gesture fifo threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3198 of file driver_apds9960.c.

◆ apds9960_get_gesture_gain()

uint8_t apds9960_get_gesture_gain ( apds9960_handle_t * handle,
apds9960_gesture_gain_control_t * gain )

get the gesture gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*gainpointer to a gesture gain buffer
Returns
status code
  • 0 success
  • 1 get gesture gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3451 of file driver_apds9960.c.

◆ apds9960_get_gesture_interrupt()

uint8_t apds9960_get_gesture_interrupt ( apds9960_handle_t * handle,
apds9960_bool_t * enable )

get the gesture interrupt status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get gesture interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4354 of file driver_apds9960.c.

◆ apds9960_get_gesture_led_current()

uint8_t apds9960_get_gesture_led_current ( apds9960_handle_t * handle,
apds9960_gesture_led_current_t * current )

get the gesture led current

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*currentpointer to a gesture led current buffer
Returns
status code
  • 0 success
  • 1 get gesture led current failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3533 of file driver_apds9960.c.

◆ apds9960_get_gesture_left_offset()

uint8_t apds9960_get_gesture_left_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the gesture left offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a gesture left offset buffer
Returns
status code
  • 0 success
  • 1 get gesture left offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3877 of file driver_apds9960.c.

◆ apds9960_get_gesture_mode()

uint8_t apds9960_get_gesture_mode ( apds9960_handle_t * handle,
apds9960_bool_t * enable )

get the gesture mode status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get gesture mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4436 of file driver_apds9960.c.

◆ apds9960_get_gesture_proximity_enter_threshold()

uint8_t apds9960_get_gesture_proximity_enter_threshold ( apds9960_handle_t * handle,
uint8_t * threshold )

get the gesture proximity enter threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a gesture proximity enter threshold buffer
Returns
status code
  • 0 success
  • 1 get gesture proximity enter threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3042 of file driver_apds9960.c.

◆ apds9960_get_gesture_proximity_exit_threshold()

uint8_t apds9960_get_gesture_proximity_exit_threshold ( apds9960_handle_t * handle,
uint8_t * threshold )

get the gesture proximity exit threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a gesture proximity exit threshold buffer
Returns
status code
  • 0 success
  • 1 get gesture proximity exit threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3116 of file driver_apds9960.c.

◆ apds9960_get_gesture_pulse_count()

uint8_t apds9960_get_gesture_pulse_count ( apds9960_handle_t * handle,
uint16_t * count )

get the gesture pulse count

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*countpointer to a gesture pulse count buffer
Returns
status code
  • 0 success
  • 1 get gesture pulse count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4146 of file driver_apds9960.c.

◆ apds9960_get_gesture_pulse_length()

uint8_t apds9960_get_gesture_pulse_length ( apds9960_handle_t * handle,
apds9960_gesture_pulse_length_t * len )

get the gesture pulse length

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*lenpointer to a gesture pulse length buffer
Returns
status code
  • 0 success
  • 1 get gesture pulse length failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4057 of file driver_apds9960.c.

◆ apds9960_get_gesture_right_offset()

uint8_t apds9960_get_gesture_right_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the gesture right offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a gesture right offset buffer
Returns
status code
  • 0 success
  • 1 get gesture right offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3967 of file driver_apds9960.c.

◆ apds9960_get_gesture_status()

uint8_t apds9960_get_gesture_status ( apds9960_handle_t * handle,
uint8_t * status )

get the gesture status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get gesture status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4510 of file driver_apds9960.c.

◆ apds9960_get_gesture_up_offset()

uint8_t apds9960_get_gesture_up_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the gesture up offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a gesture up offset buffer
Returns
status code
  • 0 success
  • 1 get gesture up offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3697 of file driver_apds9960.c.

◆ apds9960_get_gesture_wait_time()

uint8_t apds9960_get_gesture_wait_time ( apds9960_handle_t * handle,
apds9960_gesture_wait_time_t * t )

get the gesture wait time

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*tpointer to a gesture wait time buffer
Returns
status code
  • 0 success
  • 1 get gesture wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3615 of file driver_apds9960.c.

◆ apds9960_get_led_boost()

uint8_t apds9960_get_led_boost ( apds9960_handle_t * handle,
apds9960_led_boost_t * boost )

get the led boost

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*boostpointer to a led boost buffer
Returns
status code
  • 0 success
  • 1 get led boost failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2402 of file driver_apds9960.c.

◆ apds9960_get_led_current()

uint8_t apds9960_get_led_current ( apds9960_handle_t * handle,
apds9960_led_current_t * current )

get the led current

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*currentpointer to a led current buffer
Returns
status code
  • 0 success
  • 1 get led current failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2072 of file driver_apds9960.c.

◆ apds9960_get_proximity_down_left_offset()

uint8_t apds9960_get_proximity_down_left_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the proximity down left offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a proximity offset buffer
Returns
status code
  • 0 success
  • 1 get proximity down left offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2712 of file driver_apds9960.c.

◆ apds9960_get_proximity_gain()

uint8_t apds9960_get_proximity_gain ( apds9960_handle_t * handle,
apds9960_proximity_gain_t * gain )

get the proximity gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*gainpointer to a proximity gain buffer
Returns
status code
  • 0 success
  • 1 get proximity gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2154 of file driver_apds9960.c.

◆ apds9960_get_proximity_gain_compensation()

uint8_t apds9960_get_proximity_gain_compensation ( apds9960_handle_t * handle,
apds9960_bool_t * enable )

get the proximity gain compensation status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get proximity gain compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2802 of file driver_apds9960.c.

◆ apds9960_get_proximity_interrupt_cycle()

uint8_t apds9960_get_proximity_interrupt_cycle ( apds9960_handle_t * handle,
apds9960_proximity_interrupt_cycle_t * cycle )

get the proximity interrupt cycle

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*cyclepointer to a proximity interrupt cycle buffer
Returns
status code
  • 0 success
  • 1 get proximity interrupt cycle failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1655 of file driver_apds9960.c.

◆ apds9960_get_proximity_interrupt_high_threshold()

uint8_t apds9960_get_proximity_interrupt_high_threshold ( apds9960_handle_t * handle,
uint8_t * threshold )

get the proximity interrupt high threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a high threshold buffer
Returns
status code
  • 0 success
  • 1 get proximity interrupt high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1573 of file driver_apds9960.c.

◆ apds9960_get_proximity_interrupt_low_threshold()

uint8_t apds9960_get_proximity_interrupt_low_threshold ( apds9960_handle_t * handle,
uint8_t * threshold )

get the proximity interrupt low threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*thresholdpointer to a low threshold buffer
Returns
status code
  • 0 success
  • 1 get proximity interrupt low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1499 of file driver_apds9960.c.

◆ apds9960_get_proximity_mask()

uint8_t apds9960_get_proximity_mask ( apds9960_handle_t * handle,
apds9960_proximity_mask_t mask,
apds9960_bool_t * enable )

get the proximity mask status

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]maskproximity mask
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get proximity mask failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2968 of file driver_apds9960.c.

◆ apds9960_get_proximity_pulse_count()

uint8_t apds9960_get_proximity_pulse_count ( apds9960_handle_t * handle,
uint16_t * count )

get the proximity pulse count

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*countpointer to a proximity pulse count buffer
Returns
status code
  • 0 success
  • 1 get proximity pulse count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1990 of file driver_apds9960.c.

◆ apds9960_get_proximity_pulse_length()

uint8_t apds9960_get_proximity_pulse_length ( apds9960_handle_t * handle,
apds9960_proximity_pulse_length_t * len )

get the proximity pulse length

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*lenpointer to a proximity pulse length buffer
Returns
status code
  • 0 success
  • 1 get proximity pulse length failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1901 of file driver_apds9960.c.

◆ apds9960_get_proximity_up_right_offset()

uint8_t apds9960_get_proximity_up_right_offset ( apds9960_handle_t * handle,
int8_t * offset )

get the proximity up right offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*offsetpointer to a proximity offset buffer
Returns
status code
  • 0 success
  • 1 get proximity up right offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2622 of file driver_apds9960.c.

◆ apds9960_get_saturation_interrupt()

uint8_t apds9960_get_saturation_interrupt ( apds9960_handle_t * handle,
apds9960_saturation_interrupt_t saturation,
apds9960_bool_t * enable )

get the saturation interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]saturationsaturation interrupt type
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get saturation interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2320 of file driver_apds9960.c.

◆ apds9960_get_sleep_after_interrupt()

uint8_t apds9960_get_sleep_after_interrupt ( apds9960_handle_t * handle,
apds9960_bool_t * enable )

get the sleeping after interrupt status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get sleep after interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2884 of file driver_apds9960.c.

◆ apds9960_get_status()

uint8_t apds9960_get_status ( apds9960_handle_t * handle,
uint8_t * status )

get the status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2439 of file driver_apds9960.c.

◆ apds9960_get_wait_long()

uint8_t apds9960_get_wait_long ( apds9960_handle_t * handle,
apds9960_bool_t * enable )

get the wait long status

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get wait long failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1819 of file driver_apds9960.c.

◆ apds9960_get_wait_time()

uint8_t apds9960_get_wait_time ( apds9960_handle_t * handle,
uint8_t * wait_time )

get the wait time

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*wait_timepointer to a wait time buffer
Returns
status code
  • 0 success
  • 1 get wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1183 of file driver_apds9960.c.

◆ apds9960_info()

uint8_t apds9960_info ( apds9960_info_t * info)

get chip's information

Parameters
[out]*infopointer to an apds9960 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 4802 of file driver_apds9960.c.

◆ apds9960_init()

uint8_t apds9960_init ( apds9960_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 read id failed
  • 5 id is invalid
Note
none

Definition at line 168 of file driver_apds9960.c.

◆ apds9960_irq_handler()

uint8_t apds9960_irq_handler ( apds9960_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 316 of file driver_apds9960.c.

◆ apds9960_proximity_interrupt_clear()

uint8_t apds9960_proximity_interrupt_clear ( apds9960_handle_t * handle)

clear the proximity interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
Returns
status code
  • 0 success
  • 1 proximity interrupt clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4582 of file driver_apds9960.c.

◆ apds9960_read_gesture_fifo()

uint8_t apds9960_read_gesture_fifo ( apds9960_handle_t * handle,
uint8_t(*) data[4],
uint8_t * len )

read data from the gesture fifo

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]**datapointer to a data buffer
[in,out]*lenpointer to a data length buffer
Returns
status code
  • 0 success
  • 1 read gesture fifo failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4692 of file driver_apds9960.c.

◆ apds9960_read_proximity()

uint8_t apds9960_read_proximity ( apds9960_handle_t * handle,
uint8_t * proximity )

read the proximity data

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*proximitypointer to a proximity buffer
Returns
status code
  • 0 success
  • 1 read proximity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2540 of file driver_apds9960.c.

◆ apds9960_read_rgbc()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[out]*redpointer to a red buffer
[out]*greenpointer to a green buffer
[out]*bluepointer to a blue buffer
[out]*clearpointer to a clear buffer
Returns
status code
  • 0 success
  • 1 read rgbc failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2479 of file driver_apds9960.c.

◆ apds9960_set_adc_integration_time()

uint8_t apds9960_set_adc_integration_time ( apds9960_handle_t * handle,
uint8_t integration_time )

set the adc integration time

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]integration_timeadc integration time
Returns
status code
  • 0 success
  • 1 set adc integration time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1018 of file driver_apds9960.c.

◆ apds9960_set_als_color_gain()

uint8_t apds9960_set_als_color_gain ( apds9960_handle_t * handle,
apds9960_als_color_gain_t gain )

set the als color gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]gainals color gain
Returns
status code
  • 0 success
  • 1 set als color gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2191 of file driver_apds9960.c.

◆ apds9960_set_als_interrupt_cycle()

uint8_t apds9960_set_als_interrupt_cycle ( apds9960_handle_t * handle,
apds9960_als_interrupt_cycle_t cycle )

set the als interrupt cycle

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]cycleals interrupt cycle
Returns
status code
  • 0 success
  • 1 set als interrupt cycle failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1692 of file driver_apds9960.c.

◆ apds9960_set_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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdhigh threshold
Returns
status code
  • 0 success
  • 1 set als interrupt high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1387 of file driver_apds9960.c.

◆ apds9960_set_als_interrupt_low_threshold()

uint8_t apds9960_set_als_interrupt_low_threshold ( apds9960_handle_t * handle,
uint16_t threshold )

set the als interrupt low threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdlow threshold
Returns
status code
  • 0 success
  • 1 set als interrupt low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1312 of file driver_apds9960.c.

◆ apds9960_set_conf()

uint8_t apds9960_set_conf ( apds9960_handle_t * handle,
apds9960_conf_t conf,
apds9960_bool_t enable )

set the configuration

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]confchip configuration
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set conf failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 935 of file driver_apds9960.c.

◆ apds9960_set_gesture_decode_sensitivity_1()

uint8_t apds9960_set_gesture_decode_sensitivity_1 ( apds9960_handle_t * handle,
int32_t sensitivity )

set the gesture decode sensitivity 1

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]sensitivitygesture decode sensitivity
Returns
status code
  • 0 success
  • 1 set gesture decode sensitivity 1 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 826 of file driver_apds9960.c.

◆ apds9960_set_gesture_decode_sensitivity_2()

uint8_t apds9960_set_gesture_decode_sensitivity_2 ( apds9960_handle_t * handle,
int32_t sensitivity )

set the gesture decode sensitivity 2

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]sensitivitygesture decode sensitivity
Returns
status code
  • 0 success
  • 1 set gesture decode sensitivity 2 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 880 of file driver_apds9960.c.

◆ apds9960_set_gesture_decode_threshold()

uint8_t apds9960_set_gesture_decode_threshold ( apds9960_handle_t * handle,
uint8_t threshold )

set the gesture decode threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdgesture decode threshold
Returns
status code
  • 0 success
  • 1 set gesture decode threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 772 of file driver_apds9960.c.

◆ apds9960_set_gesture_dimension()

uint8_t apds9960_set_gesture_dimension ( apds9960_handle_t * handle,
apds9960_gesture_dimension_select_t s )

set the gesture dimension

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]sgesture dimension
Returns
status code
  • 0 success
  • 1 set gesture dimension failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4183 of file driver_apds9960.c.

◆ apds9960_set_gesture_down_offset()

uint8_t apds9960_set_gesture_down_offset ( apds9960_handle_t * handle,
int8_t offset )

set the gesture down offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetgesture down offset
Returns
status code
  • 0 success
  • 1 set gesture down offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3742 of file driver_apds9960.c.

◆ apds9960_set_gesture_exit_mask()

uint8_t apds9960_set_gesture_exit_mask ( apds9960_handle_t * handle,
uint8_t mask )

set the gesture exit mask

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]maskexit mask
Returns
status code
  • 0 success
  • 1 set gesture exit mask failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 mask is over 0xF
Note
none

Definition at line 3318 of file driver_apds9960.c.

◆ apds9960_set_gesture_exit_persistence()

uint8_t apds9960_set_gesture_exit_persistence ( apds9960_handle_t * handle,
apds9960_gesture_exit_persistence_t persistence )

set the gesture exit persistence

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]persistencegesture exit persistence
Returns
status code
  • 0 success
  • 1 set gesture exit persistence failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3235 of file driver_apds9960.c.

◆ apds9960_set_gesture_fifo_threshold()

uint8_t apds9960_set_gesture_fifo_threshold ( apds9960_handle_t * handle,
apds9960_gesture_fifo_threshold_t threshold )

set the gesture fifo threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdgesture fifo threshold
Returns
status code
  • 0 success
  • 1 set gesture fifo threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3153 of file driver_apds9960.c.

◆ apds9960_set_gesture_gain()

uint8_t apds9960_set_gesture_gain ( apds9960_handle_t * handle,
apds9960_gesture_gain_control_t gain )

set the gesture gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]gaingesture gain
Returns
status code
  • 0 success
  • 1 set gesture gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3406 of file driver_apds9960.c.

◆ apds9960_set_gesture_interrupt()

uint8_t apds9960_set_gesture_interrupt ( apds9960_handle_t * handle,
apds9960_bool_t enable )

enable or disable the gesture interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set gesture interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4309 of file driver_apds9960.c.

◆ apds9960_set_gesture_led_current()

uint8_t apds9960_set_gesture_led_current ( apds9960_handle_t * handle,
apds9960_gesture_led_current_t current )

set the gesture led current

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]currentgesture led current
Returns
status code
  • 0 success
  • 1 set gesture led current failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3488 of file driver_apds9960.c.

◆ apds9960_set_gesture_left_offset()

uint8_t apds9960_set_gesture_left_offset ( apds9960_handle_t * handle,
int8_t offset )

set the gesture left offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetgesture left offset
Returns
status code
  • 0 success
  • 1 set gesture left offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3832 of file driver_apds9960.c.

◆ apds9960_set_gesture_mode()

uint8_t apds9960_set_gesture_mode ( apds9960_handle_t * handle,
apds9960_bool_t enable )

enable or disable the gesture mode

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set gesture mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4391 of file driver_apds9960.c.

◆ apds9960_set_gesture_proximity_enter_threshold()

uint8_t apds9960_set_gesture_proximity_enter_threshold ( apds9960_handle_t * handle,
uint8_t threshold )

set the gesture proximity enter threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdgesture proximity enter threshold
Returns
status code
  • 0 success
  • 1 set gesture proximity enter threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3005 of file driver_apds9960.c.

◆ apds9960_set_gesture_proximity_exit_threshold()

uint8_t apds9960_set_gesture_proximity_exit_threshold ( apds9960_handle_t * handle,
uint8_t threshold )

set the gesture proximity exit threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdgesture proximity exit threshold
Returns
status code
  • 0 success
  • 1 set gesture proximity exit threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3079 of file driver_apds9960.c.

◆ apds9960_set_gesture_pulse_count()

uint8_t apds9960_set_gesture_pulse_count ( apds9960_handle_t * handle,
uint16_t count )

set the gesture pulse count

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]countgesture pulse count
Returns
status code
  • 0 success
  • 1 set gesture pulse count failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 count is over 63
Note
none

Definition at line 4095 of file driver_apds9960.c.

◆ apds9960_set_gesture_pulse_length()

uint8_t apds9960_set_gesture_pulse_length ( apds9960_handle_t * handle,
apds9960_gesture_pulse_length_t len )

set the gesture pulse length

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]lengesture pulse length
Returns
status code
  • 0 success
  • 1 set gesture pulse length failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 4012 of file driver_apds9960.c.

◆ apds9960_set_gesture_right_offset()

uint8_t apds9960_set_gesture_right_offset ( apds9960_handle_t * handle,
int8_t offset )

set the gesture right offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetgesture right offset
Returns
status code
  • 0 success
  • 1 set gesture right offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3922 of file driver_apds9960.c.

◆ apds9960_set_gesture_up_offset()

uint8_t apds9960_set_gesture_up_offset ( apds9960_handle_t * handle,
int8_t offset )

set the gesture up offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetgesture up offset
Returns
status code
  • 0 success
  • 1 set gesture up offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3652 of file driver_apds9960.c.

◆ apds9960_set_gesture_wait_time()

uint8_t apds9960_set_gesture_wait_time ( apds9960_handle_t * handle,
apds9960_gesture_wait_time_t t )

set the gesture wait time

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]tgesture wait time
Returns
status code
  • 0 success
  • 1 set gesture wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 3570 of file driver_apds9960.c.

◆ apds9960_set_led_boost()

uint8_t apds9960_set_led_boost ( apds9960_handle_t * handle,
apds9960_led_boost_t boost )

set the led boost

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]boostled boost
Returns
status code
  • 0 success
  • 1 set led boost failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2357 of file driver_apds9960.c.

◆ apds9960_set_led_current()

uint8_t apds9960_set_led_current ( apds9960_handle_t * handle,
apds9960_led_current_t current )

set the led current

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]currentled current
Returns
status code
  • 0 success
  • 1 set led current failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2027 of file driver_apds9960.c.

◆ apds9960_set_proximity_down_left_offset()

uint8_t apds9960_set_proximity_down_left_offset ( apds9960_handle_t * handle,
int8_t offset )

set the proximity down left offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetproximity offset
Returns
status code
  • 0 success
  • 1 set proximity down left offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2667 of file driver_apds9960.c.

◆ apds9960_set_proximity_gain()

uint8_t apds9960_set_proximity_gain ( apds9960_handle_t * handle,
apds9960_proximity_gain_t gain )

set the proximity gain

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]gainproximity gain
Returns
status code
  • 0 success
  • 1 set proximity gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2109 of file driver_apds9960.c.

◆ apds9960_set_proximity_gain_compensation()

uint8_t apds9960_set_proximity_gain_compensation ( apds9960_handle_t * handle,
apds9960_bool_t enable )

enable or disable the proximity gain compensation

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set proximity gain compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2757 of file driver_apds9960.c.

◆ apds9960_set_proximity_interrupt_cycle()

uint8_t apds9960_set_proximity_interrupt_cycle ( apds9960_handle_t * handle,
apds9960_proximity_interrupt_cycle_t cycle )

set the proximity interrupt cycle

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]cycleproximity interrupt cycle
Returns
status code
  • 0 success
  • 1 set proximity interrupt cycle failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1610 of file driver_apds9960.c.

◆ apds9960_set_proximity_interrupt_high_threshold()

uint8_t apds9960_set_proximity_interrupt_high_threshold ( apds9960_handle_t * handle,
uint8_t threshold )

set the proximity interrupt high threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdhigh threshold
Returns
status code
  • 0 success
  • 1 set proximity interrupt high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1536 of file driver_apds9960.c.

◆ apds9960_set_proximity_interrupt_low_threshold()

uint8_t apds9960_set_proximity_interrupt_low_threshold ( apds9960_handle_t * handle,
uint8_t threshold )

set the proximity interrupt low threshold

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]thresholdlow threshold
Returns
status code
  • 0 success
  • 1 set proximity interrupt low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1462 of file driver_apds9960.c.

◆ apds9960_set_proximity_mask()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]maskproximity mask
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set proximity mask failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2922 of file driver_apds9960.c.

◆ apds9960_set_proximity_pulse_count()

uint8_t apds9960_set_proximity_pulse_count ( apds9960_handle_t * handle,
uint16_t count )

set the proximity pulse count

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]countproximity pulse count
Returns
status code
  • 0 success
  • 1 set proximity pulse count failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 count is over 63
Note
none

Definition at line 1939 of file driver_apds9960.c.

◆ apds9960_set_proximity_pulse_length()

uint8_t apds9960_set_proximity_pulse_length ( apds9960_handle_t * handle,
apds9960_proximity_pulse_length_t len )

set the proximity pulse length

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]lenproximity pulse length
Returns
status code
  • 0 success
  • 1 set proximity pulse length failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1856 of file driver_apds9960.c.

◆ apds9960_set_proximity_up_right_offset()

uint8_t apds9960_set_proximity_up_right_offset ( apds9960_handle_t * handle,
int8_t offset )

set the proximity up right offset

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]offsetproximity offset
Returns
status code
  • 0 success
  • 1 set proximity up right offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2577 of file driver_apds9960.c.

◆ apds9960_set_saturation_interrupt()

uint8_t apds9960_set_saturation_interrupt ( apds9960_handle_t * handle,
apds9960_saturation_interrupt_t saturation,
apds9960_bool_t enable )

set the saturation interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]saturationsaturation interrupt type
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set saturation interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2274 of file driver_apds9960.c.

◆ apds9960_set_sleep_after_interrupt()

uint8_t apds9960_set_sleep_after_interrupt ( apds9960_handle_t * handle,
apds9960_bool_t enable )

enable or disable sleeping after interrupt

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set sleep after interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2839 of file driver_apds9960.c.

◆ apds9960_set_wait_long()

uint8_t apds9960_set_wait_long ( apds9960_handle_t * handle,
apds9960_bool_t enable )

enable or disable the wait long

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set wait long failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1774 of file driver_apds9960.c.

◆ apds9960_set_wait_time()

uint8_t apds9960_set_wait_time ( apds9960_handle_t * handle,
uint8_t wait_time )

set the wait time

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]wait_timewait time
Returns
status code
  • 0 success
  • 1 set wait time failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1146 of file driver_apds9960.c.

◆ apds9960_wait_time_convert_to_data()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]regregister raw data
[out]*mspointer to a wait time buffer
Returns
status code
  • 0 success
  • 1 get configuration register 1 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1267 of file driver_apds9960.c.

◆ apds9960_wait_time_convert_to_register()

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

Parameters
[in]*handlepointer to an apds9960 handle structure
[in]mswait time
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 1 get configuration register 1 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1221 of file driver_apds9960.c.