Part Number: F29H85X-MCAL-SDK
Hi, we have configured for Gpt Channel_0 (CPU Timer 0), for continuous mode for 10ms without OS ISR in EB Tresos. The interrupt is being generated only once.
PFA the configuration file fyr
#define APP_GPT_CH0_INT_ID (6U)
#define APP_INT_PRIORITY_DEFAULT (255U)
#define APP_INT_THRESHOLD (20U)
#define APP_PIPE_LINK_OWNER (2U)
/*********************************************************************************************************************
* Local Type Declarations
*********************************************************************************************************************/
MCAL_LIB_INT_ISR(Gpt_Ch0Isr);
uint32 Gpt_InterruptCnt[GPT_CFG_MAX_CHANNELS] = {0U};
static void App_RegisterInterrupt(uint32 InterruptId, uint32 Priority, uint32 IsrAddress)
{
uint32 int_config_addr = PIPE_BASE + PIPE_O_INT_CONFIG(InterruptId);
uint32 int_link_owner_addr = PIPE_BASE + PIPE_O_INT_LINK_OWNER(InterruptId);
HWREG(int_link_owner_addr) = (HWREG(int_link_owner_addr) & 0xF0U) | APP_PIPE_LINK_OWNER;
HWREG(PIPE_BASE + PIPE_O_INT_VECT_ADDR(InterruptId)) = IsrAddress;
HWREG(int_config_addr) = (HWREG(int_config_addr) & ~PIPE_INT_CONFIG_PRI_LEVEL_M) | Priority;
HWREG(PIPE_BASE + PIPE_O_INT_CTL_L(InterruptId)) = PIPE_INT_CTL_L_EN;
}
static void App_InitBareMetalInterrupts(void)
{
MCAL_LIB_DINT;
HWREG(PIPE_BASE + PIPE_O_GLOBAL_EN) = PIPE_GLOBAL_EN_KEY;
HWREG(PIPE_BASE + PIPE_O_MMR_CLR) = 0x3U;
HWREG(PIPE_BASE + PIPE_O_MEM_INIT) = PIPE_MEM_INIT_KEY | 0x3U;
while (HWREG(PIPE_BASE + PIPE_O_MEM_INIT_STS) != 0x2U)
{
}
HWREG(PIPE_BASE + PIPE_O_INTSP) = APP_PIPE_LINK_OWNER;
HWREG(PIPE_BASE + PIPE_O_RTINT_THRESHOLD) = APP_INT_THRESHOLD;
HWREG(PIPE_BASE + PIPE_O_INT_GRP_MASK) = 0x00U;
App_RegisterInterrupt(APP_GPT_CH0_INT_ID, APP_INT_PRIORITY_DEFAULT, (uint32)Gpt_Ch0Isr);
HWREG(PIPE_BASE + PIPE_O_GLOBAL_EN) = 0x3U | PIPE_GLOBAL_EN_KEY;
MCAL_LIB_EINT;
}
/*main function */
int main(void)
{
Mcu_Init(NULL_PTR);
#if (STD_ON == MCU_CFG_INIT_CLOCK_API)
Mcu_InitClock(McuConf_McuClockSettingConfig_McuClockSettingConfig_Osc2);
while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() ) /* Get PLL status and check */
{
/* Wait until all enabled PLLs are locked */
}
#if(STD_OFF == MCU_CFG_NO_PLL)
Mcu_DistributePllClock();
#endif
#endif
Port_Init(NULL_PTR);
Gpt_Init(NULL_PTR);
App_InitBareMetalInterrupts();
/* Reset Counters */
Gpt_InterruptCnt[GPT_CHANNEL_0] = 0;
Dio_WriteChannel(DioConf_DioChannel_DioChannel_0, STD_LOW);
Gpt_EnableNotification(GPT_CHANNEL_0);
Gpt_StartTimer(GPT_CHANNEL_0, GPT_COUNT_VALUE_10MS);
Time_Delay(33);
while(1)
{
}
}
/* Time delay*/
int Time_Delay(float64 seconds)
{
McalLib_Delay(GPT_TIME_DELAY_PER_SECOND * seconds);
return 0;
}
/* GPT timer channel 0 notification function */
void Gpt_Notify_Func_0(void)
{
Gpt_InterruptCnt[GPT_CHANNEL_0]++;
Dio_FlipChannel(DioConf_DioChannel_DioChannel_0);
}