|
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: only module clock is supported for clock selection as of now
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).
here is a transmit example
data can be read by the following way
The CAN driver provides simple to use FD transfer functions After initialising the module, choose the node initialisation as the following 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 in the following way
You can recieve the data by the following way
After initialising th emodule and nodes, the gateway message objects can be initialised in the following way
A Gateway transfers 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)
After initialising the module and nodes,
A gateway FIFO transfers can be enabled during the node configuration by specifing the number of allocated message objects with the canMsgObjConfig.msgObjCount item. and enbling 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 a transmit 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)
data can be read by the following way