How to use PIT_DRV_GetStatusFlags function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use PIT_DRV_GetStatusFlags function

221 Views
Sang-Hoon_Ahn
Contributor I

hello
I am studying basic examples (PTI, FlexCAN) of S32 SDK supporting MPC5748G.
Looking at the pit_periodic_interrupt_mpc5748G example, it seems that the interrupt vector is accessed through the IRQHandler function below.

 

 

 

void PIT_Ch0_IRQHandler(void)
{

PIT_DRV_ClearStatusFlags(INST_PIT1, pit1_ChnConfig0.hwChannel); /* Clear channel 0 interrupt flag */
}

Instead of the PIT_DRV_ClearStatusFlags function above, I want to check the interrupt operation with the if statement using the PIT_DRV_GetStatusFlags function.

 

For example, the HAL driver of the nucleo board checks the interrupt with the syntax below.

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance == TIM6)
{

 

 

Is it the correct syntax to write in the format below like the interrupt syntax above?

 

 

PIT_Type PIT1_CH0

void PIT_Ch0_IRQHandler(void)
{

if(PIT_DRV_GetStatusFlags(INST_PIT1, pit1_ChnConfig0.hwChannel) == pit1_ChnConfig0)

{


}

 

exactly...
After declaring the PTI_Type structure
I don't know how to match the return value below using a structure.

{
retVal = (base->TIMER[channel].TFLG & PIT_TFLG_TIF_MASK);
}
return retVal;

0 Kudos
1 Reply

211 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

PIT_DRV_ClearStatusFlags only returns 0 or 1, which is the value of PIT channel TFLG bit.   
PIT channel is specified in function's second parameter.

BR, Petr

0 Kudos