13#if !defined(BOOTLOADER_FIRMWARE)
16#if !defined(STM32G474xx)
17#error "CAN library requires STM32G474xx (FDCAN)"
21#if !defined(BOOTLOADER_FIRMWARE)
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:179
void CAN_tx_update(void)
Definition can_tx.c:92
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:26
#define NVIC_RX_IRQ_PRIO
Definition can_common.h:58
volatile uint32_t last_can_rx_time_ms
Definition can_callback.c:18
#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
void CAN_init(void)
Definition can_init.c:59
void CAN_enable_irqs(void)
Definition can_init.c:28
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