can_pal.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "can_pal_cfg.h"
#include "can_pal_mapping.h"
#include "status.h"
#include "callbacks.h"

Go to the source code of this file.

Data Structures

struct  can_time_segment_t
 CAN bit timing variables Implements : can_time_segment_t_Class. More...
 
struct  can_buff_config_t
 CAN buffer configuration Implements : can_buff_config_t_Class. More...
 
struct  can_message_t
 CAN message format Implements : can_message_t_Class. More...
 
struct  can_user_config_t
 CAN controller configuration Implements : can_user_config_t_Class. More...
 

Enumerations

enum  can_operation_modes_t { CAN_NORMAL_MODE = 0U, CAN_LOOPBACK_MODE = 2U, CAN_DISABLE_MODE = 4U }
 CAN controller operation modes Implements : can_operation_modes_t_Class. More...
 
enum  can_fd_payload_size_t { CAN_PAYLOAD_SIZE_8 = 0, CAN_PAYLOAD_SIZE_16, CAN_PAYLOAD_SIZE_32, CAN_PAYLOAD_SIZE_64 }
 CAN buffer payload sizes Implements : can_fd_payload_size_t_Class. More...
 
enum  can_bitrate_phase_t { CAN_NOMINAL_BITRATE, CAN_FD_DATA_BITRATE }
 CAN bitrate phase (nominal/data) Implements : can_bitrate_phase_t_Class. More...
 
enum  can_msg_id_type_t { CAN_MSG_ID_STD, CAN_MSG_ID_EXT }
 CAN Message Buffer ID type Implements : can_msg_id_type_t_Class. More...
 
enum  can_clk_source_t { CAN_CLK_SOURCE_OSC = 0U, CAN_CLK_SOURCE_PERIPH = 1U }
 CAN PE clock sources Implements : can_clk_source_t_Class. More...
 

Functions

status_t CAN_Init (const can_instance_t *const instance, const can_user_config_t *config)
 Initializes the CAN module. More...
 
status_t CAN_Deinit (const can_instance_t *const instance)
 De-initializes the CAN module. More...
 
status_t CAN_SetBitrate (const can_instance_t *const instance, can_bitrate_phase_t phase, const can_time_segment_t *bitTiming)
 Configures the CAN bitrate. More...
 
status_t CAN_GetBitrate (const can_instance_t *const instance, can_bitrate_phase_t phase, can_time_segment_t *bitTiming)
 Returns the CAN bitrate. More...
 
status_t CAN_ConfigTxBuff (const can_instance_t *const instance, uint32_t buffIdx, const can_buff_config_t *config)
 Configures a buffer for transmission. More...
 
status_t CAN_ConfigRemoteResponseBuff (const can_instance_t *const instance, uint32_t buffIdx, const can_buff_config_t *config, const can_message_t *message)
 Configures a transmit buffer for remote frame response. More...
 
status_t CAN_ConfigRxBuff (const can_instance_t *const instance, uint32_t buffIdx, const can_buff_config_t *config, uint32_t acceptedId)
 Configures a buffer for reception. More...
 
status_t CAN_Send (const can_instance_t *const instance, uint32_t buffIdx, const can_message_t *message)
 Sends a CAN frame using the specified buffer. More...
 
status_t CAN_SendBlocking (const can_instance_t *const instance, uint32_t buffIdx, const can_message_t *message, uint32_t timeoutMs)
 Sends a CAN frame using the specified buffer, in a blocking manner. More...
 
status_t CAN_Receive (const can_instance_t *const instance, uint32_t buffIdx, can_message_t *message)
 Receives a CAN frame using the specified message buffer. More...
 
status_t CAN_ReceiveBlocking (const can_instance_t *const instance, uint32_t buffIdx, can_message_t *message, uint32_t timeoutMs)
 Receives a CAN frame using the specified buffer, in a blocking manner. More...
 
status_t CAN_AbortTransfer (const can_instance_t *const instance, uint32_t buffIdx)
 Ends a non-blocking CAN transfer early. More...
 
status_t CAN_SetRxFilter (const can_instance_t *const instance, can_msg_id_type_t idType, uint32_t buffIdx, uint32_t mask)
 Configures an ID filter for a specific reception buffer. More...
 
status_t CAN_GetTransferStatus (const can_instance_t *const instance, uint32_t buffIdx)
 Returns the state of the previous CAN transfer. More...
 
status_t CAN_InstallEventCallback (const can_instance_t *const instance, can_callback_t callback, void *callbackParam)
 Installs a callback function for the IRQ handler. More...