irgesture  2.0.0.0
Functions

Functions

void irgesture_cfg_setup (irgesture_cfg_t *cfg)
 Config Object Initialization function. More...
 
IRGESTURE_RETVAL irgesture_init (irgesture_t *ctx, irgesture_cfg_t *cfg)
 Initialization function. More...
 
void irgesture_default_cfg (irgesture_t *ctx)
 Click Default Configuration function. More...
 
void irgesture_write_data (irgesture_t *ctx, uint8_t reg_addr, uint8_t write_data)
 Write function. More...
 
uint8_t irgesture_read_data (irgesture_t *ctx, uint8_t reg_addr)
 Read function. More...
 
uint8_t irgesture_get_interrupt (irgesture_t *ctx)
 Get state of interrupt pin function. More...
 
gesture_dir_t irgesture_gesture_read_gesture (irgesture_t *ctx)
 Processes a gesture event function. More...
 
void irgesture_set_gesture_mode (irgesture_t *ctx)
 Sets the gesture mode function. More...
 
void irgesture_enable_power (irgesture_t *ctx)
 Enable power sensor function. More...
 
void irgesture_disable_power (irgesture_t *ctx)
 Disable power sensor function. More...
 
void irgesture_set_ambient_light_gain (irgesture_t *ctx, uint8_t gain_val)
 Set gain for ambient light function. More...
 
uint8_t irgesture_get_ambient_light_gain (irgesture_t *ctx)
 Get gain for ambient light function. More...
 
void irgesture_enable_light_sensor (irgesture_t *ctx)
 Enable specific ambient light sensors function. More...
 
void irgesture_disable_light_sensor (irgesture_t *ctx)
 Disable specific ambient light sensors function. More...
 
uint16_t irgesture_read_ambient_light (irgesture_t *ctx)
 Read ambient light data function. More...
 
uint16_t irgesture_read_red_light (irgesture_t *ctx)
 Read RED light data function. More...
 
uint16_t irgesture_read_green_light (irgesture_t *ctx)
 Read GREEN light data function. More...
 
uint16_t irgesture_read_blue_light (irgesture_t *ctx)
 Read BLUE light data function. More...
 
void irgesture_set_led_boost (irgesture_t *ctx, uint8_t boost)
 Sets the LED current boost value function. More...
 
uint8_t irgesture_get_led_boost (irgesture_t *ctx)
 Gets the LED current boost value function. More...
 
uint8_t irgesture_available (irgesture_t *ctx)
 Determines if there is a gesture available function. More...
 
void irgesture_set_gesture_gain (irgesture_t *ctx, uint8_t gain_val)
 Set gain for gesture function. More...
 
uint8_t irgesture_get_gesture_gain (irgesture_t *ctx)
 Get gain for gesture function. More...
 
void irgesture_enable_gesture_sensor (irgesture_t *ctx)
 Starts the gesture recognition engine function. More...
 
void irgesture_disable_gesture_sensor (irgesture_t *ctx)
 Disable the gesture recognition engine function. More...
 
uint8_t irgesture_detect_gesture (irgesture_t *ctx)
 Function decode a gesture event function. More...
 
void irgesture_set_proximity_gain (irgesture_t *ctx, uint8_t gain_val)
 Set gain for proximity function. More...
 
uint8_t irgesture_get_proximity_gain (irgesture_t *ctx)
 Get gain for proximity function. More...
 
void irgesture_enable_proximity_sensor (irgesture_t *ctx)
 Enable specific proximity sensors function. More...
 
void irgesture_disable_proximity_sensor (irgesture_t *ctx)
 Disable specific proximity sensors function. More...
 
uint8_t irgesture_get_proxy_photo_mask (irgesture_t *ctx)
 Get the current mask for enabled/disabled proximity photodiodes function. More...
 
void irgesture_set_proxy_photo_mask (irgesture_t *ctx, uint8_t mask)
 Get the current mask for enabled/disabled proximity photodiodes function. More...
 
uint8_t irgesture_read_proximity_data (irgesture_t *ctx)
 Read proximity data function. More...
 

Detailed Description

Function Documentation

◆ irgesture_available()

uint8_t irgesture_available ( irgesture_t ctx)

Determines if there is a gesture available function.

