How to Enable CAN Receiver Interrupt in CAN PAL Example code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to Enable CAN Receiver Interrupt in CAN PAL Example code

474件の閲覧回数
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 返信

454件の閲覧回数
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 件の賞賛
返信