XMC Peripheral Library for XMC4000 Family: CAN

XMC Peripheral Library for XMC4000 Family

XMC Peripheral Library for XMC4000 Family  2.1.16

Data Structures

struct  XMC_CAN_FIFO_CONFIG_t
 
struct  XMC_CAN_GATEWAY_CONFIG_t
 
struct  XMC_CAN_MO_t
 
struct  XMC_CAN_NODE_FRAME_COUNTER_t
 
struct  XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t
 

Macros

#define CAN_MO_MOIPR_Msk   (0x7U)
 
#define CAN_NODE_NIPR_Msk   (0x7UL)
 
#define XMC_CAN_MO_MOAR_STDID_Msk   ((0x000007FFUL) << XMC_CAN_MO_MOAR_STDID_Pos)
 
#define XMC_CAN_MO_MOAR_STDID_Pos   (18U)
 

Typedefs

typedef CAN_NODE_TypeDef XMC_CAN_NODE_t
 
typedef CAN_GLOBAL_TypeDef XMC_CAN_t
 

Enumerations

Functions

void XMC_CAN_AllocateMOtoNodeList (XMC_CAN_t *const obj, const uint8_t node_num, const uint8_t mo_num)
 
void XMC_CAN_Disable (XMC_CAN_t *const obj)
 
void XMC_CAN_Enable (XMC_CAN_t *const obj)
 
void XMC_CAN_EventTrigger (XMC_CAN_t *const obj, const XMC_CAN_NODE_INTERRUPT_TRIGGER_t service_requestr)
 
