irgesture2 2.0.0.0
IR Gesture 2 Click Driver

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

Topics

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

Functions

void irgesture2_cfg_setup (irgesture2_cfg_t *cfg)
 IR Gesture 2 configuration object setup function.
 
err_t irgesture2_init (irgesture2_t *ctx, irgesture2_cfg_t *cfg)
 IR Gesture 2 initialization function.
 
err_t irgesture2_default_cfg (irgesture2_t *ctx)
 IR Gesture 2 default configuration function.
 
err_t irgesture2_generic_write (irgesture2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 IR Gesture 2 data writing function.
 
err_t irgesture2_generic_read (irgesture2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 IR Gesture 2 data reading function.
 
err_t irgesture2_write_register (irgesture2_t *ctx, uint8_t reg, uint8_t data_in)
 IR Gesture 2 write register function.
 
err_t irgesture2_read_register (irgesture2_t *ctx, uint8_t reg, uint8_t *data_out)
 IR Gesture 2 read register function.
 
err_t irgesture2_read_pixels (irgesture2_t *ctx, int16_t *pixels, bool flip_pixels)
 IR Gesture 2 read pixels function.
 
uint8_t irgesture2_get_int_pin (irgesture2_t *ctx)
 IR Gesture 2 get int pin function.
 

Detailed Description

API for configuring and manipulating IR Gesture 2 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

◆ irgesture2_cfg_setup()

void irgesture2_cfg_setup ( irgesture2_cfg_t * cfg)

IR Gesture 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ irgesture2_default_cfg()

err_t irgesture2_default_cfg ( irgesture2_t * ctx)

IR Gesture 2 default configuration function.

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

Parameters
[in]ctx: Click context object. See irgesture2_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.

◆ irgesture2_generic_read()

err_t irgesture2_generic_read ( irgesture2_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

IR Gesture 2 data reading function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See irgesture2_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture2_generic_write()

err_t irgesture2_generic_write ( irgesture2_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

IR Gesture 2 data writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See irgesture2_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture2_get_int_pin()

uint8_t irgesture2_get_int_pin ( irgesture2_t * ctx)

IR Gesture 2 get int pin function.

This function returns the INT pin logic state.

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

◆ irgesture2_init()

err_t irgesture2_init ( irgesture2_t * ctx,
irgesture2_cfg_t * cfg )

IR Gesture 2 initialization function.

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

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

◆ irgesture2_read_pixels()

err_t irgesture2_read_pixels ( irgesture2_t * ctx,
int16_t * pixels,
bool flip_pixels )

IR Gesture 2 read pixels function.

This function reads the raw ADC values of entire 60-pixel IR photodiode array.

Parameters
[in]ctx: Click context object. See irgesture2_t object definition for detailed explanation.
[out]pixels: Array of 60 int16_t elements where to store the pixels values.
[in]flip_pixels: Flip pixels, set to true if the click board is mounted upside-down.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irgesture2_read_register()

err_t irgesture2_read_register ( irgesture2_t * ctx,
uint8_t reg,
uint8_t * data_out )

IR Gesture 2 read register function.

This function reads a data byte from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See irgesture2_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.

◆ irgesture2_write_register()

err_t irgesture2_write_register ( irgesture2_t * ctx,
uint8_t reg,
uint8_t data_in )

IR Gesture 2 write register function.

This function writes a data byte to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See irgesture2_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.