We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-06-26
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RS485
Downloaded: 2185 times
Not followed.
License: MIT license
FT Click is a compact smart transceiver add-on board that helps you add a Free Topology (FT) interface to any host board with the mikroBUS socket.
Do you want to subscribe in order to receive notifications regarding "FT click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "FT click" changes.
Do you want to report abuse regarding "FT click".
Library Description
The library contains functions to provide communication between 2 or more click boards.
Key functions:
void ft_send_package( uint8_t *data_buf, uint16_t len, uint8_t queue )
- Sends full package to other modulevoid ft_process ( uint8_t rsp_data )
- Collecting and preserving data received via uart interrupt routineuint16_t ft_get_data ( uint8_t *data_buf )
- Gets new received dataExamples description
The application is composed of three sections :
void application_task ( )
{
if ( app_mode == APP_MODE_RX )
{
if ( ft_get_data_status( ) == FT_NEW_DATA_AVAILABLE )
{
rsp_data_num = ft_get_data( &rsp_data_buf[ 0 ] );
if( rsp_data_num != 0 )
{
mikrobus_logWrite( "---------------------------", _LOG_LINE );
mikrobus_logWrite( "--> READ: ", _LOG_TEXT );
mikrobus_logWrite( rsp_data_buf, _LOG_LINE );
mikrobus_logWrite( "---------------------------", _LOG_LINE );
}
}
}
else
{
mikrobus_logWrite( "--------------------------", _LOG_LINE );
mikrobus_logWrite( "--> SEND MIKROE DATA <--", _LOG_LINE );
mikrobus_logWrite( "--------------------------", _LOG_LINE );
ft_send_package( &MIKROE_DATA_BUF[ 0 ], MIKROE_DATA_BUF_LEN, MIKROE_DATA_QUEUE );
Delay_ms( 1000 );
}
}
Note - Before the start program check uart interrupt routine in the Click_FT_other peripherals file.
Other mikroE Libraries used in the example:
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.