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-04-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: CAN
Downloaded: 2833 times
Not followed.
License: MIT license
CAN FD 2 Click is a Click boardâ„¢ based on TLE9252V CAN network transceiver, it drives the signals to the bus and protects the microcontroller from interference generated within the network.
Do you want to subscribe in order to receive notifications regarding "CAN FD 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "CAN FD 2 click" changes.
Do you want to report abuse regarding "CAN FD 2 click".
Library Description
The library covers all the necessary functions to control CAN FD 2 Click board. Library performs a standard UART communication.
Key functions:
void canfd2_set_mode ( uint8_t op_mode )
- Set operating mode function.void canfd2_read_block ( uint8_t *read_data, uint16_t length )
- Read block function.void canfd2_write_block ( uint8_t *write_data, uint16_t length )
- Write block function.Examples description
The application is composed of three sections :
void application_task ( )
{
if ( app_mode == APP_MODE_RECEIVER )
{
// RECEIVER - UART polling
char rd_msg[ 10 ] = { 0 };
canfd2_read_block( &rd_msg[ 0 ], 8 );
mikrobus_logWrite( rd_msg, _LOG_TEXT );
}
else
{
// TRANSMITER - TX each 3 sec
canfd2_write_block( &demo_message_data[ 0 ], 8 );
Delay_ms( 3000 );
}
}
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.