Hi Team
I was exploring all the possible things , which can be done in FlexCAN module
I just wanted to know , if we can configure a event or ISR for particular MB ?
I'm aware that CAN has only 2 ISR for MB's (CAN0_ORed_0_15_MB_IRQHandler & CAN0_ORed_16_31_MB_IRQHandler) , but is it possible to have a particular event only for particular MB using SDKs
If we cant configure like that , what is a best available approach for the same ??
Regards
Karthik SV
Solved! Go to Solution.
Hi@KARTHKSARODE
The method you said may not be supported,as you can see : "some of these sources are OR'd together to generate a single request." this should means that the specific ISR for each MB are not supported.
In fact, you can judge which MB caused the interrupt in the interrupt service function,and this method is exactly the same as what you want.
for example.
void Can_Callback(uint8_t instance,flexcan_event_type_t eventType,uint32_t buffIdx,flexcan_state_t *flexcanState)
{
switch(eventType)
{
case FLEXCAN_EVENT_RX_COMPLETE:
//judge which MB cause the interrupt
if(mb_idx_1 == buffIdx)
{
FLEXCAN_DRV_Receive(INST_CANCOM1,mb_idx_1,&recvMsg);
};
.
.
.
break;
case FLEXCAN_EVENT_TX_COMPLETE:
break;
default:
break;
}
}
BR!
Jim,
---------------------------------------------------------------------------------------------------------------------------------------
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.
---------------------------------------------------------------------------------------------------------------------------------------
Hi@KARTHKSARODE
The method you said may not be supported,as you can see : "some of these sources are OR'd together to generate a single request." this should means that the specific ISR for each MB are not supported.
In fact, you can judge which MB caused the interrupt in the interrupt service function,and this method is exactly the same as what you want.
for example.
void Can_Callback(uint8_t instance,flexcan_event_type_t eventType,uint32_t buffIdx,flexcan_state_t *flexcanState)
{
switch(eventType)
{
case FLEXCAN_EVENT_RX_COMPLETE:
//judge which MB cause the interrupt
if(mb_idx_1 == buffIdx)
{
FLEXCAN_DRV_Receive(INST_CANCOM1,mb_idx_1,&recvMsg);
};
.
.
.
break;
case FLEXCAN_EVENT_TX_COMPLETE:
break;
default:
break;
}
}
BR!
Jim,
---------------------------------------------------------------------------------------------------------------------------------------
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.
---------------------------------------------------------------------------------------------------------------------------------------