canfd6
2.0.0.0
|
<PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU>
[click Product page](<CLICK_PRODUCT_PAGE_LINK>)
We provide a library for the CANFD6 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.
This library contains API for CANFD6 Click driver.
canfd6_cfg_setup
Config Object Initialization function. canfd6_init
Initialization function. canfd6_default_cfg
Click Default Configuration function. canfd6_mcan_write_txbuffer
This function will write a CAN message to a specified TX buffer that can be transmitted at a later time with the transmit buffer contents function. canfd6_mcan_transmit_buffer_contents
This function writes the specified buffer index bit value into the TXBAR register to request a message to send. canfd6_mcan_read_nextfifo
This function will read the next MCAN FIFO element specified and return the corresponding header information and data payload. This application presents the capabilities of the CAN FD 6 click board. The board can be used both as a receiver and a transmitter. Use def directive to define the receive or transmit app.
The demo application is composed of two sections :
The app starts by initializing the UART LOG and SPI drivers. The default cfg function performs the mandatory settings of the device. The user's default configuration can be modified ( for more information about device configuration, check the datasheet ). Additionally, the app writes two messages to the FIFO buffer and sends them if the transmit buffer content event is triggered.
Depending on the defined app option, the application task performs the following procedure. If the transmitter is preferred, the application task triggers the transmit buffer contents event of the first message and, later on, the second message. On the other hand, the receiver waits for the CAN FD interrupt, where the payload is read along with the header ID.
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:
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.