irda3  2.0.0.0
Main Page

IrDA 3 click

IrDA 3 click is an intelligent IR transceiver device that can both send and receive UART commands via the IR interface. IrDA 3 click features both the IR transceiver and the encoder/decoder IC, used to convert the UART data and send or receive it in IrDA® compatible format. IrDA 3 click also has an onboard clock generator for the fastest possible UART performance of 115,200 bps, so it does not need an additional clock signal to be generated by the MCU.

click Product page


Click library

  • Author : Jelena Milosavljevic
  • Date : Jun 2021.
  • Type : UART type

Software Support

We provide a library for the IrDA3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for IrDA3 Click driver.

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of IrDA 3 click boards. The example can perform both roles, transmitter and receiver.

The demo application is composed of two sections :

Application Init

Initializes UART driver and all used control pins. Also clears the response buffer.

void application_init( void ) {
irda3_cfg_t irda3_cfg;
log_cfg_t logger_cfg;
LOG_MAP_USB_UART( logger_cfg );
log_init( &logger, &logger_cfg );
log_printf( &logger, "*** IrDA initialization done ***\r\n" );
log_printf( &logger, "**********************************\r\n" );
// Click initialization.
irda3_cfg_setup( &irda3_cfg );
IRDA3_MAP_MIKROBUS( irda3_cfg, MIKROBUS_1 );
irda3_init( &irda3, &irda3_cfg );
irda3_default_cfg( &irda3 );
irda3_reset( &irda3 );
// Clear response.
memset( rx_message, 0, sizeof( rx_message ) );
}

Application Task

Demonstrates the use of IrDA 3 clicks which can be used as transmitter or receiver. There are four different examples in this project.

Uncomment one of the below macros to select which example will be executed. By default the DEMO_APP_TRANSMITTER_1 example is selected.

void application_task( void ) {
#ifdef DEMO_APP_RECEIVER_1
rx_message[ 0 ] = irda3_generic_single_receive( &irda3 );
if ( rx_message[ 0 ] != 0 ) {
log_printf( &logger, "%c", ( char ) rx_message[ 0 ] );
}
Delay_ms( 100 );
#endif
#ifdef DEMO_APP_RECEIVER_2
irda3_generic_multiple_receive( &irda3, rx_message, '\n' );
log_printf( &logger, "RECEIVED MESSAGE : " );
log_printf( &logger, "%s\r\n", rx_message );
Delay_ms( 100 );
#endif
#ifdef DEMO_APP_TRANSMITTER_1
irda3_generic_multiple_send( &irda3, tx_message );
log_printf( &logger, "MESSAGE SENT\r\n" );
Delay_ms( 2000 );
#endif
#ifdef DEMO_APP_TRANSMITTER_2
idx = 0;
while ( tx_message[ idx ] != '\0' ) {
irda3_generic_single_send( &irda3, tx_message[ idx++ ] );
}
log_printf( &logger, "MESSAGE SENT\r\n" );
Delay_ms( 2000 );
#endif
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.IrDA3

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.


irda3_pwr_setup
void irda3_pwr_setup(irda3_t *ctx, irda3_pwr_t state)
Power Setup function.
irda3_generic_multiple_receive
void irda3_generic_multiple_receive(irda3_t *ctx, char *rx_data, char termination_char)
Generic Multiple Receive function.
irda3_pwr_t
irda3_pwr_t
Click power mode settings.
Definition: irda3.h:173
irda3_generic_single_send
void irda3_generic_single_send(irda3_t *ctx, char tx_data)
Generic Single Send function.
irda3_generic_single_receive
char irda3_generic_single_receive(irda3_t *ctx)
Generic Single Receive function.
application_task
void application_task(void)
Definition: main.c:78
irda3_mode_setup
void irda3_mode_setup(irda3_t *ctx, irda3_mode_t state)
Mode Setup function.
irda3_reset
void irda3_reset(irda3_t *ctx)
Reset function.
irda3_mode_t
irda3_mode_t
Click mode settings.
Definition: irda3.h:163
irda3_cfg_setup
void irda3_cfg_setup(irda3_cfg_t *cfg)
IrDA 3 configuration object setup function.
application_init
void application_init(void)
Definition: main.c:47
irda3_init
err_t irda3_init(irda3_t *ctx, irda3_cfg_t *cfg)
IrDA 3 initialization function.
irda3_default_cfg
void irda3_default_cfg(irda3_t *ctx)
IrDA 3 default configuration function.
irda3_cfg_t
IrDA 3 Click configuration object.
Definition: irda3.h:126
irda3_generic_multiple_send
void irda3_generic_multiple_send(irda3_t *ctx, char *tx_data)
Generic Multiple Send function.
irda3_t
IrDA 3 Click context object.
Definition: irda3.h:103
IRDA3_MAP_MIKROBUS
#define IRDA3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: irda3.h:88