Microchip® Advanced Software Framework

qs_can_fd.c File Reference

SAM CAN Quick Start for FD modue.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <string.h>
#include <conf_can.h>

Macros

#define CAN_RX_EXTENDED_FILTER_ID_0   0x100000A5
 
#define CAN_RX_EXTENDED_FILTER_ID_0_BUFFER_INDEX   1
 
#define CAN_RX_EXTENDED_FILTER_ID_1   0x10000096
 
#define CAN_RX_EXTENDED_FILTER_INDEX_0   0
 
#define CAN_RX_EXTENDED_FILTER_INDEX_1   1
 
#define CAN_RX_STANDARD_FILTER_ID_0   0x45A
 
#define CAN_RX_STANDARD_FILTER_ID_0_BUFFER_INDEX   2
 
#define CAN_RX_STANDARD_FILTER_ID_1   0x469
 
#define CAN_RX_STANDARD_FILTER_INDEX_0   0
 [module_inst] More...
 
#define CAN_RX_STANDARD_FILTER_INDEX_1   1
 
#define CAN_TX_BUFFER_INDEX   0
 [can_filter_setting] More...
 

Functions

void CAN0_Handler (void)
 [can_transfer_message_setup] More...
 
static void can_fd_send_extended_message (uint32_t id_value, uint8_t *data)
 
static void can_fd_send_standard_message (uint32_t id_value, uint8_t *data)
 
static void can_send_standard_message (uint32_t id_value, uint8_t *data)
 [can_receive_filter_setup] More...
 
static void can_set_extended_filter_0 (void)
 
static void can_set_extended_filter_1 (void)
 
static void can_set_standard_filter_0 (void)
 [can_init_setup] More...
 
static void can_set_standard_filter_1 (void)
 
static void configure_can (void)
 [cdc_setup] More...
 
static void configure_usart_cdc (void)
 [can_receive_message_setting] More...
 
static void display_menu (void)
 [can_interrupt_handler] More...
 
int main (void)
 [user_menu] More...
 

Variables

static struct can_module can_instance
 
static struct usart_module cdc_instance
 [module_var] More...
 
static volatile uint32_t extended_receive_index = 0
 
static struct can_rx_element_buffer rx_element_buffer
 
static struct can_rx_element_fifo_0 rx_element_fifo_0
 
static struct can_rx_element_fifo_1 rx_element_fifo_1
 
static volatile uint32_t standard_receive_index = 0
 [can_transfer_message_setting] More...
 
static uint8_t tx_message_0 [CONF_CAN_ELEMENT_DATA_SIZE]
 
static uint8_t tx_message_1 [CONF_CAN_ELEMENT_DATA_SIZE]
 

#define CAN_RX_EXTENDED_FILTER_ID_0   0x100000A5

Referenced by can_set_extended_filter_0(), and main().

#define CAN_RX_EXTENDED_FILTER_ID_0_BUFFER_INDEX   1
#define CAN_RX_EXTENDED_FILTER_ID_1   0x10000096

Referenced by can_set_extended_filter_1(), and main().

#define CAN_RX_EXTENDED_FILTER_INDEX_0   0
#define CAN_RX_EXTENDED_FILTER_INDEX_1   1
#define CAN_RX_STANDARD_FILTER_ID_0   0x45A

Referenced by can_set_standard_filter_0(), and main().

#define CAN_RX_STANDARD_FILTER_ID_0_BUFFER_INDEX   2
#define CAN_RX_STANDARD_FILTER_ID_1   0x469

Referenced by can_set_standard_filter_1(), and main().

#define CAN_RX_STANDARD_FILTER_INDEX_0   0

[module_inst]

[can_filter_setting]

Referenced by can_set_standard_filter_0().

#define CAN_RX_STANDARD_FILTER_INDEX_1   1
#define CAN_TX_BUFFER_INDEX   0

[can_filter_setting]

[can_transfer_message_setting]

Referenced by can_fd_send_extended_message(), can_fd_send_standard_message(), and can_send_standard_message().

static void can_send_standard_message ( uint32_t  id_value,
uint8_t *  data 
)
static
static void configure_usart_cdc ( void  )
static
static void display_menu ( void  )
static

[can_interrupt_handler]

[user_menu]

Referenced by main().

struct usart_module cdc_instance
static

[module_var]

[module_inst]

Referenced by configure_usart_cdc().

volatile uint32_t extended_receive_index = 0
static

Referenced by CAN0_Handler().

struct can_rx_element_buffer rx_element_buffer
static

Referenced by CAN0_Handler().

struct can_rx_element_fifo_0 rx_element_fifo_0
static

Referenced by CAN0_Handler().

struct can_rx_element_fifo_1 rx_element_fifo_1
static

Referenced by CAN0_Handler().

volatile uint32_t standard_receive_index = 0
static

[can_transfer_message_setting]

[can_receive_message_setting]

Referenced by CAN0_Handler().

uint8_t tx_message_0[CONF_CAN_ELEMENT_DATA_SIZE]
static

Referenced by configure_can(), and main().

uint8_t tx_message_1[CONF_CAN_ELEMENT_DATA_SIZE]
static

Referenced by configure_can(), and main().