File CAN_FD.h
FileList > bsp > Inc > CAN_FD.h
Go to the source code of this file
#include "stm32xx_hal.h"#include "CAN_Common.h"#include "queue_ex.h"
Public Functions
| Type | Name |
|---|---|
| can_status_t | can_fd_deinit (FDCAN_HandleTypeDef * handle) Deinitializes the FDCAN peripheral. |
| can_status_t | can_fd_init (FDCAN_HandleTypeDef * handle, FDCAN_FilterTypeDef * filter) Initializes the FDCAN peripheral. |
| can_status_t | can_fd_recv (FDCAN_HandleTypeDef * handle, uint32_t id, FDCAN_RxHeaderTypeDef * header, uint8_t data, TickType_t delay_ticks) Receives a FDCAN message. |
| void | can_fd_rx_callback_hook (FDCAN_HandleTypeDef * hfdcan, uint32_t RxFifo0ITs, can_rx_payload_t recv_payload) |
| can_status_t | can_fd_send (FDCAN_HandleTypeDef * handle, FDCAN_TxHeaderTypeDef * header, uint8_t data, TickType_t delay_ticks) Sends a FDCAN message. |
| can_status_t | can_fd_start (FDCAN_HandleTypeDef * handle) Starts the FDCAN peripheral. |
| void | can_fd_tx_callback_hook (FDCAN_HandleTypeDef * hfdcan, const can_tx_payload_t * payload) |
Public Functions Documentation
function can_fd_deinit
Deinitializes the FDCAN peripheral.
can_status_t can_fd_deinit (
FDCAN_HandleTypeDef * handle
)
This function deinitializes the HAL FDCAN driver and disables FDCAN interrupts.
Parameters:
handlePointer to the FDCAN handle structure.
Returns:
can_status_t Returns CAN_OK on success, CAN_ERR on failure.
function can_fd_init
Initializes the FDCAN peripheral.
can_status_t can_fd_init (
FDCAN_HandleTypeDef * handle,
FDCAN_FilterTypeDef * filter
)
This function initializes the FDCAN peripheral, sets up send/receive queues, configures the HAL FDCAN driver, applies the filter configuration, and enables FDCAN interrupts.
Parameters:
handlePointer to the FDCAN handle structure.filterPointer to the FDCAN filter configuration structure.
Returns:
can_status_t Returns CAN_OK on success, CAN_ERR on failure.
function can_fd_recv
Receives a FDCAN message.
can_status_t can_fd_recv (
FDCAN_HandleTypeDef * handle,
uint32_t id,
FDCAN_RxHeaderTypeDef * header,
uint8_t data,
TickType_t delay_ticks
)
Reads a message from the receive queue corresponding to the specified ID. Supports blocking or non-blocking behavior depending on delay_ticks.
Parameters:
handlePointer to the FDCAN handle structure.idCAN identifier of the message to receive.headerPointer to a FDCAN_RxHeaderTypeDef structure to store the received header.dataArray to store the received data.delay_ticksMaximum delay to wait if queue is empty (FreeRTOS ticks).
Returns:
can_status_t Returns CAN_OK if a message was received, CAN_EMPTY if the queue was empty, CAN_ERR on failure or invalid ID.
function can_fd_rx_callback_hook
void can_fd_rx_callback_hook (
FDCAN_HandleTypeDef * hfdcan,
uint32_t RxFifo0ITs,
can_rx_payload_t recv_payload
)
function can_fd_send
Sends a FDCAN message.
can_status_t can_fd_send (
FDCAN_HandleTypeDef * handle,
FDCAN_TxHeaderTypeDef * header,
uint8_t data,
TickType_t delay_ticks
)
Places a FDCAN message into the transmit mailbox if available, otherwise queues it in the send queue for later transmission.
Parameters:
handlePointer to the FDCAN handle structure.headerPointer to the FDCAN transmit header structure.dataArray containing the data to send.delay_ticksMaximum delay to wait if queue is full (FreeRTOS ticks).
Returns:
can_status_t Returns CAN_OK if message was successfully sent or queued, CAN_ERR on failure.
function can_fd_start
Starts the FDCAN peripheral.
can_status_t can_fd_start (
FDCAN_HandleTypeDef * handle
)
Activates the FDCAN peripheral so it can transmit and receive messages.
Parameters:
handlePointer to the FDCAN handle structure.
Returns:
can_status_t Returns CAN_OK on success, CAN_ERR on failure.
function can_fd_tx_callback_hook
void can_fd_tx_callback_hook (
FDCAN_HandleTypeDef * hfdcan,
const can_tx_payload_t * payload
)
The documentation for this class was generated from the following file bsp/Inc/CAN_FD.h