How to Enable CAN Receiver Interrupt in CAN PAL Example code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Enable CAN Receiver Interrupt in CAN PAL Example code

609 次查看
Dileep1441
Contributor I

Hi,

I'm using CAN PAL Example code in S32K144 EVB with S32DS.ARM.2018.R1 IDE.

I want to enable the CAN Receiver interrupt in CAN PAL Example code, i don't want to block my code with while loop like below

CAN_ConfigRxBuff(INST_CAN_PAL1, RX_MAILBOX, &buffCfg, Rx_Id);
/* Start receiving data in RX_MAILBOX. */
CAN_Receive(INST_CAN_PAL1, RX_MAILBOX, &recvMsg);

while(1)
{
         /* Wait until the previous FlexCAN receive is completed */
         if(CAN_GetTransferStatus(INST_CAN_PAL1, RX_MAILBOX) == STATUS_SUCCESS)
         {
             CAN_Rx_test_ID = recvMsg.id;
             CAN_Receive(INST_CAN_PAL1, RX_MAILBOX, &recvMsg);

         }
}

Here my requirement is when ever the CAN Message is received on CAN Bus, CAN Receiver Interrupt need to Trigger so that without blocking of my code with while loop, i can handle the received CAN Messages

 

Hope you understand my requirement, please share your suggestion or code with required config settings to fulfill my requirement.

 

Thanks in Advance.

0 项奖励
回复
1 回复

589 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Dileep1441,

Please refer to the examples in S32K1xx SDK FlexCAN sample projects to demonstrate its basic and advanced features
You will find the CAN_TX_RX_Callback in ...\S32K144_CAN_PAL_SamplePrj_Basic_TxRx_ID_FiltersConfig_SDKRTM3P0\Sources\can_api.c

Hope it helps.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复