using Example S32K144 RTC VLPS S32DS.R1 as reference code, Code was modified as following:
but still, it doesn't work.
void init_port(void)
{
PCC-> PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK; // Enable clock to PortE - BUS_CLK
// PTE2
PTE->PDDR &= ~(1 << 2); // Data Direction (input)
PORTE->PCR[2] = 0x00098100;
// [19?6] IRQC = 0b1001 ISF flag and Interrupt on rising-edge
// [15] LK = 1 Pin Control Register fields [15:0] are locked
// [10-8] MUX = 0b001 GPIO
PORTE->DFCR = 0x00000001;
// [0] CS = 1 Digital filters are clocked by the LPO clock
PORTE->DFWR = 0x0000001F;
// [4-0] FILT = 32 (1/32kHz) * 32 = 1ms
PORTE->DFER |= (1 << 2);
// Digital filter is enabled on the PTE2 pin,
}
void init_nvic(void)
{
// PORTE_interrupt
S32_NVIC->ICPR[1] = (1 << (63 % 32));
S32_NVIC->ISER[1] = (1 << (63 % 32));
S32_NVIC->IP[63] = 0x10; // Priority level 1
}
init_port();
init_nvic();
//enter vlps here
...