Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches

CAN FD Driver using dsPIC MCUs. More...

+ Collaboration diagram for CAN FD Driver:

Files

file  can1.h
 This is the generated driver header file for the CAN1 driver using CCL.
 
file  can_features.h
 This is the generated module feature header file for CAN driver using CCL. This file provides module feature list available on the selected device. The macros defined in this file provides the flexibility to easily migrate the user application to other device which might have varied feature list.
 
file  can_types.h
 This is the generated driver types header file for the CAN driver using CCL.
 
file  can1.c
 This is the generated driver source file for CAN1 driver using CCL.
 

Data Structures

struct  CAN_INTERFACE
 Structure containing the function pointers of CAN driver. More...
 
struct  CAN_MSG_FIELD
 This data structure used to configure the message fields. Some of the fields formatType and brs data should match with the CAN FD configuration in Melody MCC user interface. More...
 
struct  CAN_MSG_OBJ
 This data structure used to configure the CAN FD message object. More...
 
struct  CAN1
 This defines the object required for the maintenance of the receive FIFO message object. More...
 

Macros

#define CAN_FD1_Initialize   CAN1_Initialize
 This macro defines the Custom Name for CAN1_Initialize API.
 
#define CAN_FD1_Deinitialize   CAN1_Deinitialize
 This macro defines the Custom Name for CAN1_Deinitialize API.
 
#define CAN_FD1_OperationModeSet   CAN1_OperationModeSet
 This macro defines the Custom Name for CAN1_OperationModeSet API.
 
#define CAN_FD1_OperationModeGet   CAN1_OperationModeGet
 This macro defines the Custom Name for CAN1_OperationModeGet API.
 
#define CAN_FD1_Receive   CAN1_Receive
 This macro defines the Custom Name for CAN1_Receive API.
 
#define CAN_FD1_ReceiveMessageGet   CAN1_ReceiveMessageGet
 This macro defines the Custom Name for CAN1_ReceiveMessageGet API.
 
#define CAN_FD1_RX_FIFO_StatusGet   CAN1_RX_FIFO_StatusGet
 This macro defines the Custom Name for CAN1_RX_FIFO_StatusGet API.
 
#define CAN_FD1_Transmit   CAN1_Transmit
 This macro defines the Custom Name for CAN1_Transmit API.
 
#define CAN_FD1_TransmitFIFOStatusGet   CAN1_TransmitFIFOStatusGet
 This macro defines the Custom Name for CAN1_TransmitFIFOStatusGet API.
 
#define CAN_FD1_IsBusOff   CAN1_IsBusOff
 This macro defines the Custom Name for CAN1_IsBusOff API.
 
#define CAN_FD1_IsTxErrorPassive   CAN1_IsTxErrorPassive
 This macro defines the Custom Name for CAN1_IsTxErrorPassive API.
 
#define CAN_FD1_IsTxErrorWarning   CAN1_IsTxErrorWarning
 This macro defines the Custom Name for CAN1_IsTxErrorWarning API.
 
#define CAN_FD1_IsTxErrorActive   CAN1_IsTxErrorActive
 This macro defines the Custom Name for CAN1_IsTxErrorActive API.
 
#define CAN_FD1_IsRxErrorPassive   CAN1_IsRxErrorPassive
 This macro defines the Custom Name for CAN1_IsRxErrorPassive API.
 
#define CAN_FD1_IsRxErrorWarning   CAN1_IsRxErrorWarning
 This macro defines the Custom Name for CAN1_IsRxErrorWarning API.
 
#define CAN_FD1_IsRxErrorActive   CAN1_IsRxErrorActive
 This macro defines the Custom Name for CAN1_IsRxErrorActive API.
 
#define CAN_FD1_Sleep   CAN1_Sleep
 This macro defines the Custom Name for CAN1_Sleep API.
 
#define CAN_FD1_ReceivedMessageCountGet   CAN1_ReceivedMessageCountGet
 This macro defines the Custom Name for CAN1_ReceivedMessageCountGet API.
 
#define CAN_FD1_Tasks   CAN1_Tasks
 This macro defines the Custom Name for CAN1_Tasks API.
 
#define CAN_FD1_InvalidMessageCallbackRegister   CAN1_InvalidMessageCallbackRegister
 This macro defines the Custom Name for CAN1_InvalidMessageCallbackRegister API.
 
#define CAN_FD1_BusWakeUpActivityCallbackRegister   CAN1_BusWakeUpActivityCallbackRegister
 This macro defines the Custom Name for CAN1_BusWakeUpActivityCallbackRegister API.
 
#define CAN_FD1_BusErrorCallbackRegister   CAN1_BusErrorCallbackRegister
 This macro defines the Custom Name for CAN1_BusErrorCallbackRegister API.
 