Parameters
ctxClick object.
Returns
1 if TRUE; 0 if FALSE;

@description Function determines if there is a gesture available for reading from target 8-bit register address of APDS-9960 IC sensor on IR Gesture Click.

◆ irgesture_cfg_setup()

void irgesture_cfg_setup ( irgesture_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes Click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ irgesture_default_cfg()

void irgesture_default_cfg ( irgesture_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for IrGesture Click.

◆ irgesture_detect_gesture()

uint8_t irgesture_detect_gesture ( irgesture_t ctx)

Function decode a gesture event function.

Parameters
ctxClick object.
Returns
8-bit position of decode gesture

@description Function processes a gesture event and returns best guessed position engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_disable_gesture_sensor()

void irgesture_disable_gesture_sensor ( irgesture_t ctx)

Disable the gesture recognition engine function.

Parameters
ctxClick object.

@description Function disable the gesture recognition engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_disable_light_sensor()

void irgesture_disable_light_sensor ( irgesture_t ctx)

Disable specific ambient light sensors function.

Parameters
ctxClick object.

@description Function disable specific ambient light sensors on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_disable_power()

void irgesture_disable_power ( irgesture_t ctx)

Disable power sensor function.

Parameters
ctxClick object.

@description Function disable power sensor engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_disable_proximity_sensor()

void irgesture_disable_proximity_sensor ( irgesture_t ctx)

Disable specific proximity sensors function.

Parameters
ctxClick object.

@description Function disable specific proximity sensors and set default gain on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_enable_gesture_sensor()

void irgesture_enable_gesture_sensor ( irgesture_t ctx)

Starts the gesture recognition engine function.

Parameters
ctxClick object.

@description Function starts the gesture recognition engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_enable_light_sensor()

void irgesture_enable_light_sensor ( irgesture_t ctx)

Enable specific ambient light sensors function.

Parameters
ctxClick object.

@description Function enable specific ambient light sensors and set default gain on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_enable_power()

void irgesture_enable_power ( irgesture_t ctx)

Enable power sensor function.

Parameters
ctxClick object.

@description Function enable power sensor engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_enable_proximity_sensor()

void irgesture_enable_proximity_sensor ( irgesture_t ctx)

Enable specific proximity sensors function.

Parameters
ctxClick object.

@description Function enable specific proximity sensors and set default gain on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_gesture_read_gesture()

gesture_dir_t irgesture_gesture_read_gesture ( irgesture_t ctx)

Processes a gesture event function.

Parameters
ctxClick object.
Returns
gesture_dir_t
  • Number corresponding to gesture.
  • or -1 on error. *

@description Function processes a gesture event and returns best guessed gesture engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_get_ambient_light_gain()

uint8_t irgesture_get_ambient_light_gain ( irgesture_t ctx)

Get gain for ambient light function.

Parameters
ctxClick object.
Returns
8-bit gain data

@description Function get gain for ambient light from the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_get_gesture_gain()

uint8_t irgesture_get_gesture_gain ( irgesture_t ctx)

Get gain for gesture function.

Parameters
ctxClick object.
Returns
8-bit gain data

@description Function get gain for gesture from the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_get_interrupt()

uint8_t irgesture_get_interrupt ( irgesture_t ctx)

Get state of interrupt pin function.

Parameters
ctxClick object.
Returns
state of INT pin ( 0 - not active; 1 - active;)

@description Function get state of interrupt ( INT ) pin.

◆ irgesture_get_led_boost()

uint8_t irgesture_get_led_boost ( irgesture_t ctx)

Gets the LED current boost value function.

Parameters
ctxClick object.
Returns
boost value (0-3)
  • 0 : 100%;
  • 1 : 150%;
  • 2 : 200%;
  • 3 : 300%; @description Function get the LED current boost value to the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_get_proximity_gain()

uint8_t irgesture_get_proximity_gain ( irgesture_t ctx)

Get gain for proximity function.

Parameters
ctxClick object.
Returns
8-bit gain proximity data

@description Function get gain for proximity from the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_get_proxy_photo_mask()

uint8_t irgesture_get_proxy_photo_mask ( irgesture_t ctx)

Get the current mask for enabled/disabled proximity photodiodes function.

Parameters
ctxClick object.
Returns
8-bit photo mask data
  • 1 : disabled;
  • 0 : enabled;
  • Bit 3 : UP;
  • Bit 2 : DOWN;
  • Bit 1 : LEFT;
  • Bit 0 : RIGHT;

@description Function get the current mask for enabled/disabled proximity photodiodes to the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_init()

IRGESTURE_RETVAL irgesture_init ( irgesture_t ctx,
irgesture_cfg_t cfg 
)

Initialization function.

Parameters
irgestureClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this Click.

◆ irgesture_read_ambient_light()

uint16_t irgesture_read_ambient_light ( irgesture_t ctx)

Read ambient light data function.

Parameters
ctxClick object.
Returns
16-bit read ambient light data

@description Function read ambient light data from the two target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_read_blue_light()

uint16_t irgesture_read_blue_light ( irgesture_t ctx)

Read BLUE light data function.

Parameters
ctxClick object.
Returns
16-bit read BLUE light data

@description Function read blue light data from the two target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_read_data()

uint8_t irgesture_read_data ( irgesture_t ctx,
uint8_t  reg_addr 
)

Read function.

Parameters
ctxClick object.
reg_addrRegister address.
Returns
8-bit read data

@description This function readsthe 8-bit of data from the target 8-bit register address.

◆ irgesture_read_green_light()

uint16_t irgesture_read_green_light ( irgesture_t ctx)

Read GREEN light data function.

Parameters
ctxClick object.
Returns
16-bit read GREEN light data

@description Function read green light data from the two target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_read_proximity_data()

uint8_t irgesture_read_proximity_data ( irgesture_t ctx)

Read proximity data function.

Parameters
ctxClick object.
Returns
8-bit read proximity data

@description Function read proximity data from the two target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_read_red_light()

uint16_t irgesture_read_red_light ( irgesture_t ctx)

Read RED light data function.

Parameters
ctxClick object.
Returns
16-bit read RED light data

@description Function read red light data from the two target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_ambient_light_gain()

void irgesture_set_ambient_light_gain ( irgesture_t ctx,
uint8_t  gain_val 
)

Set gain for ambient light function.

Parameters
ctxClick object.
gain_val8-bit gain data

@description Function set gain for ambient light on the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_gesture_gain()

void irgesture_set_gesture_gain ( irgesture_t ctx,
uint8_t  gain_val 
)

Set gain for gesture function.

Parameters
ctxClick object.
gain_val8-bit gain data

@description Function set gain for gesture on the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_gesture_mode()

void irgesture_set_gesture_mode ( irgesture_t ctx)

Sets the gesture mode function.

Parameters
ctxClick object.

@description Function set the gesture mode engine on the APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_led_boost()

void irgesture_set_led_boost ( irgesture_t ctx,
uint8_t  boost 
)

Sets the LED current boost value function.

Parameters
ctxClick object.
boost
Boost value (0-3)
  • 0 : 100%;
  • 1 : 150%;
  • 2 : 200%;
  • 3 : 300%;

@description Function set the LED current boost value to the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_proximity_gain()

void irgesture_set_proximity_gain ( irgesture_t ctx,
uint8_t  gain_val 
)

Set gain for proximity function.

Parameters
ctxClick object.
gain_val8-bit gain proximity data

@description Function set gain for proximity on the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_set_proxy_photo_mask()

void irgesture_set_proxy_photo_mask ( irgesture_t ctx,
uint8_t  mask 
)

Get the current mask for enabled/disabled proximity photodiodes function.

Parameters
ctxClick object.
mask
  • 1 : disabled;
  • 0 : enabled;
  • Bit 3 : UP;
  • Bit 2 : DOWN;
  • Bit 1 : LEFT;
  • Bit 0 : RIGHT; *

@description Function get the current mask for enabled/disabled proximity photodiodes to the target register address of APDS-9960 IC on IR Gesture Click.

◆ irgesture_write_data()

void irgesture_write_data ( irgesture_t ctx,
uint8_t  reg_addr,
uint8_t  write_data 
)

Write function.

Parameters
ctxClick object.
reg_addrRegister address.
write_dataByte of data to be written.

@description This function writes the 8-bit of data to the desired register.