irgesture3 2.1.0.0
IR Gesture 3 Click Driver

API for configuring and manipulating IR Gesture 3 Click driver. More...

Topics

 IR Gesture 3 Registers List
 List of registers of IR Gesture 3 Click driver.
 
 IR Gesture 3 Registers Settings
 Settings for registers of IR Gesture 3 Click driver.
 
 IR Gesture 3 MikroBUS Map
 MikroBUS pin mapping of IR Gesture 3 Click driver.
 

Functions

void irgesture3_cfg_setup (irgesture3_cfg_t *cfg)
 IR Gesture 3 configuration object setup function.
 
err_t irgesture3_init (irgesture3_t *ctx, irgesture3_cfg_t *cfg)
 IR Gesture 3 initialization function.
 
err_t irgesture3_default_cfg (irgesture3_t *ctx)
 IR Gesture 3 default configuration function.
 
err_t irgesture3_write_register (irgesture3_t *ctx, uint8_t reg, uint16_t data_in)
 IR Gesture 3 write register function.
 
err_t irgesture3_read_register (irgesture3_t *ctx, uint8_t reg, uint16_t *data_out)
 IR Gesture 3 read register function.
 
err_t irgesture3_check_communication (irgesture3_t *ctx)
 IR Gesture 3 check communication function.
 
uint8_t irgesture3_get_io0_pin (irgesture3_t *ctx)
 IR Gesture 3 get io0 function.
 
uint8_t irgesture3_get_io1_pin (irgesture3_t *ctx)
 IR Gesture 3 get io1 function.
 
err_t irgesture3_sw_reset (irgesture3_t *ctx)
 IR Gesture 3 sw reset function.
 
err_t irgesture3_set_mode (irgesture3_t *ctx, uint8_t mode)
 IR Gesture 3 set mode function.
 
err_t irgesture3_set_adc_fsample (irgesture3_t *ctx, uint16_t freq_hz)
 IR Gesture 3 set adc fsample function.
 
err_t irgesture3_clear_status (irgesture3_t *ctx)
 IR Gesture 3 clear status function.
 
err_t irgesture3_wait_data_ready (irgesture3_t *ctx)
 IR Gesture 3 wait data ready function.
 
err_t irgesture3_get_pd_data (irgesture3_t *ctx, irgesture3_pd_data_t *pd_data)
 IR Gesture 3 get pd data function.
 
err_t irgesture3_get_gesture (irgesture3_t *ctx, uint8_t *gesture)
 IR Gesture 3 get gesture function.
 

Detailed Description

API for configuring and manipulating IR Gesture 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ irgesture3_cfg_setup()

void irgesture3_cfg_setup ( irgesture3_cfg_t * cfg)

IR Gesture 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See irgesture3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ irgesture3_check_communication()

err_t irgesture3_check_communication ( irgesture3_t * ctx)

IR Gesture 3 check communication function.

This function checks the communication by reading and verifying the device ID.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_clear_status()

err_t irgesture3_clear_status ( irgesture3_t * ctx)

IR Gesture 3 clear status function.

This function clears the STATUS register.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_default_cfg()

err_t irgesture3_default_cfg ( irgesture3_t * ctx)

IR Gesture 3 default configuration function.

This function executes a default configuration of IR Gesture 3 click board.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ irgesture3_get_gesture()

err_t irgesture3_get_gesture ( irgesture3_t * ctx,
uint8_t * gesture )

IR Gesture 3 get gesture function.

This function waits up to IRGESTURE3_MAX_NUM_SAMPLES for an object to be detected and then calculates its gesture.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[out]gesture: Calculated gesture of the detected object.
  • 0 - Click,
  • 1 - Swipe up,
  • 2 - Swipe down,
  • 3 - Swipe left,
  • 4 - Swipe right.
Returns
  • 0 - Success,
  • -1 - Error or no gesture detected. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_get_io0_pin()

uint8_t irgesture3_get_io0_pin ( irgesture3_t * ctx)

IR Gesture 3 get io0 function.

This function returns the GPIO0 pin logic state.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ irgesture3_get_io1_pin()

uint8_t irgesture3_get_io1_pin ( irgesture3_t * ctx)

IR Gesture 3 get io1 function.

This function returns the GPIO1 pin logic state.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ irgesture3_get_pd_data()

err_t irgesture3_get_pd_data ( irgesture3_t * ctx,
irgesture3_pd_data_t * pd_data )

IR Gesture 3 get pd data function.

This function waits for the data ready interrupt and then reads data from photodiodes XR, XL, YB, and YT that are connected to channels PD1 to PD4.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[out]pd_data: Photodiodes data. See irgesture3_pd_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_init()

err_t irgesture3_init ( irgesture3_t * ctx,
irgesture3_cfg_t * cfg )

IR Gesture 3 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See irgesture3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_read_register()

err_t irgesture3_read_register ( irgesture3_t * ctx,
uint8_t reg,
uint16_t * data_out )

IR Gesture 3 read register function.

This function reads data word from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_set_adc_fsample()

err_t irgesture3_set_adc_fsample ( irgesture3_t * ctx,
uint16_t freq_hz )

IR Gesture 3 set adc fsample function.

This function sets the sample frequency of the device.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[in]freq_hz: Sample frequency in Hz (up to 2000 Hz).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_set_mode()

err_t irgesture3_set_mode ( irgesture3_t * ctx,
uint8_t mode )

IR Gesture 3 set mode function.

This function sets the device operating mode.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[in]mode:
  • 0 - Standby,
  • 1 - Program,
  • 2 - Normal.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_sw_reset()

err_t irgesture3_sw_reset ( irgesture3_t * ctx)

IR Gesture 3 sw reset function.

This function executes software reset of the device.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_wait_data_ready()

err_t irgesture3_wait_data_ready ( irgesture3_t * ctx)

IR Gesture 3 wait data ready function.

This function waits for the data ready interrupt up to IRGESTURE3_TIMEOUT_MS milliseconds and then clears the STATUS registers.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture3_write_register()

err_t irgesture3_write_register ( irgesture3_t * ctx,
uint8_t reg,
uint16_t data_in )

IR Gesture 3 write register function.

This function writes data word to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See irgesture3_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.