libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
fdcan.c File Reference
#include <libopencm3/stm32/fdcan.h>
#include <libopencm3/stm32/rcc.h>
#include <stddef.h>
Include dependency graph for fdcan.c:

Go to the source code of this file.

Macros

#define FDCAN_LSS_COUNT(can_base)    ((FDCAN_SIDFC(can_base) >> FDCAN_SIDFC_LSS_SHIFT) & FDCAN_SIDFC_LSS_MASK)
 
#define FDCAN_LSE_COUNT(can_base)    ((FDCAN_XIDFC(can_base) >> FDCAN_XIDFC_LSE_SHIFT) & FDCAN_XIDFC_LSE_MASK)
 

Functions

unsigned fdcan_get_fifo_element_size (uint32_t canport, unsigned fifo_id)
 Returns actual size of FIFO entry in FIFO for given CAN port and FIFO. More...
 
unsigned fdcan_get_txbuf_element_size (uint32_t canport)
 Returns actual size of transmit entry in transmit queue/FIFO for given CAN port. More...
 
void fdcan_init_std_filter_ram (uint32_t canport, uint32_t flssa, uint8_t lss)
 Initialize allocation of standard filter block in CAN message RAM. More...
 
void fdcan_init_ext_filter_ram (uint32_t canport, uint32_t flesa, uint8_t lse)
 Initialize allocation of extended filter block in CAN message RAM. More...
 
void fdcan_init_fifo_ram (uint32_t canport, unsigned fifo_id, uint32_t fxsa, uint8_t fxs)
 Initialize allocation of FIFO block in CAN message RAM. More...
 
void fdcan_init_tx_event_ram (uint32_t canport, uint32_t tesa, uint8_t tes)
 Initialize allocation of transmit event block in CAN message RAM. More...
 
void fdcan_init_tx_buffer_ram (uint32_t canport, uint32_t tbsa, uint8_t tbs)
 Initialize allocation of transmit queue block in CAN message RAM. More...
 
int fdcan_set_rx_element_size (uint32_t canport, uint8_t rxbuf, uint8_t rxfifo0, uint8_t rxfifo1)
 Initialize size of data fields in reception buffers. More...
 
int fdcan_set_tx_element_size (uint32_t canport, uint8_t txbuf)
 Initialize size of data fields in transmit buffers. More...
 
void fdcan_init_filter (uint32_t canport, uint8_t std_filt, uint8_t ext_filt)
 Configure amount of filters and initialize filtering block. More...
 
int fdcan_start (uint32_t canport, uint32_t timeout)
 Enable FDCAN operation after FDCAN block has been set up. More...
 
void fdcan_set_fifo_locked_mode (uint32_t canport, bool locked)
 Configure FDCAN FIFO lock mode. More...
 

Macro Definition Documentation

◆ FDCAN_LSE_COUNT

#define FDCAN_LSE_COUNT (   can_base)     ((FDCAN_XIDFC(can_base) >> FDCAN_XIDFC_LSE_SHIFT) & FDCAN_XIDFC_LSE_MASK)

Definition at line 53 of file fdcan.c.

◆ FDCAN_LSS_COUNT

#define FDCAN_LSS_COUNT (   can_base)     ((FDCAN_SIDFC(can_base) >> FDCAN_SIDFC_LSS_SHIFT) & FDCAN_SIDFC_LSS_MASK)

Definition at line 50 of file fdcan.c.