Jun 28, 2019
04:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 28, 2019
04:45 AM
2 Replies
Jun 28, 2019
04:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 28, 2019
04:59 AM
I have configured general can config:
and then node needs to be configured:
then message objects needs to be configured:
and have several question:
1. what nodePointer array is
2. what is transfer interrupt in can node config is and where can i configure node rx and tx interrupt ?
canConfig.nodePointer[IfxMultican_SrcId_0].priority =CAN_RX_INERRUPT_PRIORITY;
canConfig.nodePointer[IfxMultican_SrcId_0].typeOfService =IfxSrc_Tos_cpu0;
and then node needs to be configured:
canNodeConfig.transferInterrupt.enabled = TRUE;
canNodeConfig.transferInterrupt.srcId = IfxMultican_SrcId_0;
then message objects needs to be configured:
canMsgObjConfig.rxInterrupt.enabled = TRUE;
canMsgObjConfig.rxInterrupt.srcId = IfxMultican_SrcId_0;
and have several question:
1. what nodePointer array is
2. what is transfer interrupt in can node config is and where can i configure node rx and tx interrupt ?
Jul 02, 2019
08:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 02, 2019
08:16 AM
Hi Lukas_G. The nodePointer array configures how each CAN node's service requests are sent to the Interrupt Router. It's used inside of IfxMultican_Can_initModule():
To declare the interrupt handler in your code, do something like this:
/* Configure interrupt node pointers */
IfxMultican_SrcId srcId;
for (srcId = 0; srcId < IFXMULTICAN_NUM_SRC; srcId++)
{
volatile Ifx_SRC_SRCR *srcPointer = IfxMultican_getSrcPointer(mcanSFR, srcId);
IfxSrc_init(srcPointer, config->nodePointer[srcId].typeOfService, config->nodePointer[srcId].priority);
if (config->nodePointer[srcId].priority)
{
IfxSrc_enable(srcPointer);
}
To declare the interrupt handler in your code, do something like this:
IFX_INTERRUPT(ISR_can0_rx, 0, CAN_RX_INERRUPT_PRIORITY); // maybe INTERRUPT instead of INERRUPT 😉
void ISR_can0_rx(void)
{
IfxCpu_enableInterrupts();
IfxMultican_Message msg1;
IfxMultican_Message_init(&msg1, 0xdead, 0xdeadbeef, 0xdeadbeef, IfxMultican_DataLengthCode_8); /* start with invalid values */
IfxMultican_Status readStatus = IfxMultican_Can_MsgObj_readMessage(&g_MulticanBasic.drivers.canDstMsgObj, &msg1);
if ( readStatus & IfxMultican_Status_newData)
{
// handle new message here in msg1.data[]
}
}