irgesture 2.0.0.0
irgesture.h File Reference

This file contains API for IR Gesture Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  irgesture_t
 Click ctx object definition. More...
 
struct  irgesture_cfg_t
 Click configuration structure definition. More...
 
struct  gesture_data_t
 Container for gesture data. More...
 

Macros

#define IRGESTURE_MAP_MIKROBUS(cfg, mikrobus)
 
#define IRGESTURE_RETVAL   uint8_t
 
#define IRGESTURE_OK   0x00
 
#define IRGESTURE_INIT_ERROR   0xFF
 
#define IRGESTURE_I2C_ADDR   0x39
 
#define IRGESTURE_ENABLE   0x80
 
#define IRGESTURE_ATIME   0x81
 
#define IRGESTURE_WTIME   0x83
 
#define IRGESTURE_AILTL   0x84
 
#define IRGESTURE_AILTH   0x85
 
#define IRGESTURE_AIHTL   0x86
 
#define IRGESTURE_AIHTH   0x87
 
#define IRGESTURE_PILT   0x89
 
#define IRGESTURE_PIHT   0x8B
 
#define IRGESTURE_PERS   0x8C
 
#define IRGESTURE_CONFIG1   0x8D
 
#define IRGESTURE_PPULSE   0x8E
 
#define IRGESTURE_CONTROL   0x8F
 
#define IRGESTURE_CONFIG2   0x90
 
#define IRGESTURE_ID   0x92
 
#define IRGESTURE_STATUS   0x93
 
#define IRGESTURE_CDATAL   0x94
 
#define IRGESTURE_CDATAH   0x95
 
#define IRGESTURE_RDATAL   0x96
 
#define IRGESTURE_RDATAH   0x97
 
#define IRGESTURE_GDATAL   0x98
 
#define IRGESTURE_GDATAH   0x99
 
#define IRGESTURE_BDATAL   0x9A
 
#define IRGESTURE_BDATAH   0x9B
 
#define IRGESTURE_PDATA   0x9C
 
#define IRGESTURE_POFFSET_UR   0x9D
 
#define IRGESTURE_POFFSET_DL   0x9E
 
#define IRGESTURE_CONFIG3   0x9F
 
#define IRGESTURE_GPENTH   0xA0
 
#define IRGESTURE_GEXTH   0xA1
 
#define IRGESTURE_GCONF1   0xA2
 
#define IRGESTURE_GCONF2   0xA3
 
#define IRGESTURE_GOFFSET_U   0xA4
 
#define IRGESTURE_GOFFSET_D   0xA5
 
#define IRGESTURE_GOFFSET_L   0xA7
 
#define IRGESTURE_GOFFSET_R   0xA9
 
#define IRGESTURE_GPULSE   0xA6
 
#define IRGESTURE_GCONF3   0xAA
 
#define IRGESTURE_GCONF4   0xAB
 
#define IRGESTURE_GFLVL   0xAE
 
#define IRGESTURE_GSTATUS   0xAF
 
#define IRGESTURE_IFORCE   0xE4
 
#define IRGESTURE_PICLEAR   0xE5
 
#define IRGESTURE_CICLEAR   0xE6
 
#define IRGESTURE_AICLEAR   0xE7
 
#define IRGESTURE_GFIFO_U   0xFC
 
#define IRGESTURE_GFIFO_D   0xFD
 
#define IRGESTURE_GFIFO_L   0xFE
 
#define IRGESTURE_GFIFO_R   0xFF
 
#define DEFAULT_ATIME   219
 
#define DEFAULT_WTIME   246
 
#define DEFAULT_PROX_PPULSE   0x87
 
#define DEFAULT_GESTURE_PPULSE   0x89
 
#define DEFAULT_POFFSET_UR   0
 
#define DEFAULT_POFFSET_DL   0
 
#define DEFAULT_CONFIG1   0x60
 
#define DEFAULT_LDRIVE   0
 
#define DEFAULT_PGAIN   2
 
#define DEFAULT_AGAIN   1
 
#define DEFAULT_PILT   0
 
#define DEFAULT_PIHT   50
 
#define DEFAULT_AILT   0xFFFF
 
#define DEFAULT_AIHT   0
 
#define DEFAULT_PERS   0x11
 
#define DEFAULT_CONFIG2   0x01
 
#define DEFAULT_CONFIG3   0
 
#define DEFAULT_GPENTH   40
 
#define DEFAULT_GEXTH   30
 
#define DEFAULT_GCONF1   0x40
 
#define DEFAULT_GGAIN   2
 
#define DEFAULT_GLDRIVE   0
 
#define DEFAULT_GWTIME   1
 
#define DEFAULT_GOFFSET   0
 
#define DEFAULT_GPULSE   0xC9
 
#define DEFAULT_GCONF3   0
 
#define DEFAULT_GIEN   0
 
#define IRGESTURE_PON   0b00000001
 
#define IRGESTURE_AEN   0b00000010
 
#define IRGESTURE_PEN   0b00000100
 
#define IRGESTURE_WEN   0b00001000
 
#define IRGESTURE_AIEN   0b00010000
 
#define IRGESTURE_PIEN   0b00100000
 
#define IRGESTURE_GEN   0b01000000
 
#define IRGESTURE_GVALID   0b00000001
 
#define IRGESTURE_FAR   0x00
 
#define IRGESTURE_RIGHT   0x01
 
#define IRGESTURE_LEFT   0x02
 
#define IRGESTURE_UP   0x03
 
#define IRGESTURE_DOWN   0x04
 
#define IRGESTURE_NEAR   0x05
 

Enumerations

enum  gesture_prox_t { NA_STATE , NEAR_STATE , FAR_STATE , ALL_STATE }
 
enum  gesture_dir_t {
  DIR_NONE , DIR_LEFT , DIR_RIGHT , DIR_UP ,
  DIR_DOWN , DIR_NEAR , DIR_FAR , DIR_ALL
}
 Direction definitions. More...
 

Functions

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

Detailed Description

This file contains API for IR Gesture Click driver.