#define CAN_FD1_ModeChangeCallbackRegister   CAN1_ModeChangeCallbackRegister
 This macro defines the Custom Name for CAN1_ModeChangeCallbackRegister API.
 
#define CAN_FD1_SystemErrorCallbackRegister   CAN1_SystemErrorCallbackRegister
 This macro defines the Custom Name for CAN1_SystemErrorCallbackRegister API.
 
#define CAN_FD1_TxAttemptCallbackRegister   CAN1_TxAttemptCallbackRegister
 This macro defines the Custom Name for CAN1_TxAttemptCallbackRegister API.
 
#define CAN_FD1_RxBufferOverFlowCallbackRegister   CAN1_RxBufferOverFlowCallbackRegister
 This macro defines the Custom Name for CAN1_RxBufferOverFlowCallbackRegister API.
 
#define CAN1_TX_TXQ   CAN1_TXQ
 CAN1 Transmit FIFO TXQ Custom Name.
 
#define CAN1_RX_FIFO1   CAN1_FIFO_1
 CAN1 Receive FIFO 1 Custom Name.
 
#define CAN_FD_MESSAGE_FORMAT_FEATURE_AVAILABLE   1
 This macro defines the CAN FD Message format data update request functionality.
 
#define CAN_FIFO_BASED_TRANSMIT_PRIORITY_FEATURE_AVAILABLE   1
 This macro defines the CAN FIFO based transmit priority data update request functionality.
 
#define CAN_DMA_INTERFACE_FEATURE_AVAILABLE   0
 This macro defines the CAN 2.0 DMA interface data update request functionality.
 

Enumerations

enum  CAN1_TX_FIFO_CHANNELS { CAN1_TXQ = 0 }
 This enumeration defines the can Transmit FIFO Configured in MCC Melody CAN user interface. More...
 
enum  CAN1_RX_FIFO_CHANNELS { CAN1_FIFO_1 = 1 }
 This enumeration defines the can receive FIFO. More...
 
enum  CAN_MSG_OBJ_BRS_MODE { CAN_NON_BRS_MODE = 0 , CAN_BRS_MODE = 1 }
 Defines the Bit rate with enabled or disabled the CAN message object. More...
 
enum  CAN_MSG_OBJ_ID_TYPE { CAN_FRAME_STD = 0 , CAN_FRAME_EXT = 1 }
 Defines the Standard ID or Extended ID in CAN message object. More...
 
enum  CAN_MSG_OBJ_FRAME_TYPE { CAN_FRAME_DATA = 0 , CAN_FRAME_RTR = 1 }
 Defines the Data frame or Remote transmit Request frame in CAN message object. More...
 
enum  CAN_MSG_OBJ_TYPE { CAN_2_0_FORMAT = 0 , CAN_FD_FORMAT = 1 }
 Defines the CAN FD format or CAN 2.0 format in CAN message object. More...
 
enum  CAN_TX_MSG_REQUEST_STATUS { CAN_TX_MSG_REQUEST_SUCCESS = 0 , CAN_TX_MSG_REQUEST_DLC_EXCEED_ERROR = 1 , CAN_TX_MSG_REQUEST_BRS_ERROR = 2 , CAN_TX_MSG_REQUEST_FIFO_FULL = 3 }
 Defines the CAN transmit Api return status. More...
 
enum  CAN_OP_MODES { CAN_NORMAL_FD_MODE = 0x0 , CAN_DISABLE_MODE = 0x1 , CAN_INTERNAL_LOOPBACK_MODE = 0x2 , CAN_LISTEN_ONLY_MODE = 0x3 , CAN_CONFIGURATION_MODE = 0x4 , CAN_EXTERNAL_LOOPBACK_MODE = 0x5 , CAN_NORMAL_2_0_MODE = 0x6 , CAN_RESTRICTED_OPERATION_MODE =0x7 }
 Defines the CAN operation modes are available for the module to use. More...
 
enum  CAN_OP_MODE_STATUS { CAN_OP_MODE_REQUEST_SUCCESS , CAN_OP_MODE_REQUEST_FAIL , CAN_OP_MODE_SYS_ERROR_OCCURED }
 Defines the CAN operation set Api return status. More...
 
enum  CAN_TX_FIFO_STATUS { CAN_TX_FIFO_FULL , CAN_TX_FIFO_AVAILABLE }
 Defines the CAN transmit status get Api return status. More...
 
enum  CAN_DLC {
  DLC_0 , DLC_1 , DLC_2 , DLC_3 , DLC_4 , DLC_5 , DLC_6 , DLC_7 , DLC_8 , DLC_12 ,
  DLC_16 , DLC_20 , DLC_24 , DLC_32 , DLC_48 , DLC_64
}
 Defines the CAN message payload size that are available for the mode to use. More...
 

