AnsweredAssumed Answered

l want to set PTE16  as  interrupt on rising-dege which use S32K144

Question asked by jinshuai xu on Apr 11, 2019
Latest reply on Apr 13, 2019 by jinshuai xu

hello

My S32K144 compile software version is "S32 Design Studio for ARM Version: 2018.R1".

now l want to set PTE16 as interrupt on rising-dege,the next is my setting:

void main(void)

{

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

/* Output direction for LED0 & LED1 */
PINS_DRV_SetPinsDirection(GPIO_PORT, ((1 << LED1) | (1 << LED2)));

/* Set Output value LED0 & LED1 */
PINS_DRV_SetPins(GPIO_PORT, 1 << LED1);
PINS_DRV_ClearPins(GPIO_PORT, 1 << LED2);

 

PCC->PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT E */
PTE->PDDR &= ~(1 << 16);
PORTE->PCR[16] = 0x00000110;//PTE16 set input GPIO mode
PORTE->PCR[16] |= 0x00009000;//ISF flag and Interrupt on rising-edge

 

INT_SYS_InstallHandler(PORTE_IRQn,&PORTE_IRQH, (isr_t *)0 );
INT_SYS_EnableIRQ(PORTE_IRQn);

}

 

void PORTE_IRQH(void)
{
PINS_DRV_TogglePins(GPIO_PORT, ((1 << LED1) | (1 << LED2)));
PINS_DRV_ClearPortIntFlagCmd(PORTE);

}

who can tell me how to setting PTE16 as interrupt on rising-dege which use register,my setting is untrue.
Attached is the project

Attachments

Outcomes