barcode  2.0.0.0
Main Page

Barcode click

Barcode Click is a very fast and agile barcode scanner on a click boardâ„¢, which is compliant with a wide range of different 1D and 2D barcode protocols.

click Product page


Click library

  • Author : MikroE Team
  • Date : Mar 2020.
  • Type : UART GPS/GNSS type

Software Support

We provide a library for the Barcode 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Barcode Click driver.

Standard key functions :

  • Config Object Initialization function.

    void barcode_cfg_setup ( barcode_cfg_t *cfg );

  • Initialization function.

    BARCODE_RETVAL barcode_init ( barcode_t *ctx, barcode_cfg_t *cfg );

Example key functions :

  • Set PWM pin state.

    void barcode_enable_scaning ( barcode_t *ctx, uint8_t state );

  • Generic read function.

    uint16_t barcode_generic_read ( barcode_t *ctx, char *data_buf, uint16_t max_len );

Examples Description

This example reads and processes data from Barcode clicks.

The demo application is composed of two sections :

Application Init

Initializes driver.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---> BarCode Click Init <---" );
// Click initialization.
BARCODE_MAP_MIKROBUS( cfg, MIKROBUS_1 );
barcode_init( &barcode, &cfg );
Delay_ms ( 500 );
}

Application Task

Reads the received data.

void application_task ( void )
{
barcode_process( );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Barcode

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


BARCODE_LOGIC_ON
#define BARCODE_LOGIC_ON
Definition: barcode.h:86
barcode_cfg_setup
void barcode_cfg_setup(barcode_cfg_t *cfg)
Config Object Initialization function.
application_task
void application_task(void)
Definition: main.c:108
BARCODE_MAP_MIKROBUS
#define BARCODE_MAP_MIKROBUS(cfg, mikrobus)
Definition: barcode.h:65
BARCODE_LOGIC_OFF
#define BARCODE_LOGIC_OFF
Definition: barcode.h:87
barcode_cfg_t
Click configuration structure definition.
Definition: barcode.h:119
barcode_init
BARCODE_RETVAL barcode_init(barcode_t *ctx, barcode_cfg_t *cfg)
Initialization function.
barcode_enable_scaning
void barcode_enable_scaning(barcode_t *ctx, uint8_t state)
Set WKP ( wake-up ) pin state.
application_init
void application_init(void)
Definition: main.c:81