void XMC_CAN_FIFO_DisableForeingRemoteRequest (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_DisableRemoteMonitoring (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_DisableSingleDataTransfer (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_EnableForeignRemoteRequest (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_EnableRemoteMonitoring (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_EnableSingleDataTransfer (const XMC_CAN_MO_t *const can_mo)
 
uint8_t XMC_CAN_FIFO_GetCurrentMO (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_FIFO_SetSELMO (const XMC_CAN_MO_t *const can_mo, const uint8_t select_pointer)
 
void XMC_CAN_GATEWAY_InitDesObject (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_GATEWAY_InitSourceObject (const XMC_CAN_MO_t *const can_mo, const XMC_CAN_GATEWAY_CONFIG_t can_gateway)
 
void XMC_CAN_Init (XMC_CAN_t *const obj, uint32_t can_frequency)
 
bool XMC_CAN_IsPanelControlReady (XMC_CAN_t *const obj)
 
void XMC_CAN_MO_AcceptOnlyMatchingIDE (XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_AcceptStandardAndExtendedID (XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_Config (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_DataLengthCode (const XMC_CAN_MO_t *const can_mo, const uint8_t data_length_code)
 
void XMC_CAN_MO_DisableEvent (const XMC_CAN_MO_t *const can_mo, const uint32_t event)
 
void XMC_CAN_MO_DisableSingleTransmitTrial (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_EnableEvent (const XMC_CAN_MO_t *const can_mo, const uint32_t event)
 
void XMC_CAN_MO_EnableSingleTransmitTrial (const XMC_CAN_MO_t *const can_mo)
 
uint32_t XMC_CAN_MO_GetAcceptanceMask (const XMC_CAN_MO_t *const can_mo)
 
uint8_t XMC_CAN_MO_GetDataLengthCode (const XMC_CAN_MO_t *const can_mo)
 
uint32_t XMC_CAN_MO_GetIdentifier (const XMC_CAN_MO_t *const can_mo)
 
uint32_t XMC_CAN_MO_GetStatus (const XMC_CAN_MO_t *const can_mo)
 
XMC_CAN_STATUS_t XMC_CAN_MO_Receive (XMC_CAN_MO_t *can_mo)
 
XMC_CAN_STATUS_t XMC_CAN_MO_ReceiveData (XMC_CAN_MO_t *can_mo)
 
void XMC_CAN_MO_ResetStatus (const XMC_CAN_MO_t *const can_mo, const uint32_t mask)
 
void XMC_CAN_MO_SetAcceptanceMask (XMC_CAN_MO_t *const can_mo, const uint32_t can_id_mask)
 
void XMC_CAN_MO_SetDataLengthCode (XMC_CAN_MO_t *const can_mo, const uint8_t data_length_code)
 
void XMC_CAN_MO_SetEventNodePointer (const XMC_CAN_MO_t *const can_mo, const XMC_CAN_MO_POINTER_EVENT_t can_mo_ptr_int, const uint32_t service_request)
 
void XMC_CAN_MO_SetExtendedID (XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_SetIdentifier (XMC_CAN_MO_t *const can_mo, const uint32_t can_identifier)
 
void XMC_CAN_MO_SetStandardID (XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_MO_SetStatus (const XMC_CAN_MO_t *const can_mo, const uint32_t mask)
 
XMC_CAN_STATUS_t XMC_CAN_MO_Transmit (const XMC_CAN_MO_t *const can_mo)
 
XMC_CAN_STATUS_t XMC_CAN_MO_UpdateData (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_NODE_ClearStatus (XMC_CAN_NODE_t *const can_node, XMC_CAN_NODE_STATUS_t can_node_status)
 
void XMC_CAN_NODE_Disable (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_DisableConfigurationChange (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_DisableEvent (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_EVENT_t event)
 
void XMC_CAN_NODE_DisableLoopBack (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_Enable (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_EnableConfigurationChange (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_EnableEvent (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_EVENT_t event)
 
void XMC_CAN_NODE_EnableLoopBack (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_EnableSuspend (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_FrameCounterConfigure (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_FRAME_COUNTER_t *const can_node_init)
 
uint16_t XMC_CAN_NODE_GetCANFrameCounter (XMC_CAN_NODE_t *const can_node)
 
uint8_t XMC_CAN_NODE_GetErrorWarningLevel (XMC_CAN_NODE_t *const can_node)
 
XMC_CAN_NODE_LAST_ERROR_DIR_t XMC_CAN_NODE_GetLastErrTransferDir (XMC_CAN_NODE_t *const node)
 
XMC_CAN_NODE_LAST_ERROR_INC_t XMC_CAN_NODE_GetLastErrTransferInc (XMC_CAN_NODE_t *const node)
 
uint8_t XMC_CAN_NODE_GetReceiveErrorCounter (XMC_CAN_NODE_t *const can_node)
 
uint32_t XMC_CAN_NODE_GetStatus (XMC_CAN_NODE_t *const can_node)
 
uint8_t XMC_CAN_NODE_GetTransmitErrorCounter (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_NominalBitTimeConfigure (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t *const can_bit_time)
 
void XMC_CAN_NODE_ReSetAnalyzerMode (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_ResetInitBit (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_SetAnalyzerMode (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_SetErrorWarningLevel (XMC_CAN_NODE_t *const can_node, uint8_t error_warning_level)
 
void XMC_CAN_NODE_SetEventNodePointer (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_POINTER_EVENT_t ptr_event, const uint32_t service_request)
 
void XMC_CAN_NODE_SetInitBit (XMC_CAN_NODE_t *const can_node)
 
void XMC_CAN_NODE_SetReceiveErrorCounter (XMC_CAN_NODE_t *const can_node, uint8_t can_rec)
 
void XMC_CAN_NODE_SetReceiveInput (XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_RECEIVE_INPUT_t input)
 
void XMC_CAN_NODE_SetTransmitErrorCounter (XMC_CAN_NODE_t *const can_node, uint8_t can_tec)
 
void XMC_CAN_PanelControl (XMC_CAN_t *const obj, const XMC_CAN_PANCMD_t pancmd, const uint8_t arg1, const uint8_t arg2)
 
void XMC_CAN_RXFIFO_ConfigMOBaseObject (const XMC_CAN_MO_t *const can_mo, const XMC_CAN_FIFO_CONFIG_t can_fifo)
 
void XMC_CAN_RXFIFO_ConfigMOSlaveObject (const XMC_CAN_MO_t *const can_mo)
 
void XMC_CAN_TXFIFO_ConfigMOBaseObject (const XMC_CAN_MO_t *const can_mo, const XMC_CAN_FIFO_CONFIG_t can_fifo)
 
void XMC_CAN_TXFIFO_ConfigMOSlaveObject (const XMC_CAN_MO_t *const can_mo, const XMC_CAN_FIFO_CONFIG_t can_fifo)
 
XMC_CAN_STATUS_t XMC_CAN_TXFIFO_Transmit (const XMC_CAN_MO_t *const can_mo)
 

Detailed Description

CAN driver provides transfer of CAN frames in accordance with CAN specificetion V2.0 B (active). Each CAN node can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. All CAN nodes share a common set of message objects. Each message object can be individually allocated to one of the CAN nodes. Besides serving as a storage container for incoming and outgoing frames, message objects can be combined to build gateways between the CAN nodes or to setup a FIFO buffer. The CAN module provides Analyzer mode,Loop-back mode and bit timming for node analysis.

The driver is divided into five sections:

CAN Global features:
  1. Allows to configure module frequency using function XMC_CAN_Init().
  2. Allows to configure Module interrupt using configuration structure XMC_CAN_NODE_INTERRUPT_TRIGGER_t and function XMC_CAN_EventTrigger().
CAN_NODE features:
  1. Allows to set baud rate by configuration structure XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t and Baudrate Configuration function XMC_CAN_NODE_NominalBitTimeConfigure().
  2. Allows to configure loop-back mode using fuction XMC_CAN_NODE_EnableLoopBack().
  3. Allows to configure CAN Node analyzer using function XMC_CAN_NODE_SetAnalyzerMode().
  4. Allows CAN node events enable/ disable by enum structure XMC_CAN_NODE_EVENT_t and functions XMC_CAN_NODE_EnableEvent() and XMC_CAN_NODE_DisableEvent().
  5. Provides bit timming analysis, configuration structure XMC_CAN_NODE_FRAME_COUNTER_t and function XMC_CAN_NODE_FrameCounterConfigure().
CAN_MO features:
  1. Allows message object initialization by configuration structure XMC_CAN_MO_t and function XMC_CAN_MO_Config().
  2. Allows transfer of message objects using functions XMC_CAN_MO_Transmit() and XMC_CAN_MO_Receive().
  3. Allows to configure Single Data Transfer and Single Transmit Trial using functions XMC_CAN_MO_EnableSingleTransmitTrial() and XMC_CAN_MO_EnableSingleTransmitTrial().
  4. Allows to configure MO events using function XMC_CAN_MO_EnableEvent().
CAN_FIFO features:
  1. Allows message object FIFO structure by configuration structure XMC_CAN_FIFO_CONFIG_t and functions XMC_CAN_TXFIFO_ConfigMOBaseObject() , XMC_CAN_RXFIFO_ConfigMOBaseObject() and XMC_CAN_TXFIFO_Transmit().
CAN_GATEWAY features:
  1. Provides Gateway mode, configuration structure XMC_CAN_GATEWAY_CONFIG_t and function XMC_CAN_GATEWAY_InitSourceObject().

Macro Definition Documentation

#define CAN_MO_MOIPR_Msk   (0x7U)

Message Object event mask

#define CAN_NODE_NIPR_Msk   (0x7UL)

Node event mask

#define XMC_CAN_MO_MOAR_STDID_Msk   ((0x000007FFUL) << XMC_CAN_MO_MOAR_STDID_Pos)

Standard Identifier bitMask

#define XMC_CAN_MO_MOAR_STDID_Pos   (18U)

Standard Identifier bitposition

Typedef Documentation

typedef CAN_NODE_TypeDef XMC_CAN_NODE_t

Defines Node Runtime structure.pointer to the Node CAN register

typedef CAN_GLOBAL_TypeDef XMC_CAN_t

Defines CAN Global Initialization structure

Enumeration Type Documentation

Defines arbitration mode for transmit acceptance filtering. Use type XMC_CAN_ARBITRATION_MODE_t for this enum.

Enumerator
XMC_CAN_ARBITRATION_MODE_ORDER_BASED_PRIO_1 

Transmit acceptance based in the order(prio)

XMC_CAN_ARBITRATION_MODE_IDE_DIR_BASED_PRIO_2 

Transmit acceptance filtering is based on the CAN identifier

XMC_CAN_ARBITRATION_MODE_ORDER_BASED_PRIO_3 

Transmit acceptance based in the order

Defines the Clock source used for the MCAN peripheral.

Note
Only available for XMC1400, XMC4800 and XMC4700 series

Defines the Divider Modes. Use type XMC_CAN_DM_t for this enum.

Enumerator
XMC_CAN_DM_NORMAL 

Normal divider mode

XMC_CAN_DM_FRACTIONAL 

Fractional divider mode

XMC_CAN_DM_OFF 

Divider Mode in off-state

Defines the operation mode of the frame counter. Use type XMC_CAN_FRAME_COUNT_MODE_t for this enum.

Enumerator
XMC_CAN_FRAME_COUNT_MODE 

Frame Count Mode

XMC_CAN_FRAME_COUNT_MODE_TIME_STAMP 

The frame counter is incremented with the beginning of a new bit time

XMC_CAN_FRAME_COUNT_MODE_BIT_TIMING 

Used for baud rate detection and analysis of the bit timing

Defines Data frame types. Use type XMC_CAN_FRAME_TYPE_t for this enum.

Enumerator
XMC_CAN_FRAME_TYPE_STANDARD_11BITS 

Standard type identifier

XMC_CAN_FRAME_TYPE_EXTENDED_29BITS 

Extended type identifier

Defines loop Back Mode, to enable/disable an in-system test of the MultiCAN module . Use type XMC_CAN_LOOKBACKMODE_t for this enum.

Enumerator
XMC_CAN_LOOKBACKMODE_ENABLED 

Each CAN node can be connected to the internal CAN bus

XMC_CAN_LOOKBACKMODE_DISABLED 

Each CAN node can be connected to the external CAN bus

Defines mask value for CAN Message Object event type. Use type XMC_CAN_MO_EVENT_t for this enum.

Enumerator
XMC_CAN_MO_EVENT_TRANSMIT 

Message Object transmit event

XMC_CAN_MO_EVENT_RECEIVE 

Message Object receive event

XMC_CAN_MO_EVENT_OVERFLOW 

Message Object overflow event

Defines CAN Message Object event node pointer position. Use type XMC_CAN_MO_POINTER_EVENT_t for this enum.

Enumerator
XMC_CAN_MO_POINTER_EVENT_TRANSMIT 

Transmit Event node pointer

XMC_CAN_MO_POINTER_EVENT_RECEIVE 

Receive Event node pointer

Defines mask value for CAN Message Object reset status. Use type XMC_CAN_MO_RESET_STATUS_t for this enum.

Enumerator
XMC_CAN_MO_RESET_STATUS_RX_PENDING 

Reset receive pending

XMC_CAN_MO_RESET_STATUS_TX_PENDING 

Reset transmit pending

XMC_CAN_MO_RESET_STATUS_RX_UPDATING 

Reset receive updating

XMC_CAN_MO_RESET_STATUS_NEW_DATA 

Reset new data

XMC_CAN_MO_RESET_STATUS_MESSAGE_LOST 

Reset message lost

XMC_CAN_MO_RESET_STATUS_MESSAGE_VALID 

Reset message valid

XMC_CAN_MO_RESET_STATUS_RX_TX_SELECTED 

Reset transmit/receive selected

XMC_CAN_MO_RESET_STATUS_RX_ENABLE 

Reset receive enable

XMC_CAN_MO_RESET_STATUS_TX_REQUEST 

Reset transmit request

XMC_CAN_MO_RESET_STATUS_TX_ENABLE0 

Reset transmit enable 0

XMC_CAN_MO_RESET_STATUS_TX_ENABLE1 

Reset transmit enable 1

XMC_CAN_MO_RESET_STATUS_MESSAGE_DIRECTION 

Reset message direction

Defines mask value for CAN Message Object set status. Use type XMC_CAN_MO_SET_STATUS_t for this enum.

Enumerator
XMC_CAN_MO_SET_STATUS_RX_PENDING 

Set receive pending

XMC_CAN_MO_SET_STATUS_TX_PENDING 

Set transmit pending

XMC_CAN_MO_SET_STATUS_RX_UPDATING 

Set receive updating

XMC_CAN_MO_SET_STATUS_NEW_DATA 

Set new data

XMC_CAN_MO_SET_STATUS_MESSAGE_LOST 

Set message lost

XMC_CAN_MO_SET_STATUS_MESSAGE_VALID 

Set message valid

XMC_CAN_MO_SET_STATUS_RX_TX_SELECTED 

Set transmit/receive selected

XMC_CAN_MO_SET_STATUS_RX_ENABLE 

Set receive enable

XMC_CAN_MO_SET_STATUS_TX_REQUEST 

Set transmit request

XMC_CAN_MO_SET_STATUS_TX_ENABLE0 

Set transmit enable 0

XMC_CAN_MO_SET_STATUS_TX_ENABLE1 

Set transmit enable 1

XMC_CAN_MO_SET_STATUS_MESSAGE_DIRECTION 

Set message direction

Defines mask value for CAN Message Object status. Use type XMC_CAN_MO_STATUS_t for this enum.

Enumerator
XMC_CAN_MO_STATUS_RX_PENDING 

Defines message has been successfully received or not received

XMC_CAN_MO_STATUS_TX_PENDING 

Defines message has been successfully transmitted or not transmitted

XMC_CAN_MO_STATUS_RX_UPDATING 

Defines Message identifier, DLC, and data of the message object are currently updated or not updated

XMC_CAN_MO_STATUS_NEW_DATA 

Defines no update of the message object since last flag reset or Message object has been updated

XMC_CAN_MO_STATUS_MESSAGE_LOST 

CAN message is lost because NEWDAT has become set again when it has already been set or No CAN message is lost

XMC_CAN_MO_STATUS_MESSAGE_VALID 

Message valid

XMC_CAN_MO_STATUS_RX_TX_SELECTED 

Transmit/Receive selected

XMC_CAN_MO_STATUS_RX_ENABLE 

Receive enable

XMC_CAN_MO_STATUS_TX_REQUEST 

Transmit request

XMC_CAN_MO_STATUS_TX_ENABLE0 

Transmit enable 0

XMC_CAN_MO_STATUS_TX_ENABLE1 

Transmit enable 1

XMC_CAN_MO_STATUS_MESSAGE_DIRECTION 

Message direction

XMC_CAN_MO_STATUS_LIST 

List allocation

XMC_CAN_MO_STATUS_POINTER_TO_PREVIOUS_MO 

Pointer to previous Message Object

XMC_CAN_MO_STATUS_POINTER_TO_NEXT_MO 

Pointer to next Message Object

Defines Message Object direction. Use type XMC_CAN_MO_TYPE_t for this enum.

Enumerator
XMC_CAN_MO_TYPE_RECMSGOBJ 

Receive Message Object selected

XMC_CAN_MO_TYPE_TRANSMSGOBJ 

Transmit Message Object selected

Defines mask value for CAN Node control like initialization, node disable and analyzer mode . Use type XMC_CAN_NODE_CONTROL_t for this enum.

Enumerator
XMC_CAN_NODE_CONTROL_NODE_INIT 

Node initialization

XMC_CAN_NODE_CONTROL_TX_INT_ENABLE 

Transfer event enable

XMC_CAN_NODE_CONTROL_LEC_INT_ENABLE 

LEC Indicated Error Event Enable

XMC_CAN_NODE_CONTROL_ALERT_INT_ENABLE 

Alert Event Enable

XMC_CAN_NODE_CONTROL_CAN_DISABLE 

CAN disable

XMC_CAN_NODE_CONTROL_CONF_CHANGE_ENABLE 

Configuration change enable

XMC_CAN_NODE_CONTROL_CAN_ANALYZER_NODEDE 

CAN Analyzer mode

XMC_CAN_NODE_CONTROL_SUSPENDED_ENABLE 

Suspend Enable

Defines mask value for CAN Node events. Use type XMC_CAN_NODE_EVENT_t for this enum.

Enumerator
XMC_CAN_NODE_EVENT_TX_INT 

Node Transfer OK Event

XMC_CAN_NODE_EVENT_ALERT 

Node Alert Event

XMC_CAN_NODE_EVENT_LEC 

Last Error code Event

XMC_CAN_NODE_EVENT_CFCIE 

CAN Frame Count Event

Defines interrupt request on interrupt output line INT_O[n]. Use type XMC_CAN_NODE_INTERRUPT_TRIGGER_t for this enum.

Defines last error transfer direction. Use type XMC_CAN_NODE_LAST_ERROR_DIR_t for this enum.

Enumerator
XMC_CAN_NODE_LAST_ERROR_DIR_WHILE_NODE_RECEPCION 

The last error occurred while the CAN node x was receiver

XMC_CAN_NODE_LAST_ERROR_DIR_WHILE_NODE_TRANSMISSION 

The last error occurred while the CAN node x was transmitter

Defines last error increment. Use type XMC_CAN_NODE_LAST_ERROR_INC_t for this enum.

Enumerator
XMC_CAN_NODE_LAST_ERROR_INC_1 

The last error led to an error counter increment of 1.

XMC_CAN_NODE_LAST_ERROR_INC_8 

The last error led to an error counter increment of 8.

Defines mask value for CAN node pointer events position. Use type XMC_CAN_NODE_POINTER_EVENT_t for this enum.

Enumerator
XMC_CAN_NODE_POINTER_EVENT_ALERT 

Node Alert Event node pointer

XMC_CAN_NODE_POINTER_EVENT_LEC 

Last Error code Event node pointer

XMC_CAN_NODE_POINTER_EVENT_TRANSFER_OK 

Transmit Event node pointer

XMC_CAN_NODE_POINTER_EVENT_FRAME_COUNTER 

CAN Frame Count Event node pointer

Defines the possible receive inputs. Use type XMC_CAN_NODE_RECEIVE_INPUT_t for this enum.

Enumerator
XMC_CAN_NODE_RECEIVE_INPUT_RXDCA 

CAN Receive Input A

XMC_CAN_NODE_RECEIVE_INPUT_RXDCB 

CAN Receive Input B

XMC_CAN_NODE_RECEIVE_INPUT_RXDCC 

CAN Receive Input C

XMC_CAN_NODE_RECEIVE_INPUT_RXDCD 

CAN Receive Input D

XMC_CAN_NODE_RECEIVE_INPUT_RXDCE 

CAN Receive Input E

XMC_CAN_NODE_RECEIVE_INPUT_RXDCF 

CAN Receive Input F

XMC_CAN_NODE_RECEIVE_INPUT_RXDCG 

CAN Receive Input G

XMC_CAN_NODE_RECEIVE_INPUT_RXDCH 

CAN Receive Input H

Defines mask value for CAN Node status. Use type XMC_CAN_NODE_STATUS_t for this enum.

Enumerator
XMC_CAN_NODE_STATUS_LAST_ERROR_CODE 

Last Error Code

XMC_CAN_NODE_STATUS_TX_OK 

Message transmitted successfully

XMC_CAN_NODE_STATUS_RX_OK 

Message received successfully

XMC_CAN_NODE_STATUS_ALERT_WARNING 

Alert warning

XMC_CAN_NODE_STATUS_ERROR_WARNING_STATUS 

Error warning status

XMC_CAN_NODE_STATUS_BUS_OFF 

Bus-off status

XMC_CAN_NODE_STATUS_LIST_LENGTH_ERROR 

List length error

XMC_CAN_NODE_STATUS_LIST_OBJECT_ERROR 

List object error

XMC_CAN_NODE_STATUS_SUSPENDED_ACK 

Suspend Acknowledge

Defines CAN module Panel Commands . Use type XMC_CAN_PANCMD_t for this enum.

Enumerator
XMC_CAN_PANCMD_INIT_LIST 

Command to initialize a list

XMC_CAN_PANCMD_STATIC_ALLOCATE 

Command to activate static allocation

XMC_CAN_PANCMD_DYNAMIC_ALLOCATE 

Command to activate dynamic allocation

XMC_CAN_PANCMD_STATIC_INSERT_BEFORE 

Remove a message object from the list and insert it before a given object.

XMC_CAN_PANCMD_DYNAMIC_INSERT_BEFORE 

Command to activate dynamic allocation

XMC_CAN_PANCMD_STATIC_INSERT_BEHIND 

Command to activate dynamic allocation

XMC_CAN_PANCMD_DYNAMIC_INSERT_BEHIND 

Command to activate dynamic allocation

Defines the status of CAN, to verify the CAN related API calls. Use type XMC_CAN_STATUS_t for this enum.

Enumerator
XMC_CAN_STATUS_SUCCESS 

Driver accepted application request

XMC_CAN_STATUS_ERROR 

Returned when unknown error occurred

XMC_CAN_STATUS_BUSY 

Driver is busy and can not handle request

XMC_CAN_STATUS_MO_NOT_ACCEPTABLE 

Message object type not allowed

XMC_CAN_STATUS_MO_DISABLED 

Returned if Message object is disabled

Function Documentation

void XMC_CAN_AllocateMOtoNodeList ( XMC_CAN_t *const  obj,
const uint8_t  node_num,
const uint8_t  mo_num 
)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
node_numCAN node number,Range : 0-2
mo_numCAN Message Object number,Range : 0-63
Returns
None
Description:
Allocates Message Object from free list to node list. Each node_num is linked to one unique list of message objects. A CAN node performs message transfer only with the mo_num message objects that are allocated to the list of the CAN node. It configures PANCTR register.
Related APIs:
None
void XMC_CAN_Disable ( XMC_CAN_t *const  obj)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
Returns
None
Description:
Disables CAN module. In disabled state, no registers of CAN module can be read or written except the CAN_CLC register.
Related APIs:
XMC_CAN_Enable()

void XMC_CAN_Enable ( XMC_CAN_t *const  obj)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
Returns
None
Description:
Enables CAN module and initializes all CAN registers to reset values. It is required to re-configure desired CAN nodes, before any data transfer. It configures CAN_CLC.DISR bit.
Related APIs:
XMC_CAN_Disable()


void XMC_CAN_EventTrigger ( XMC_CAN_t *const  obj,
const XMC_CAN_NODE_INTERRUPT_TRIGGER_t  service_requestr 
)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
service_requestrInterrupt trigger number selection. Refer XMC_CAN_NODE_INTERRUPT_TRIGGER_t for valid values. Multiple interrupt trigger events can be ORed.
Returns
None
Description:
Configures multiple interrupt requests with a single write operation. service_requestr represents single interrupt request or multiple.It configures MITR register.
Related APIs:
None
void XMC_CAN_FIFO_DisableForeingRemoteRequest ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to disable the FIFO Foreign Remote Request. TXRQ of message object n is set on reception of a matching Remote Frame. It configures MOFCR.FRREN register.
Related API's:
XMC_CAN_FIFO_EnableForeignRemoteRequest()


void XMC_CAN_FIFO_DisableRemoteMonitoring ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to disable the FIFO Remote Monitoring. This Specifies Identifier, Identifier Extension bit, and DLC of message object n remain unchanged upon the reception of a matching Remote Frame. It configures MOFCR.RMM bit.
Related API's:
XMC_CAN_FIFO_EnableRemoteMonitoring()


Note:
Remote monitoring(RMM) applies only to transmit objects and has no effect on receive objects.
void XMC_CAN_FIFO_DisableSingleDataTransfer ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to disable the Single Data Transfer of the FIFO Message Object, with this configuration bit MSGVAL is not affected. It configures MOFCR.SDT bit.
Related API's:
XMC_CAN_FIFO_EnableSingleDataTransfer()
void XMC_CAN_FIFO_EnableForeignRemoteRequest ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to enable the FIFO Foreign Remote Request. This Specifies TXRQ of the message object referenced by the pointer CUR is set on reception of a matching Remote Frame. It configures MOFCR.FRREN register.
Related API's:
XMC_CAN_FIFO_DisableForeingRemoteRequest()


void XMC_CAN_FIFO_EnableRemoteMonitoring ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to enable the FIFO Remote Monitoring. This Specifies identifier, IDE(Identifier Extension) bit, and DLC of a matching Remote Frame are copied to transmit object n in order to monitor incoming Remote Frames. It configures MOFCR.RMM bit.
Related API's:
XMC_CAN_FIFO_DisableRemoteMonitoring()


Note:
Remote monitoring(RMM) applies only to transmit objects and has no effect on receive objects.
void XMC_CAN_FIFO_EnableSingleDataTransfer ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configuration allows to enable the Single Data Transfer of the FIFO Message Object. If SDT = 1 and message object n is not a FIFO base object, then MSGVAL is reset when this object has taken part in a successful data transfer (receive or transmit). If SDT = 1 and message object n is a FIFO base object, then MSGVAL is reset when the pointer to the current object CUR reaches the value of SEL in the FIFO/Gateway Pointer Register. It configures MOFCR.SDT bit.
Related API's:
XMC_CAN_FIFO_DisableSingleDataTransfer()
uint8_t XMC_CAN_FIFO_GetCurrentMO ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
uint8_t Current Message Object Number. Range:0-63
Description:
Returns the current FIFO Message Object,points to the actual target object within a FIFO/Gateway structure.
Related API's:
None
void XMC_CAN_FIFO_SetSELMO ( const XMC_CAN_MO_t *const  can_mo,
const uint8_t  select_pointer 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
select_pointerSelected Message Object number. Range:0-63
Returns
None
Description:
Set Object Select Pointer. If the current pointer CUR of FIFO base object becomes equal select_pointer, a FIFO overflow interrupt request is generated. Used for FIFO monitoring purpose.
Related API's:
None
void XMC_CAN_GATEWAY_InitDesObject ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configures the Gateway destination object. The Gateway Mode can_gateway makes it possible to establish an automatic information transfer between two independent CAN buses without CPU interaction. Please refer reference manual GatewayMode for more info.
Related API's:
None
void XMC_CAN_GATEWAY_InitSourceObject ( const XMC_CAN_MO_t *const  can_mo,
const XMC_CAN_GATEWAY_CONFIG_t  can_gateway 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_gatewayCAN gateway configuration data structure. Refer XMC_CAN_GATEWAY_CONFIG_t data structure for details.
Returns
None
Description:
Configures the Gateway source object. The Gateway Mode can_gateway makes it possible to establish an automatic information transfer between two independent CAN buses without CPU interaction. Please refer reference manual GatewayMode for more info.
Related API's:
None
void XMC_CAN_Init ( XMC_CAN_t *const  obj,
uint32_t  can_frequency 
)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
can_frequencyCAN module frequency(fCAN). Range : 5MHz to 120MHz
Returns
None
Description:
Configures clock rate of the module timer clock fCAN. Altering CAN module can_frequency shall affects baud rate, call XMC_CAN_NODE_NominalBitTimeConfigure() to configure baud rate for current CAN frequency.It configures FDR register.
Related APIs:
XMC_CAN_NODE_NominalBitTimeConfigure()


bool XMC_CAN_IsPanelControlReady ( XMC_CAN_t *const  obj)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
Returns
Ready status of list controller
Description:
Returns ready status of the list controller
Related APIs:
XMC_CAN_PanelControl()
void XMC_CAN_MO_AcceptOnlyMatchingIDE ( XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Message object receives frames only with matching IDE bit.
Related API's:
XMC_CAN_MO_AcceptStandardAndExtendedID()
void XMC_CAN_MO_AcceptStandardAndExtendedID ( XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Message object accepts the reception of both, standard and extended frames.
Related API's:
XMC_CAN_MO_AcceptOnlyMatchingIDE()
void XMC_CAN_MO_Config ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Initializes CAN message object. Initialization includes configuring Message Object identifier type, Message Object identifier value, Message Object type, and transfer requests. It configures FDR register.
Related APIs:
None
void XMC_CAN_MO_DataLengthCode ( const XMC_CAN_MO_t *const  can_mo,
const uint8_t  data_length_code 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
data_length_codetransfer data length. Range:0-8
Returns
None
Description:
Configures CAN Message Object Data Length Code. It configures MOFCR register.
Related API's:
None
void XMC_CAN_MO_DisableEvent ( const XMC_CAN_MO_t *const  can_mo,
const uint32_t  event 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
eventCAN node Message Object event selection. Refer XMC_CAN_MO_EVENT_t for details.
Returns
None
Description:
Disable CAN Message Object events. event can be ORed multiple Message Object events. It configures MOFCR register.
Related API's:
XMC_CAN_MO_EnableEvent()
void XMC_CAN_MO_DisableSingleTransmitTrial ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Disable the single transmit trial(STT). In STT,TXRQ is cleared on transmission start of message object n. Thus, no transmission retry is performed in case of transmission failure. It configures MOFCR.STT bit.
Related API's:
XMC_CAN_MO_EnableSingleTransmitTrial()
void XMC_CAN_MO_EnableEvent ( const XMC_CAN_MO_t *const  can_mo,
const uint32_t  event 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
eventCAN node Message Object event selection. Refer XMC_CAN_MO_EVENT_t for details.
Returns
None
Description:
Enable CAN Message Object events. event can be ORed multiple Message Object events. It configures MOFCR register.
Related API's:
XMC_CAN_MO_DisableEvent()
void XMC_CAN_MO_EnableSingleTransmitTrial ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Enable the single transmit trial(STT). In STT,TXRQ is cleared on transmission start of message object n. Thus, no transmission retry is performed in case of transmission failure. It configures MOFCR.STT bit.
Related API's:
XMC_CAN_MO_DisableSingleTransmitTrial()
uint32_t XMC_CAN_MO_GetAcceptanceMask ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
Acceptance mask
Description:
Gets the acceptance mask for the CAN MO.
Related API's:
XMC_CAN_MO_SetAcceptanceMask()
uint8_t XMC_CAN_MO_GetDataLengthCode ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
Data length code
Description:
Gets the Data Length Code.
Related API's:
XMC_CAN_MO_SetDataLengthCode()
uint32_t XMC_CAN_MO_GetIdentifier ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
CAN MO identifier
Description:
Gets the Identifier of the MO
Related API's:
XMC_CAN_MO_SetIdentifier()
uint32_t XMC_CAN_MO_GetStatus ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
uint32_t Current Message Object status.
Description:
Returns Message Object status, that indicates message object transfer status and message object list status information such as the number of the current message object predecessor and successor message object, as well as the list number to which the message object is assigned.
Related API's:
None
XMC_CAN_STATUS_t XMC_CAN_MO_Receive ( XMC_CAN_MO_t can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
XMC_CAN_STATUS_t CAN Node status. Refer XMC_CAN_STATUS_t structure for details.
Description:
Reads the Message Object data bytes, into message pointer passed as input parameter can_mo. can_data[0] of can_mo holds lower 4 bytes, can_data[1] of can_mo holds higher 4 bytes.
Related API's:
None
XMC_CAN_STATUS_t XMC_CAN_MO_ReceiveData ( XMC_CAN_MO_t can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
XMC_CAN_STATUS_t CAN Node status. Refer XMC_CAN_STATUS_t structure for details.
Description:
Reads the Message Object data bytes, into message pointer passed as input parameter can_mo. can_data[0] of can_mo holds lower 4 bytes, can_data[1] of can_mo holds higher 4 bytes.
Related API's:
None
void XMC_CAN_MO_ResetStatus ( const XMC_CAN_MO_t *const  can_mo,
const uint32_t  mask 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
maskMessage Object set status selection. Refer XMC_CAN_MO_RESET_STATUS_t for details. Multiple enums can be ORed.
Returns
None
Description:
Clears Message Object interrupt events. It configures MOCTR register.
Related API's:
None
void XMC_CAN_MO_SetAcceptanceMask ( XMC_CAN_MO_t *const  can_mo,
const uint32_t  can_id_mask 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_id_maskCAN MO acceptance mask.
Returns
None
Description:
Sets the acceptance mask of the MO
Related API's:
XMC_CAN_MO_GetAcceptanceMask()
void XMC_CAN_MO_SetDataLengthCode ( XMC_CAN_MO_t *const  can_mo,
const uint8_t  data_length_code 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
data_length_codetransfer data length. Range:0-8
Returns
None
Description:
Configures CAN Message Object Data Length Code. It configures MOFCR register.
Related API's:
XMC_CAN_MO_GetDataLengthCode()
void XMC_CAN_MO_SetEventNodePointer ( const XMC_CAN_MO_t *const  can_mo,
const XMC_CAN_MO_POINTER_EVENT_t  can_mo_ptr_int,
const uint32_t  service_request 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_mo_ptr_intMessage Object event node pointer selection. Refer XMC_CAN_MO_POINTER_EVENT_t structure for valid values.
service_requestinterrupt output line of multiCAN module.
Returns
None
Description:
Configures Message Object event node pointer with service_request number. It configures MOIPR register.
Related API's:
None

< Message Object event mask

void XMC_CAN_MO_SetExtendedID ( XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Message object handles extended frames with 29-bit identifier.
Related API's:
XMC_CAN_MO_SetStandardID()
Note:
After setting the identifier type user has to set the identifier value by using XMC_CAN_MO_SetIdentifier() API.
void XMC_CAN_MO_SetIdentifier ( XMC_CAN_MO_t *const  can_mo,
const uint32_t  can_identifier 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_identifierIdentifier.
Returns
None
Description:
Configures CAN Message Object Identifier. It configures MOAR register.
Related API's:
XMC_CAN_MO_GetIdentifier()
void XMC_CAN_MO_SetStandardID ( XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Message object handles standard frames with 11-bit identifier.
Related API's:
XMC_CAN_MO_SetExtendedID()
Note:
After setting the identifier type user has to set the identifier value by using XMC_CAN_MO_SetIdentifier() API.
void XMC_CAN_MO_SetStatus ( const XMC_CAN_MO_t *const  can_mo,
const uint32_t  mask 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
maskMessage Object set status selection. Refer XMC_CAN_MO_SET_STATUS_t for details. Multiple enums can be ORed.
Returns
None
Description:
Configures Message Object set Status. It configures MOCTR register.
Related API's:
XMC_CAN_MO_ResetStatus()


XMC_CAN_STATUS_t XMC_CAN_MO_Transmit ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
XMC_CAN_STATUS_t CAN Node status. Refer XMC_CAN_STATUS_t structure for details.
Description:
Configures transmit request for sending data frame. It configures MOCTR register. Data shall be updated using XMC_CAN_MO_UpdateData() before calling this API.
Related API's:
XMC_CAN_MO_UpdateData()


XMC_CAN_STATUS_t XMC_CAN_MO_UpdateData ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
XMC_CAN_STATUS_t CAN Node status. Refer XMC_CAN_STATUS_t structure for details.
None
Description:
Configures Data to be transmitted and data length code.
Related API's:
XMC_CAN_MO_Config()


void XMC_CAN_NODE_ClearStatus ( XMC_CAN_NODE_t *const  can_node,
XMC_CAN_NODE_STATUS_t  can_node_status 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
can_node_statusStatus to clear.Refer XMC_CAN_NODE_STATUS_t for valid values.
Returns
None
Description:
Clear errors status as well as successfully transferred CAN frames status.
Related APIs:
XMC_CAN_NODE_GetStatus()
void XMC_CAN_NODE_Disable ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Disable the CAN node, terminates participation in CAN traffic. It configures NCR.CANDIS bit.
Related API's:
None
void XMC_CAN_NODE_DisableConfigurationChange ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Forbid to change the configuration of the CAN node. It configures NCRx.CCE bit.
Related API's:
XMC_CAN_NODE_EnableConfigurationChange()
void XMC_CAN_NODE_DisableEvent ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_EVENT_t  event 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
eventCAN node event mask value. Refer XMC_CAN_NODE_EVENT_t structure for valid values. multiple events can be ORed.
Returns
None
Description:
Disable CAN Node events. It configures NFCR register.
Related APIs:
XMC_CAN_NODE_EnableEvent()
void XMC_CAN_NODE_DisableLoopBack ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Disable Node Loop-Back Mode, disables internal (virtual) loop-back CAN bus. This API Configures NPCRx register. Call XMC_CAN_NODE_EnableConfigurationChange() API before NPCRx configuration, same way XMC_CAN_NODE_DisableConfigurationChange() API after NPCRx configuration.
Related APIs:]
XMC_CAN_NODE_EnableLoopBack()
Note:
NPCRx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_Enable ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Enable the CAN node, starts the participation in CAN traffic. It configures NCR.CANDIS and the NCR.INIT bits.
Related API's:
None
void XMC_CAN_NODE_EnableConfigurationChange ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Allow to change the configuration of the CAN node, like bit timing, CAN bus transmit/receive ports and error counters read. It configures NCRx.CCE bit.
Related APIs:
XMC_CAN_NODE_DisableConfigurationChange()
void XMC_CAN_NODE_EnableEvent ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_EVENT_t  event 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
eventCAN node event mask value. Refer XMC_CAN_NODE_EVENT_t structure for valid values. multiple events can be ORed.
Returns
None
Description:
Enable CAN Node events. It configures NFCR register.
Related APIs:
XMC_CAN_NODE_DisableEvent()
void XMC_CAN_NODE_EnableLoopBack ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Enable Node can_node in Loop-Back Mode. A Node is connected to an internal (virtual) loop-back CAN bus. All CAN nodes which are in Loop- Back Mode are connected to this virtual CAN bus so that they can communicate with each other internally. The external transmit line is forced recessive in Loop-Back Mode. This API Configures NPCRx register. call XMC_CAN_NODE_EnableConfigurationChange() API before NPCRx configuration, same way XMC_CAN_NODE_DisableConfigurationChange() API after NPCRx configuration configuration.
Related APIs:]
XMC_CAN_NODE_DisableLoopBack().
Note:
NPCRx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_EnableSuspend ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Trigger the suspension of the CAN node. An OCDS(on chip debug support) suspend trigger disables the CAN node: As soon as the CAN node becomes bus-idle or bus-off, bit INIT is internally forced to 1 to disable the CAN node. The actual value of bit INIT remains unchanged. It configures NCR.SUSEN bit
Related API's:
None
Note:
Bit SUSEN is reset via OCDS(on chip debug support) Reset.
void XMC_CAN_NODE_FrameCounterConfigure ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_FRAME_COUNTER_t *const  can_node_init 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
can_node_initframe counter mode selection. Refer XMC_CAN_NODE_FRAME_COUNTER_t for valid values.
Returns
None
Description:
Configures frame counter functions. Each CAN can_node is equipped with a frame counter that counts transmitted/received CAN frames or obtains information about the time when a frame has been started to transmit or be received by the CAN node. It configures NFCR register.
Related API's:
None
uint16_t XMC_CAN_NODE_GetCANFrameCounter ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
uint16_t current value of the CAN frame counter. Range :0-65535
Description:
Returns the frame counter value can_node of the CAN node. In Frame Count Mode (CFMOD = 00B), this API returns the frame count value. In Time Stamp Mode (CFMOD = 01B), this API returns the captured bit time count value, captured with the start of a new frame. In all Bit Timing Analysis Modes (CFMOD = 10B), this API always returns the number of fCLC clock cycles (measurement result) minus 1.
Related API's:
None
uint8_t XMC_CAN_NODE_GetErrorWarningLevel ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
uint8_t Error Warning Level. Range :0 - 255
Description:
Returns error warning level. This determines the threshold value (warning level, default 96) to be reached in order to set the corresponding error warning bit EWRN. It reads NECNT register.
Related APIs:
XMC_CAN_NODE_SetErrorWarningLevel()


XMC_CAN_NODE_LAST_ERROR_DIR_t XMC_CAN_NODE_GetLastErrTransferDir ( XMC_CAN_NODE_t *const  node)
Parameters
nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
XMC_CAN_NODE_LAST_ERROR_DIR_t Last error transfer direction. Refer XMC_CAN_NODE_LAST_ERROR_DIR_t.
Description:
Returns NODE Last Error occurred during Transmit/receive direction. It returns value of NFCR register.
Related APIs:
XMC_CAN_NODE_GetLastErrTransferInc()


XMC_CAN_NODE_LAST_ERROR_INC_t XMC_CAN_NODE_GetLastErrTransferInc ( XMC_CAN_NODE_t *const  node)
Parameters
nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
XMC_CAN_NODE_LAST_ERROR_INC_t Last error transfer increment. Refer XMC_CAN_NODE_LAST_ERROR_INC_t.
Description:
Returns NODE Last Error Transfer Increment. It returns value of NFCR register.
Related APIs:
XMC_CAN_NODE_GetLastErrTransferDir()


uint8_t XMC_CAN_NODE_GetReceiveErrorCounter ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
uint8_t receive error counter value.
Description:
Returns Receive Error Counter value. It reads NECNT register.
Related APIs:
XMC_CAN_NODE_SetReceiveErrorCounter()
uint32_t XMC_CAN_NODE_GetStatus ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
uint32_t Current status of the node.
Description:
Returns errors status as well as successfully transferred CAN frames status.
Related APIs:
XMC_CAN_NODE_ClearStatus()
uint8_t XMC_CAN_NODE_GetTransmitErrorCounter ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
uint8_t transmit error counter value. Range :0 - 255
Description:
Returns Transmit Error Counter value. If the Bitstream Processor detects an error while a transmit operation is running, the Transmit Error Counter is incremented by 8. An increment of 1 is used when the error condition was reported by an external CAN node via an Error Frame generation. It reads NECNT register.
Related APIs:
XMC_CAN_NODE_SetTransmitErrorCounter()
Note:
NECNTx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_NominalBitTimeConfigure ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t *const  can_bit_time 
)
Parameters
can_nodePointer pointing to CAN_NODE Structure. Defines CAN_NODE registers. Range :CAN_NODE0-CAN_NODE2
can_bit_timeNominal bit time configuration data structure. Refer XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t for details.
Returns
None
Description:
Configures CAN node Baudrate. can_bit_time specifies required baudrate for a specified can_node. It configures NBTR register.
Related APIs:
None
void XMC_CAN_NODE_ReSetAnalyzerMode ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Reset the Analyzer mode. CAN node is no more in Analyzer Mode. Please refer XMC_CAN_NODE_SetAnalyzerMode(). It configures NCR.CALM bit. XMC_CAN_NODE_SetInitBit() should be called before set / reset AnalyzerMode.
Related API's:
XMC_CAN_NODE_SetAnalyzerMode()
void XMC_CAN_NODE_ResetInitBit ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Enable CAN node participation in CAN traffic. Bit INIT is automatically set when the CAN node enters the bus-off state. It configures NCR.INIT bit.
Related API's:
XMC_CAN_NODE_SetInitBit()
void XMC_CAN_NODE_SetAnalyzerMode ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Configure CAN node in Analyzer Mode. This means that messages may be received, but not transmitted. No acknowledge is sent on the CAN bus upon frame reception. Active-error flags are sent recessive instead of dominant. The transmit line is continuously held at recessive (1) level. XMC_CAN_NODE_SetInitBit() should be called before set / reset AnalyzerMode. It configures NCR.CALM bit.
Related API's:
XMC_CAN_NODE_ReSetAnalyzerMode()
void XMC_CAN_NODE_SetErrorWarningLevel ( XMC_CAN_NODE_t *const  can_node,
uint8_t  error_warning_level 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
error_warning_levelError Warning level value. Range :0-255.
Returns
None
Description:
Configures error warning level in order to set the corresponding error warning bit EWRN. It configures error_warning_level into NECNT register. Before this configuration call XMC_CAN_NODE_EnableConfigurationChange() API.
Related APIs:
XMC_CAN_NODE_GetErrorWarningLevel()


Note:
NECNTx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_SetEventNodePointer ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_POINTER_EVENT_t  ptr_event,
const uint32_t  service_request 
)
Parameters
can_nodePointer pointing to CAN_NODE Structure. Defines CAN_NODE registers.
ptr_eventCAN_NODE interrupt pointer position. Refer XMC_CAN_NODE_POINTER_EVENT_t structure for valid values.
service_requestInterrupt service request number. Range : 0-7
Returns
None
Description:
Configures node interrupt pointer service_request for CAN Node events ptr_event. It configures NIPR register.
Related APIs:
None

< Node event mask

void XMC_CAN_NODE_SetInitBit ( XMC_CAN_NODE_t *const  can_node)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
Returns
None
Description:
Disable CAN node participation in CAN traffic. Bit INIT is automatically set when the CAN node enters the bus-off state. It configures NCR.INIT bit.
Related API's:
XMC_CAN_NODE_ResetInitBit()
void XMC_CAN_NODE_SetReceiveErrorCounter ( XMC_CAN_NODE_t *const  can_node,
uint8_t  can_rec 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
can_recreceive error counter value. Range :0-255
Returns
None
Description:
Configures Receive Error Counter. It configures can_rec into NECNT register. Before this configuration call XMC_CAN_NODE_EnableConfigurationChange() API.
Related APIs:
XMC_CAN_NODE_GetReceiveErrorCounter()


Note:
NECNTx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_SetReceiveInput ( XMC_CAN_NODE_t *const  can_node,
const XMC_CAN_NODE_RECEIVE_INPUT_t  input 
)
Parameters
can_nodePointer pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
inputCAN receive input selection. Refer XMC_CAN_NODE_RECEIVE_INPUT_t for details.
Returns
None
Description:
input specifies CAN input receive pin. This API Configures NPCRx register,it is required to call XMC_CAN_NODE_EnableConfigurationChange(), before configuring NPCRx register, call XMC_CAN_NODE_DisableConfigurationChange() API after configuring NPCRx register. CAN input receive pins which falls under analog port pins should call XMC_GPIO_EnableDigitalInput(),to enable digital pad.
Related APIs:
None
Note:
NPCRx can be written only if bit NCRx.CCE is set.
void XMC_CAN_NODE_SetTransmitErrorCounter ( XMC_CAN_NODE_t *const  can_node,
uint8_t  can_tec 
)
Parameters
can_nodePointer Pointing to CAN_NODE Structure. Defines CAN_NODE registers, Range :CAN_NODE0-CAN_NODE2.
can_tectransmit error counter value. Range :0-255
Returns
None
Description:
Configures Transmit error counter. It configures can_tec into NECNT register. Before this configuration call XMC_CAN_NODE_EnableConfigurationChange() API.
Related APIs:
XMC_CAN_NODE_GetTransmitErrorCounter()


Note:
NECNTx can be written only if bit NCRx.CCE is set.
void XMC_CAN_PanelControl ( XMC_CAN_t *const  obj,
const XMC_CAN_PANCMD_t  pancmd,
const uint8_t  arg1,
const uint8_t  arg2 
)
Parameters
objPointer pointing to XMC_CAN Global Initialization structure. Defines CAN global registers,refer CAN_NODE_TypeDef for details.
pancmdpanal command selection. Refer XMC_CAN_PANCMD_t for valid values.
arg1Panel Argument 1,Range : 0-2
arg2Panel Argument 2, Range : 0-63
Returns
None
Description:
Configures the panel command and panel arguments. A panel operation consists of a command code (PANCMD) and up to two panel arguments (PANAR1, PANAR2). Commands that have a return value deliver it to the PANAR1 bit field. Commands that return an error flag deliver it to bit 31 of the Panel Control Register, this means bit 7 of PANAR2. arg1 represents panel argument PANAR1,arg2 represents panel argument PANAR2 and pancmd represents command code. It configures PANCTR register.
Related APIs:
None
void XMC_CAN_RXFIFO_ConfigMOBaseObject ( const XMC_CAN_MO_t *const  can_mo,
const XMC_CAN_FIFO_CONFIG_t  can_fifo 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_fifoCAN FIFO configuration data structure. Refer XMC_CAN_FIFO_CONFIG_t data structure for details.
Returns
None
Description:
Configures the base object of receive FIFO.
Related API's:
None
void XMC_CAN_RXFIFO_ConfigMOSlaveObject ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
None
Description:
Configures the slave Object of receive FIFO. It configures MOCTR.RESRXEN bit.
Related API's:
None
void XMC_CAN_TXFIFO_ConfigMOBaseObject ( const XMC_CAN_MO_t *const  can_mo,
const XMC_CAN_FIFO_CONFIG_t  can_fifo 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_fifoCAN FIFO configuration data structure. Refer XMC_CAN_FIFO_CONFIG_t data structure for details.
Returns
None
Description:
Configures the transmit FIFO. A FIFO consists of one base object and n slave objects. Please refer reference manual Transmit FIFO for more info.
Related API's:
None.
void XMC_CAN_TXFIFO_ConfigMOSlaveObject ( const XMC_CAN_MO_t *const  can_mo,
const XMC_CAN_FIFO_CONFIG_t  can_fifo 
)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
can_fifoCAN FIFO configuration data structure. Refer XMC_CAN_FIFO_CONFIG_t data structure for details.
Returns
None
Description:
Configures the slave object of transmit FIFO.
Related API's:
None
XMC_CAN_STATUS_t XMC_CAN_TXFIFO_Transmit ( const XMC_CAN_MO_t *const  can_mo)
Parameters
can_moPointer to Message Object structure. Refer XMC_CAN_MO_t data structure for details.
Returns
XMC_CAN_STATUS_t CAN Node status. Refer XMC_CAN_STATUS_t structure for details.
Description:
To transmit Message Object from the FIFO. Prior to this CAN node Message Object FIFO structure shall be made using XMC_CAN_TXFIFO_ConfigMOBaseObject(), XMC_CAN_TXFIFO_ConfigMOSlaveObject(),XMC_CAN_RXFIFO_ConfigMOBaseObject() API's. Please refer reference manual MessageObject FIFOStructure for more info.
Generated on Mon Aug 7 2017 11:33:56 for XMC Peripheral Library for XMC4000 Family by   doxygen 1.8.11