9#if (CORE_CAN_DISABLE_TX_QUEUE != 1) || (CORE_CAN_DISABLE_SEMAPHORE != 1) || (CORE_CAN_USE_MSGBUF == 1) || (CORE_CAN_DISABLE_RX_QUEUE != 1)
13#include "message_buffer.h"
34#if CORE_CAN_DISABLE_RX_QUEUE != 1
37#if CORE_CAN_DISABLE_TX_QUEUE != 1
40#if CORE_CAN_USE_MSGBUF != 0
41 MessageBufferHandle_t msgbuf;
43#if CORE_CAN_DISABLE_SEMAPHORE != 1
50 uint8_t fdcan_num_standard_filters;
51 uint8_t fdcan_num_extended_filters;
72 uint16_t arbitration_error;
78extern const uint8_t core_CAN_dlc_lookup[16];
81bool core_CAN_init(FDCAN_GlobalTypeDef *fdcan, uint32_t baudrate);
84#define core_CAN_enable_timestamps core_timestamp_init
86bool core_CAN_send_message(FDCAN_GlobalTypeDef *can, uint32_t
id, uint8_t dlc, uint64_t data);
87bool core_CAN_send_fd_message(FDCAN_GlobalTypeDef *can, uint32_t
id, uint8_t dlc, uint8_t *data);
88bool core_CAN_add_message_to_tx_queue(FDCAN_GlobalTypeDef *can, uint32_t
id, uint8_t dlc, uint64_t data);
89bool core_CAN_add_extended_message_to_tx_queue(FDCAN_GlobalTypeDef *can, uint32_t
id, uint8_t dlc, uint8_t *data);
90bool core_CAN_send_from_tx_queue_task(FDCAN_GlobalTypeDef *can);
92bool core_CAN_receive_from_queue(FDCAN_GlobalTypeDef *can,
CanMessage_s *received_message);
93bool core_CAN_receive_extended_from_queue(FDCAN_GlobalTypeDef *can,
CanExtendedMessage_s *received_message);
94#if (defined(CORE_CAN_USE_MSGBUF)) && (CORE_CAN_USE_MSGBUF != 0)
95uint8_t core_CAN_receive_from_msgbuf(FDCAN_GlobalTypeDef *can, uint8_t *buf, TickType_t timeout);
96BaseType_t core_CAN_msgbuf_insert_ts(
core_CAN_module_t *p_can, uint8_t *buf, uint8_t buflen, uint32_t lsb);
99bool core_CAN_add_filter(FDCAN_GlobalTypeDef *can,
bool isExtended, uint32_t id1, uint32_t id2);
Configuration file for the core library.
Header for a CAN packet.
Definition can.h:60
uint8_t rtr
Indicates if the frame was a remote transmission request.
Definition can.h:66
uint8_t esi
Indicates if the transmitting node is error passive.
Definition can.h:68
uint8_t type
Packet type.
Definition can.h:61
uint8_t xtd
Indicates if the ID is an extended ID.
Definition can.h:67
uint8_t length
Length of the packet not including the header.
Definition can.h:62
uint32_t id
CAN ID.
Definition can.h:65
uint8_t fdf
1 for FD frames, 0 otherwise
Definition can.h:63
uint16_t timestamp
Timestamp for received packets.
Definition can.h:64
SemaphoreHandle_t can_tx_semaphore
TX semaphore, taken when a message is added to the hardware FIFO and given when transmission complete...
Definition can.h:44
FDCAN_HandleTypeDef hfdcan
HAL FDCAN handle.
Definition can.h:33
QueueHandle_t can_queue_rx
Handle for FreeRTOS RX queue.
Definition can.h:35
QueueHandle_t can_queue_tx
Handle for FreeRTOS TX queue.
Definition can.h:38
uint32_t timestamp_msb
Most significant bits of the timestamp for the most recently received packet.
Definition can.h:48