Functions

void CAN1_Initialize (void)
 Initializes CAN1 module.
 
void CAN1_Deinitialize (void)
 Deinitializes CAN1 to POR values.
 
enum CAN_OP_MODE_STATUS CAN1_OperationModeSet (const enum CAN_OP_MODES requestMode)
 Sets the CAN1 operation mode.
 
enum CAN_OP_MODES CAN1_OperationModeGet (void)
 Get the CAN1 operation mode.
 
bool CAN1_Receive (struct CAN_MSG_OBJ *rxCanMsg)
 Reads the received single message object.
 
bool CAN1_ReceiveMessageGet (const enum CAN1_RX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *rxCanMsg)
 Reads the received single message object from the CAN1 receive FIFO.
 
enum CAN_TX_MSG_REQUEST_STATUS CAN1_Transmit (const enum CAN1_TX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *txCanMsg)
 Writes the CAN message object to specified transmit FIFO channel.
 
enum CAN_TX_FIFO_STATUS CAN1_TransmitFIFOStatusGet (const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
 Returns the CAN1 transmitter FIFO status.
 
bool CAN1_IsBusOff (void)
 Returns the bus off status.
 
bool CAN1_IsTxErrorPassive (void)
 Returns the transmit error passive state.
 
bool CAN1_IsTxErrorWarning (void)
 Returns the transmit error warning state. If Transmitter error counter is above 95 to below 128, then transmitter error warning state is set.
 
bool CAN1_IsTxErrorActive (void)
 Returns the transmit error active state.
 
bool CAN1_IsRxErrorPassive (void)
 Returns the receive error passive state.
 
bool CAN1_IsRxErrorWarning (void)
 Returns the receive error warning state. If Receiver error counter is above 95 to below 128, then receiver error warning state is set.
 
bool CAN1_IsRxErrorActive (void)
 Returns the receive error active state.
 
void CAN1_Sleep (void)
 Sets the CAN node in sleep mode.
 
uint8_t CAN1_ReceivedMessageCountGet (void)
 Returns the number of CAN messages received in all the FIFO.
 
uint8_t CAN1_RX_FIFO_StatusGet (const enum CAN1_RX_FIFO_CHANNELS fifoNum)
 This returns the CAN1 receive FIFO status.
 
void CAN1_Tasks (void)
 This routine is used to implement the tasks for polled implementations.
 
void CAN1_InvalidMessageCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_InvalidMessageCallback.
 
void CAN1_InvalidMessageCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_InvalidMessageCallbackRegister.
 
void CAN1_BusWakeUpActivityCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_BusWakeUpActivityCallback.
 
void CAN1_BusWakeUpActivityCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_BusWakeUpActivityCallbackRegister.
 
void CAN1_BusErrorCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_BusErrorCallback.
 
void CAN1_BusErrorCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_BusErrorCallbackRegister.
 
void CAN1_ModeChangeCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_ModeChangeCallback.
 
void CAN1_ModeChangeCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_ModeChangeCallbackRegister.
 
void CAN1_SystemErrorCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_SystemErrorCallback.
 
void CAN1_SystemErrorCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_SystemErrorCallbackRegister.
 
void CAN1_TxAttemptCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_TxAttemptCallback.
 
void CAN1_TxAttemptCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_TxAttemptCallbackRegister.
 
void CAN1_RxBufferOverFlowCallbackRegister (void(*handler)(void))
 This function can be used to override default callback and to define custom callback for CAN1_RxBufferOverFlowCallback.
 
void CAN1_RxBufferOverFlowCallback (void)
 This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CAN1_RxBufferOverFlowCallbackRegister.
 
static uint8_t CAN1_DlcToDataBytesGet (const enum CAN_DLC dlc)
 This function get the DLC enum based decimal value.
 
static void CAN1_FIFO_InfoGet (const uint8_t fifoNum, volatile struct CAN1_FIFO_INFO *fifoInfo)
 This function get the FIFO user address, message depth and payload size information.
 
static void CAN1_RX_FIFO_ResetInfo (void)
 This function reset the CAN1 receive message head count.
 
static uint8_t CAN1_RxFifoSearch (uint8_t fifoNum)
 This function Search the CAN1 receive FIFO channel index.
 
static void CAN1_RX_FIFO_OverflowStatusFlagClear (const enum CAN1_RX_FIFO_CHANNELS fifoNum)
 This function is used to clear the CAN1 receive FIFO overflow status bit.
 
static void CAN1_RX_FIFO_IncrementMsgPtr (const uint8_t fifoNum)
 This function Update the receive FIFO message increment tail position.
 
static uint16_t CAN1_RX_FIFO_MessageIndexGet (const enum CAN1_RX_FIFO_CHANNELS fifoNum)
 This function get the Receiver FIFO message index value.
 
static void CAN1_TX_FIFO_MessageSendRequest (const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
 This function enables The FIFO transmit message send request bit.
 
static void CAN1_MessageReadFromFifo (uint16_t *rxFifoObj, struct CAN_MSG_OBJ *rxCanMsg)
 This function read the message object from receive FIFO and update to the user
message object pointer.
 
static void CAN1_MessageWriteToFifo (uint16_t *txFifoObj, struct CAN_MSG_OBJ *txCanMsg)
 This function Read the message object from user input and update to the CAN1 TX FIFO.
 
static void CAN1_TX_FIFO_Configuration (void)
 This function configure the CAN1 transmit FIFO settings.
 
static void CAN1_RX_FIFO_Configuration (void)
 This function configure the CAN1 receive FIFO settings.
 
static void CAN1_RX_FIFO_FilterMaskConfiguration (void)
 This function configure the CAN1 filter and mask settings.
 
static void CAN1_BitRateConfiguration (void)
 This function configure the CAN1 bit rate settings.
 
static void CAN1_ErrorNotificationEnable (void)
 This function enables the CAN1 error notification interrupt.
 

Variables

const struct CAN_INTERFACE CAN_FD1
 Structure object of type CAN_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. CAN can be changed by the user in the CAN FD user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
 

Detailed Description

Macro Definition Documentation

◆ CAN1_RX_FIFO1

#define CAN1_RX_FIFO1   CAN1_FIFO_1

Defines the custom name of CAN1_FIFO_1 used for Receive functionality

Definition at line 202 of file can1.h.

◆ CAN1_TX_TXQ

#define CAN1_TX_TXQ   CAN1_TXQ

Defines the custom name of CAN1_TXQ used for Transmit functionality

Definition at line 196 of file can1.h.

◆ CAN_DMA_INTERFACE_FEATURE_AVAILABLE

#define CAN_DMA_INTERFACE_FEATURE_AVAILABLE   0

Macros defined for features not supported in the device

Definition at line 103 of file can_features.h.

◆ CAN_FD1_BusErrorCallbackRegister

#define CAN_FD1_BusErrorCallbackRegister   CAN1_BusErrorCallbackRegister

Definition at line 169 of file can1.h.

◆ CAN_FD1_BusWakeUpActivityCallbackRegister

#define CAN_FD1_BusWakeUpActivityCallbackRegister   CAN1_BusWakeUpActivityCallbackRegister

Definition at line 164 of file can1.h.

◆ CAN_FD1_Deinitialize

#define CAN_FD1_Deinitialize   CAN1_Deinitialize

Definition at line 69 of file can1.h.

◆ CAN_FD1_Initialize

#define CAN_FD1_Initialize   CAN1_Initialize

Definition at line 64 of file can1.h.

◆ CAN_FD1_InvalidMessageCallbackRegister

#define CAN_FD1_InvalidMessageCallbackRegister   CAN1_InvalidMessageCallbackRegister

Definition at line 159 of file can1.h.

◆ CAN_FD1_IsBusOff

#define CAN_FD1_IsBusOff   CAN1_IsBusOff

Definition at line 109 of file can1.h.

◆ CAN_FD1_IsRxErrorActive

#define CAN_FD1_IsRxErrorActive   CAN1_IsRxErrorActive

Definition at line 139 of file can1.h.

◆ CAN_FD1_IsRxErrorPassive

#define CAN_FD1_IsRxErrorPassive   CAN1_IsRxErrorPassive

Definition at line 129 of file can1.h.

◆ CAN_FD1_IsRxErrorWarning

#define CAN_FD1_IsRxErrorWarning   CAN1_IsRxErrorWarning

Definition at line 134 of file can1.h.

◆ CAN_FD1_IsTxErrorActive

#define CAN_FD1_IsTxErrorActive   CAN1_IsTxErrorActive

Definition at line 124 of file can1.h.

◆ CAN_FD1_IsTxErrorPassive

#define CAN_FD1_IsTxErrorPassive   CAN1_IsTxErrorPassive

Definition at line 114 of file can1.h.

◆ CAN_FD1_IsTxErrorWarning

#define CAN_FD1_IsTxErrorWarning   CAN1_IsTxErrorWarning

Definition at line 119 of file can1.h.

◆ CAN_FD1_ModeChangeCallbackRegister

#define CAN_FD1_ModeChangeCallbackRegister   CAN1_ModeChangeCallbackRegister

Definition at line 174 of file can1.h.

◆ CAN_FD1_OperationModeGet

#define CAN_FD1_OperationModeGet   CAN1_OperationModeGet

Definition at line 79 of file can1.h.

◆ CAN_FD1_OperationModeSet

#define CAN_FD1_OperationModeSet   CAN1_OperationModeSet

Definition at line 74 of file can1.h.

◆ CAN_FD1_Receive

#define CAN_FD1_Receive   CAN1_Receive

Definition at line 84 of file can1.h.

◆ CAN_FD1_ReceivedMessageCountGet

#define CAN_FD1_ReceivedMessageCountGet   CAN1_ReceivedMessageCountGet

Definition at line 149 of file can1.h.

◆ CAN_FD1_ReceiveMessageGet

#define CAN_FD1_ReceiveMessageGet   CAN1_ReceiveMessageGet

Definition at line 89 of file can1.h.

◆ CAN_FD1_RX_FIFO_StatusGet

#define CAN_FD1_RX_FIFO_StatusGet   CAN1_RX_FIFO_StatusGet

Definition at line 94 of file can1.h.

◆ CAN_FD1_RxBufferOverFlowCallbackRegister

#define CAN_FD1_RxBufferOverFlowCallbackRegister   CAN1_RxBufferOverFlowCallbackRegister

Definition at line 189 of file can1.h.

◆ CAN_FD1_Sleep

#define CAN_FD1_Sleep   CAN1_Sleep

Definition at line 144 of file can1.h.

◆ CAN_FD1_SystemErrorCallbackRegister

#define CAN_FD1_SystemErrorCallbackRegister   CAN1_SystemErrorCallbackRegister

Definition at line 179 of file can1.h.

◆ CAN_FD1_Tasks

#define CAN_FD1_Tasks   CAN1_Tasks

Definition at line 154 of file can1.h.

◆ CAN_FD1_Transmit

#define CAN_FD1_Transmit   CAN1_Transmit

Definition at line 99 of file can1.h.

◆ CAN_FD1_TransmitFIFOStatusGet

#define CAN_FD1_TransmitFIFOStatusGet   CAN1_TransmitFIFOStatusGet

Definition at line 104 of file can1.h.

◆ CAN_FD1_TxAttemptCallbackRegister

#define CAN_FD1_TxAttemptCallbackRegister   CAN1_TxAttemptCallbackRegister

Definition at line 184 of file can1.h.

◆ CAN_FD_MESSAGE_FORMAT_FEATURE_AVAILABLE

#define CAN_FD_MESSAGE_FORMAT_FEATURE_AVAILABLE   1

IMPORTANT******** This file defines the CAN module feature C-macros available on the selected device. The macros defined in this file provides the flexibility to easily migrate the user application to other device which might have varied feature list.

The file has to be manually included in main.c, if the user intends to migrate the application to another device which might have varied feature list.

          The content in this file is strictly "read only" and should 

not be altered. Failing to do so, the migration is not guaranteed.************* Macros defined for features supported in the device

APIs Supported:
CAN_TX_MSG_REQUEST_STATUS CANx_Transmit(const CANx_TX_FIFO_CHANNELS fifoChannel, CAN_MSG_OBJ *txCanMsg); bool CANx_Receive(CAN_MSG_OBJ *rxCanMsg); x denotes instance of CAN in CANx. Refer to device specific datasheet to check number of CAN module instance. Refer driver header file for detailed description of the APIs.

Definition at line 80 of file can_features.h.

◆ CAN_FIFO_BASED_TRANSMIT_PRIORITY_FEATURE_AVAILABLE

#define CAN_FIFO_BASED_TRANSMIT_PRIORITY_FEATURE_AVAILABLE   1

APIs Supported:
CAN_TX_MSG_REQUEST_STATUS CANx_Transmit(const CANx_TX_FIFO_CHANNELS fifoChannel, CAN_MSG_OBJ *txCanMsg); CAN_TX_FIFO_STATUS CANx_TransmitFIFOStatusGet(const CANx_TX_FIFO_CHANNELS fifoChannel);

x denotes instance of CAN in CANx. Refer to device specific datasheet to check number of CAN module instance. Refer driver header file for detailed description of the APIs.

Definition at line 94 of file can_features.h.

Enumeration Type Documentation

◆ CAN1_RX_FIFO_CHANNELS

Enumerator
CAN1_FIFO_1 

CAN1 Receive FIFO 1

Definition at line 220 of file can1.h.

◆ CAN1_TX_FIFO_CHANNELS

Enumerator
CAN1_TXQ 

CAN1 Transmit FIFO TXQ

Definition at line 210 of file can1.h.

◆ CAN_DLC

enum CAN_DLC
Enumerator
DLC_0 

Data length count 0

DLC_1 

Data length count 1

DLC_2 

Data length count 2

DLC_3 

Data length count 3

DLC_4 

Data length count 4

DLC_5 

Data length count 5

DLC_6 

Data length count 6

DLC_7 

Data length count 7

DLC_8 

Data length count 8

DLC_12 

Data length count 12

DLC_16 

Data length count 16

DLC_20 

Data length count 20

DLC_24 

Data length count 24

DLC_32 

Data length count 32

DLC_48 

Data length count 48

DLC_64 

Data length count 64

Definition at line 176 of file can_types.h.

◆ CAN_MSG_OBJ_BRS_MODE

Enumerator
CAN_NON_BRS_MODE 

Disable BRS Mode (Supported only in CAN FD mode)

CAN_BRS_MODE 

Enable BRS Mode (Supported only in CAN FD mode)

Definition at line 79 of file can_types.h.

◆ CAN_MSG_OBJ_FRAME_TYPE

Enumerator
CAN_FRAME_DATA 

Data Frame CAN message object

CAN_FRAME_RTR 

Remote Transmit Request Frame CAN message object

Definition at line 101 of file can_types.h.

◆ CAN_MSG_OBJ_ID_TYPE

Enumerator
CAN_FRAME_STD 

Standard ID CAN message object

CAN_FRAME_EXT 

Extended ID CAN message object

Definition at line 90 of file can_types.h.

◆ CAN_MSG_OBJ_TYPE

Enumerator
CAN_2_0_FORMAT 

CAN 2.0 Message format

CAN_FD_FORMAT 

CAN FD Message format (Supported only in CAN FD mode)

Definition at line 112 of file can_types.h.

◆ CAN_OP_MODE_STATUS

Enumerator
CAN_OP_MODE_REQUEST_SUCCESS 

Defines the requested operation mode set successfully

CAN_OP_MODE_REQUEST_FAIL 

Defines the requested operation mode set failure. Set configuration mode before setting CAN normal or debug operation mode.

CAN_OP_MODE_SYS_ERROR_OCCURED 

Defines the system error occurred while setting operation mode.

Definition at line 153 of file can_types.h.

◆ CAN_OP_MODES

Enumerator
CAN_NORMAL_FD_MODE 

CAN FD Normal Operation Mode (Supported only in CAN FD mode)

CAN_DISABLE_MODE 

CAN Disable Operation Mode

CAN_INTERNAL_LOOPBACK_MODE 

CAN Internal Loopback Operation Mode

CAN_LISTEN_ONLY_MODE 

CAN Listen only Operation Mode

CAN_CONFIGURATION_MODE 

CAN Configuration Operation Mode

CAN_EXTERNAL_LOOPBACK_MODE 

CAN External loopback Operation Mode

CAN_NORMAL_2_0_MODE 

CAN 2.0 Operation Mode

CAN_RESTRICTED_OPERATION_MODE 

CAN Restricted Operation Mode

Definition at line 136 of file can_types.h.

◆ CAN_TX_FIFO_STATUS

Enumerator
CAN_TX_FIFO_FULL 

Defines the Transmit FIFO is full

CAN_TX_FIFO_AVAILABLE 

Defines the Transmit FIFO is available

Definition at line 165 of file can_types.h.

◆ CAN_TX_MSG_REQUEST_STATUS

Enumerator
CAN_TX_MSG_REQUEST_SUCCESS 

Transmit message object successfully placed into Transmit FIFO

CAN_TX_MSG_REQUEST_DLC_EXCEED_ERROR 

Transmit message object DLC size is more than Transmit FIFO configured DLC size

CAN_TX_MSG_REQUEST_BRS_ERROR 

Transmit FIFO is configured has Non BRS mode and CAN TX Message object has BRS enabled

CAN_TX_MSG_REQUEST_FIFO_FULL 

Transmit FIFO is Full

Definition at line 123 of file can_types.h.

Function Documentation

◆ CAN1_BitRateConfiguration()

static void CAN1_BitRateConfiguration ( void )
static

Configure the CAN1 bit rate settings

Definition at line 513 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_BusErrorCallback()

void CAN1_BusErrorCallback ( void )
Parameters
none
Returns
none

Definition at line 973 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_BusErrorCallbackRegister()

void CAN1_BusErrorCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 965 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_BusWakeUpActivityCallback()

void CAN1_BusWakeUpActivityCallback ( void )
Parameters
none
Returns
none

Definition at line 960 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_BusWakeUpActivityCallbackRegister()

void CAN1_BusWakeUpActivityCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 952 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_Deinitialize()

void CAN1_Deinitialize ( void )
Parameters
none
Returns
none

Definition at line 590 of file can1.c.

+ Here is the call graph for this function:

◆ CAN1_DlcToDataBytesGet()

static uint8_t CAN1_DlcToDataBytesGet ( const enum CAN_DLC dlc)
static

Get the DLC enum based decimal value

Definition at line 166 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_ErrorNotificationEnable()

static void CAN1_ErrorNotificationEnable ( void )
static

Enable the CAN1 Error Notification interrupt

Definition at line 534 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_FIFO_InfoGet()

static void CAN1_FIFO_InfoGet ( const uint8_t fifoNum,
volatile struct CAN1_FIFO_INFO * fifoInfo )
static

Get the FIFO user address, message depth and payload size information

Definition at line 179 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_Initialize()

void CAN1_Initialize ( void )
Parameters
none
Returns
none

Definition at line 547 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_InvalidMessageCallback()

void CAN1_InvalidMessageCallback ( void )
Parameters
none
Returns
none

Definition at line 947 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_InvalidMessageCallbackRegister()

void CAN1_InvalidMessageCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 939 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_IsBusOff()

bool CAN1_IsBusOff ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node in Bus Off state
false - CAN node not in Bus Off state

Definition at line 880 of file can1.c.

◆ CAN1_IsRxErrorActive()

bool CAN1_IsRxErrorActive ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error active state
false - CAN node not Error active state

Definition at line 895 of file can1.c.

◆ CAN1_IsRxErrorPassive()

bool CAN1_IsRxErrorPassive ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error Passive state
false - CAN node not Error Passive state

Definition at line 885 of file can1.c.

◆ CAN1_IsRxErrorWarning()

bool CAN1_IsRxErrorWarning ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error warning state
false - CAN node not Error warning state

Definition at line 890 of file can1.c.

◆ CAN1_IsTxErrorActive()

bool CAN1_IsTxErrorActive ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error active state
false - CAN node not Error active state

Definition at line 916 of file can1.c.

◆ CAN1_IsTxErrorPassive()

bool CAN1_IsTxErrorPassive ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error Passive state
false - CAN node not Error Passive state

Definition at line 906 of file can1.c.

◆ CAN1_IsTxErrorWarning()

bool CAN1_IsTxErrorWarning ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
true - CAN node Error warning state
false - CAN node not Error warning state

Definition at line 911 of file can1.c.

◆ CAN1_MessageReadFromFifo()

static void CAN1_MessageReadFromFifo ( uint16_t * rxFifoObj,
struct CAN_MSG_OBJ * rxCanMsg )
static

Read the message object from receive FIFO and update to the user message object pointer.

Definition at line 329 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_MessageWriteToFifo()

static void CAN1_MessageWriteToFifo ( uint16_t * txFifoObj,
struct CAN_MSG_OBJ * txCanMsg )
static

Read the message object from user input and update to the CAN1 TX FIFO

Definition at line 395 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_ModeChangeCallback()

void CAN1_ModeChangeCallback ( void )
Parameters
none
Returns
none

Definition at line 986 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_ModeChangeCallbackRegister()

void CAN1_ModeChangeCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 978 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_OperationModeGet()

enum CAN_OP_MODES CAN1_OperationModeGet ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
Return the present CAN1 operation mode

Definition at line 656 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_OperationModeSet()

enum CAN_OP_MODE_STATUS CAN1_OperationModeSet ( const enum CAN_OP_MODES requestMode)
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
[in]requestMode- CAN1 operation modes
Returns
CAN1 Operation mode request to set.

Definition at line 629 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_Receive()

bool CAN1_Receive ( struct CAN_MSG_OBJ * rxCanMsg)
Precondition
CAN1_Initialize() function should be called before calling this function. The CAN1_ReceivedMessageCountGet() function should be checked to see if any CAN message is received.
Parameters
[out]rxCanMsg- pointer to the message object
Returns
true - CAN message read success
false - CAN message read fail

Definition at line 661 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_ReceivedMessageCountGet()

uint8_t CAN1_ReceivedMessageCountGet ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
Number of messages received.

Definition at line 812 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_ReceiveMessageGet()

bool CAN1_ReceiveMessageGet ( const enum CAN1_RX_FIFO_CHANNELS fifoChannel,
struct CAN_MSG_OBJ * rxCanMsg )
Precondition
CAN1_Initialize() function should be called before calling this function. The CAN1_ReceivedMessageCountGet() function should be checked to see if the receiver is not empty before calling this function.
Parameters
[out]rxCanMsg- pointer to the message object
Returns
true - CAN message read success
false - CAN message read fail

Definition at line 707 of file can1.c.

+ Here is the call graph for this function:

◆ CAN1_RX_FIFO_Configuration()

static void CAN1_RX_FIFO_Configuration ( void )
static

Configure the CAN1 receive FIFO settings

Definition at line 476 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_FilterMaskConfiguration()

static void CAN1_RX_FIFO_FilterMaskConfiguration ( void )
static

Configure the CAN1 filter and mask settings

Definition at line 489 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_IncrementMsgPtr()

static void CAN1_RX_FIFO_IncrementMsgPtr ( const uint8_t fifoNum)
static

Update the receive FIFO message increment tail position

Definition at line 267 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_MessageIndexGet()

static uint16_t CAN1_RX_FIFO_MessageIndexGet ( const enum CAN1_RX_FIFO_CHANNELS fifoNum)
static

Get the Receiver FIFO message index value

Definition at line 285 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_OverflowStatusFlagClear()

static void CAN1_RX_FIFO_OverflowStatusFlagClear ( const enum CAN1_RX_FIFO_CHANNELS fifoNum)
static

Clear the CAN1 receive FIFO overflow status bit

Definition at line 249 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_ResetInfo()

static void CAN1_RX_FIFO_ResetInfo ( void )
static

Reset the CAN1 receive message head count

Definition at line 208 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RX_FIFO_StatusGet()

uint8_t CAN1_RX_FIFO_StatusGet ( const enum CAN1_RX_FIFO_CHANNELS fifoNum)
Precondition
CAN1_Initialize() function should be called before calling this function
Parameters
[in]fifoNum- FIFO channel of which status is required
Returns
Combined status of the FIFO
Note
Use CAN_RX_FIFO_STATUS to mask individual status.

Definition at line 862 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RxBufferOverFlowCallback()

void CAN1_RxBufferOverFlowCallback ( void )
Parameters
none
Returns
none

Definition at line 1025 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RxBufferOverFlowCallbackRegister()

void CAN1_RxBufferOverFlowCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 1017 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_RxFifoSearch()

static uint8_t CAN1_RxFifoSearch ( uint8_t fifoNum)
static

Search the CAN1 receive FIFO channel index

Definition at line 223 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_Sleep()

void CAN1_Sleep ( void )
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
none
Returns
none

Definition at line 927 of file can1.c.

+ Here is the call graph for this function:

◆ CAN1_SystemErrorCallback()

void CAN1_SystemErrorCallback ( void )
Parameters
none
Returns
none

Definition at line 999 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_SystemErrorCallbackRegister()

void CAN1_SystemErrorCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 991 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_Tasks()

void CAN1_Tasks ( void )
Precondition
CAN1_Initialize() function should have been called before calling this function.
Parameters
none
Returns
none

Definition at line 1046 of file can1.c.

◆ CAN1_Transmit()

enum CAN_TX_MSG_REQUEST_STATUS CAN1_Transmit ( const enum CAN1_TX_FIFO_CHANNELS fifoChannel,
struct CAN_MSG_OBJ * txCanMsg )
Precondition
CAN1_Initialize() function should be called before calling this function. CAN1_TransmitFIFOStatusGet function should be called to check buffer availability in the Transmit FIFO.
Parameters
[in]fifoChannel- FIFO channel where the message object to be written
[in]txCanMsg- pointer to the message object
Returns
Returns the transmit status of type CAN_TX_MSG_REQUEST_STATUS

Definition at line 746 of file can1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CAN1_TransmitFIFOStatusGet()

enum CAN_TX_FIFO_STATUS CAN1_TransmitFIFOStatusGet ( const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
Precondition
CAN1_Initialize() function should be called before calling this function.
Parameters
[in]fifoChannel- CAN1 TX priority FIFO selection
Returns
Returns the transmit status of type CAN_TX_FIFO_STATUS

Definition at line 794 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_TX_FIFO_Configuration()

static void CAN1_TX_FIFO_Configuration ( void )
static

Configure the CAN1 transmit FIFO settings

Definition at line 462 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_TX_FIFO_MessageSendRequest()

static void CAN1_TX_FIFO_MessageSendRequest ( const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
static

Enable the transmit FIFO message send request bit

Definition at line 308 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_TxAttemptCallback()

void CAN1_TxAttemptCallback ( void )
Parameters
none
Returns
none

Definition at line 1012 of file can1.c.

+ Here is the caller graph for this function:

◆ CAN1_TxAttemptCallbackRegister()

void CAN1_TxAttemptCallbackRegister ( void(*)(void) handler)
Parameters
[in]handler- Address of the callback routine
Returns
none

Definition at line 1004 of file can1.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ CAN_FD1

const struct CAN_INTERFACE CAN_FD1
extern

Definition at line 84 of file can1.c.