canfd6  2.0.0.0
Macros | Functions
main.c File Reference

CANFD6 Click example. More...

#include "board.h"
#include "log.h"
#include "canfd6.h"

Macros

#define APP_RECEIVER
 
#define CANFD6_FIRST_MSG   0
 
#define CANFD6_SECOND_MSG   1
 

Functions

void application_init (void)
 
void application_task (void)
 
void main (void)
 

Detailed Description

CANFD6 Click example.

Description

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 :

Application Init

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.

Application Task

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.

Author
Stefan Nikolic

Macro Definition Documentation

◆ APP_RECEIVER

#define APP_RECEIVER

◆ CANFD6_FIRST_MSG

#define CANFD6_FIRST_MSG   0

◆ CANFD6_SECOND_MSG

#define CANFD6_SECOND_MSG   1

Function Documentation

◆ application_init()

void application_init ( void  )

< Logger config object.

< Click config object.

◆ application_task()

void application_task ( void  )

◆ main()

void main ( void  )