14#if defined(STM32F407xx)
16#elif defined(STM32G474xx)
19#error "Unsupported CAN target"
46#define DEFINE_CAN_TASKS() \
47 RTOS_DEFINE_TASK(CAN_rx_update, 0, TASK_PRIORITY_HIGH, STACK_2048); \
48 RTOS_DEFINE_TASK(CAN_tx_update, 0, TASK_PRIORITY_HIGH, STACK_1024);
50#define START_CAN_TASKS() \
51 RTOS_START_TASK(CAN_rx_update); \
52 RTOS_START_TASK(CAN_tx_update); \
55#define CAN_TX_QUEUE_LENGTH (32)
56#define CAN_RX_QUEUE_LENGTH (32)
58#define NVIC_RX_IRQ_PRIO (6)
59#define NVIC_TX_IRQ_PRIO (7)
62 "Do not set an IRQ priority higher (numerically lower) than FreeRTOS to prevent corruption of kernel data structures"
66 "RX priority should be higher (numerically lower) than TX"
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
Definition FreeRTOSConfig.h:178
void CAN_enable_IRQs(void)
Definition can_init.c:47
void CAN_tx_update(void)
Definition can_tx.c:160
void CAN_rx_update(void)
Definition can_rx.c:20
void CAN_rx_init(void)
Definition can_rx.c:16
void CAN_tx_init(void)
Definition can_tx.c:47
#define NVIC_RX_IRQ_PRIO
Definition can_common.h:58
volatile uint32_t last_can_rx_time_ms
Definition can_irq.c:16
#define NVIC_TX_IRQ_PRIO
Definition can_common.h:59
QueueHandle_t can_rx_queue
volatile can_stats_t can_stats
Definition can_tx.c:13
bool CAN_init(void)
Definition can_init.c:146
G4 FDCAN public API implementation.
Wrapper macros for FreeRTOS constructs (tasks, queues, semaphores) to simplify static memory allocati...
Definition can_common.h:22
uint32_t tx_callback_count
Definition can_common.h:28
uint32_t tx_enqueue_count
Definition can_common.h:25
uint32_t rx_overflow
Definition can_common.h:23
uint32_t tx_overflow
Definition can_common.h:24
uint32_t tx_task_wake_count
Definition can_common.h:26
uint32_t tx_sent_count
Definition can_common.h:27