Banner_AURIX_Security-Solution Banner_AURIX_Security-Solution Banner_AURIX_Security-Solution


infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 3 of 3

Thread: Tc222 multican interrupts

  1. #1
    Intermediate Intermediate Lukas_G is on a distinguished road
    Join Date
    Apr 2019
    Posts
    46
    Points
    485

    Tc222 multican interrupts

    Hi,
    are there any sample codes for multican interrupts?

  2. #2
    Intermediate Intermediate Lukas_G is on a distinguished road
    Join Date
    Apr 2019
    Posts
    46
    Points
    485
    I have configured general can config:
    Code:
    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:
    Code:
    	canNodeConfig.transferInterrupt.enabled = TRUE;
    	        canNodeConfig.transferInterrupt.srcId = IfxMultican_SrcId_0;
    then message objects needs to be configured:
    Code:
    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 ?

  3. #3
    Intermediate Intermediate UC_wrangler is on a distinguished road
    Join Date
    Jun 2019
    Posts
    22
    Points
    465
    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():

    Code:
        /* 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:
    Code:
    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[]
        }
    }

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.