iLLD_TC27xC
1.0
|
![]() |
The CAN interface driver provides a default configuration for various modes.
In the following sections it will be described, how to integrate the driver into the application framework.
Include following header file into your C code:
Declare the CAN handles as global variables in your C code:
The module initialisation can be done as followed:
The Can nodes initialisation can be done as followed:
The Can message objects initialisation can be done as followed:
The MULTICAN is ready for use now!
The CAN driver provides simple to use transfer functions
Data can be sent by the following way:
Data can be received by the following way:
A transmit and receive FIFO can be enabled during the node configuration by specifing the number of allocated message objects with the canMsgObjConfig.msgObjCount item. and specifying the message object number of first slave object with the canMsgObjConfig.firstSlaveObjId item.
Message objects will be allocated to the FIFO in ascending order.
Here a configuration example:
Data can now be sent and received with the IfxMultican_Can_MsgObj_sendMessage and IfxMultican_Can_MsgObj_readMessage functions as usual (see above).
The CAN driver provides simple to use FD transfer functions
Node configuration:
The CAN FD message objects initialisation can be done as followed:
In case of standard messages data can be sent and received with the IfxMultican_Can_MsgObj_sendMessage and IfxMultican_Can_MsgObj_readMessage functions as usual (see above).
In case of long frames of length more than 8 bytes the data can be sent by the following way
You can recieve the data by the following way
A Gateway source object can be enabled during the message object configuration by specifing with the canMsgObjConfig.gatewayTransfersEnable item.
Here a configuration example:
Data can now be sent and received with the IfxMultican_Can_MsgObj_sendMessage and IfxMultican_Can_MsgObj_readMessage functions as usual (see above).
The data flow is as followed,
Data will be sent from the source object (canSrcMsgObj), it will be received by the gateway source object (canGatewaySrcMsgObj). and then gets copied into the gateway destination object (canGatewayDstMsgObj) without CPU intervention,
If GDFS is selected in gateway source object (canGatewaySrcMsgObj)then, the data will be transmitted from gateway destination object(canGatewayDstMsgObj) to the destination object (canDstMsgObj)
A gateway source FIFO can be enabled during the node configuration by specifing the number of allocated message objects with the canMsgObjConfig.msgObjCount item. and anbling the gateway transfers with the canMsgObjConfig.gatewayTransfersEnable item. and also by selecting the start object of the FIFO with the canMsgObjConfig.firstSlaveObjId item.
Message objects will be allocated to the gateway FIFO in ascending order. Here a configuration example:
Data can now be sent and received with the IfxMultican_Can_MsgObj_sendMessage and IfxMultican_Can_MsgObj_readMessage functions as usual (see above). here is an example
The data flow is as followed,
data will be sent from the source object (canSrcMsgObj) or source TX FIFO, it will be received by the gateway source FIFO (canGatewaySrcMsgObj). and then gets copied into the gateway destination objects (canGatewayDstMsgObj) without CPU intervention,
If GDFS is selected in gateway source object (FIFO) (canGatewaySrcMsgObj)then, the data will be transmitted from gateway destination objects (canGatewayDstMsgObj) to the destination objects or receive FIFO (canDstMsgObj)
if you want to read the data you read by the following way