binhonova  2.1.0.0
Main Page

Binho Nova Click

Binho Nova Click is an adapter Click boardâ„¢ that can be used as a multi-protocol adapter. This board features two female 1.27mm 2x5 connectors suitable for connecting the Binho Nova Multi-Protocol USB Host Adapter depending on the desired interface. This Click boardâ„¢ is designed for ultimate flexibility and provides the ability to use this adapter with different communication protocols, such as I2C, SPI, or UART. It features five signal pins, which can be used as Digital Input/Output, PWM Output, Digital Interrupt, or Analog Input/Output. Along with these connectors, it also features two power jumpers that can be used to supply the host from the Binho Nova.

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : May 2023.
  • Type : UART type

Software Support

We provide a library for the Binho Nova 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 Binho Nova Click driver.

Standard key functions :

Example key functions :

  • binhonova_generic_write This function writes a desired number of data bytes by using UART serial interface.
    err_t binhonova_generic_write ( binhonova_t *ctx, uint8_t *data_in, uint16_t len );
  • binhonova_generic_read This function reads a desired number of data bytes by using UART serial interface.
    err_t binhonova_generic_read ( binhonova_t *ctx, uint8_t *data_out, uint16_t len );

Example Description

This example demonstrates the use of Binho Nova Click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

void application_init ( void )
{
log_cfg_t log_cfg;
binhonova_cfg_t binhonova_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
binhonova_cfg_setup( &binhonova_cfg );
BINHONOVA_MAP_MIKROBUS( binhonova_cfg, MIKROBUS_1 );
if ( UART_ERROR == binhonova_init( &binhonova, &binhonova_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
Delay_ms ( 1000 );
uart_set_blocking( &logger.uart, false );
}

Application Task

All data received from the USB UART will be forwarded to mikroBUS UART, and vice versa.

void application_task ( void )
{
app_buf_len = uart_read( &logger.uart, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 )
{
uart_write ( &binhonova.uart, app_buf, app_buf_len );
memset( app_buf, 0, app_buf_len );
app_buf_len = 0;
}
app_buf_len = uart_read( &binhonova.uart, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 )
{
uart_write ( &logger.uart, app_buf, app_buf_len );
memset( app_buf, 0, app_buf_len );
app_buf_len = 0;
}
}

Note

The example code is performed via UART communication and consists of a few simple steps:

  1. Place "Binho Nova Click" into the mikroBUS socket 1.
  2. Insert the "Binho USB Host Adapter" connector into the "Binho Nova Click" I2C/UART slot.
  3. Start the "Mission Control Software" application.
  4. Connect "Binho USB Host Adapter".
  5. Activate UART Bridge with a baud rate of 115200bps.
  6. All data sent via the "Mission Control Software" application will be displayed on the USB UART logger, and vice versa.

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.BinhoNova

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.


application_task
void application_task(void)
Definition: main.c:76
BINHONOVA_MAP_MIKROBUS
#define BINHONOVA_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: binhonova.h:93
PROCESS_BUFFER_SIZE
#define PROCESS_BUFFER_SIZE
Definition: main.c:35
binhonova_cfg_t
Binho Nova Click configuration object.
Definition: binhonova.h:120
binhonova_generic_read
err_t binhonova_generic_read(binhonova_t *ctx, uint8_t *data_out, uint16_t len)
Binho Nova data reading function.
binhonova_t
Binho Nova Click context object.
Definition: binhonova.h:105
binhonova_cfg_setup
void binhonova_cfg_setup(binhonova_cfg_t *cfg)
Binho Nova configuration object setup function.
binhonova_init
err_t binhonova_init(binhonova_t *ctx, binhonova_cfg_t *cfg)
Binho Nova initialization function.
application_init
void application_init(void)
Definition: main.c:43
binhonova_generic_write
err_t binhonova_generic_write(binhonova_t *ctx, uint8_t *data_in, uint16_t len)
Binho Nova data writing function.