irda2 2.0.0.0
IrDA 2 Click Driver

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

Topics

 IrDA 2 Device Settings
 Settings for registers of IrDA 2 Click driver.
 
 IrDA 2 MikroBUS Map
 MikroBUS pin mapping of IrDA 2 Click driver.
 

Functions

void irda2_cfg_setup (irda2_cfg_t *cfg)
 IrDA 2 configuration object setup function.
 
err_t irda2_init (irda2_t *ctx, irda2_cfg_t *cfg)
 IrDA 2 initialization function.
 
void irda2_default_cfg (irda2_t *ctx)
 IrDA 2 default configuration function.
 
void irda2_mode_setup (irda2_t *ctx, irda2_mode_t state)
 Mode Setup function.
 
void irda2_pwr_setup (irda2_t *ctx, irda2_pwr_t state)
 Power Setup function.
 
void irda2_reset (irda2_t *ctx)
 Reset function.
 
err_t irda2_generic_write (irda2_t *ctx, uint8_t *data_in, uint16_t len)
 IrDA 2 data writing function.
 
err_t irda2_generic_read (irda2_t *ctx, uint8_t *data_out, uint16_t len)
 IrDA 2 data reading function.
 

Detailed Description

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

◆ irda2_cfg_setup()

void irda2_cfg_setup ( irda2_cfg_t * cfg)

IrDA 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ irda2_default_cfg()

void irda2_default_cfg ( irda2_t * ctx)

IrDA 2 default configuration function.

This function executes a default configuration of IrDA 2 click board.

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

◆ irda2_generic_read()

err_t irda2_generic_read ( irda2_t * ctx,
uint8_t * data_out,
uint16_t len )

IrDA 2 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See irda2_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ irda2_generic_write()

err_t irda2_generic_write ( irda2_t * ctx,
uint8_t * data_in,
uint16_t len )

IrDA 2 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See irda2_t object definition for detailed explanation.
[in]data_in: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ irda2_init()

err_t irda2_init ( irda2_t * ctx,
irda2_cfg_t * cfg )

IrDA 2 initialization function.

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

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

◆ irda2_mode_setup()

void irda2_mode_setup ( irda2_t * ctx,
irda2_mode_t state )

Mode Setup function.

This function allows IrDA 2 click mode to be set.

Parameters
ctxClick object.
state0 - Command mode, 1 - Data mode.
Returns
Nothing
Note
None.

◆ irda2_pwr_setup()

void irda2_pwr_setup ( irda2_t * ctx,
irda2_pwr_t state )

Power Setup function.

This function allows IrDA 2 click power mode to be set.

Parameters
ctxClick object.
state0 - Power off, 1 - Power on.
Returns
Nothing
Note
None.

◆ irda2_reset()

void irda2_reset ( irda2_t * ctx)

Reset function.

This function executes a device reset operation.

Parameters
ctxClick object.
Returns
Nothing
Note
After the reset operation was done, the device will be returned back to normal mode.