ir2 2.0.0.0
IR 2 Click Driver

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

Topics

 IR 2 Device Settings
 Settings for configuration of IR 2 Click driver.
 
 IR 2 MikroBUS Map
 MikroBUS pin mapping of IR 2 Click driver.
 

Functions

void ir2_cfg_setup (ir2_cfg_t *cfg)
 IR 2 configuration object setup function.
 
void ir2_drv_interface_selection (ir2_cfg_t *cfg, ir2_drv_t drv_sel)
 IR 2 driver interface setup function.
 
err_t ir2_init (ir2_t *ctx, ir2_cfg_t *cfg)
 IR 2 initialization function.
 
uint8_t ir2_get_out_pin (ir2_t *ctx)
 IR 2 get OUT pin function.
 
void ir2_nec_send_data (ir2_t *ctx, uint8_t address, uint8_t data_in)
 IR 2 NEC send data function.
 
err_t ir2_nec_read_data (ir2_t *ctx, uint8_t *address, uint8_t *data_out)
 IR 2 NEC read data function.
 

Detailed Description

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

◆ ir2_cfg_setup()

void ir2_cfg_setup ( ir2_cfg_t * cfg)

IR 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ ir2_drv_interface_selection()

void ir2_drv_interface_selection ( ir2_cfg_t * cfg,
ir2_drv_t drv_sel )

IR 2 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See ir2_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See ir2_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ ir2_get_out_pin()

uint8_t ir2_get_out_pin ( ir2_t * ctx)

IR 2 get OUT pin function.

This function returns the OUT pin logic state.

Parameters
[in]ctx: Click context object. See ir2_t object definition for detailed explanation.
Returns
State of the OUT pin.
Note
None.

◆ ir2_init()

err_t ir2_init ( ir2_t * ctx,
ir2_cfg_t * cfg )

IR 2 initialization function.

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

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

◆ ir2_nec_read_data()

err_t ir2_nec_read_data ( ir2_t * ctx,
uint8_t * address,
uint8_t * data_out )

IR 2 NEC read data function.

This function reads an address and data bytes by using NEC protocol.

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

◆ ir2_nec_send_data()

void ir2_nec_send_data ( ir2_t * ctx,
uint8_t address,
uint8_t data_in )

IR 2 NEC send data function.

This function sends an address and data bytes using NEC protocol.

Parameters
[in]ctx: Click context object. See ir2_t object definition for detailed explanation.
[in]address: Input address data.
[in]data_in: Input data byte.
Returns
Nothing.
Note
None.