I am trying to read the Interrupt of my Accelerometer Sensor.
I found a code on the Forum here, and I tested it with the Buttons on the side of the board and worked.
But when I try to check the Interrupt of my Sensor I see nothing, am I configuring the Pin right?
Its pin PTE8
Here is the code:
void S32_NVIC_EnableIRQ(IRQn_Type IRQn, int Priority)
{
/* enable interrupt */
S32_NVIC->ISER[(uint32_t)((int32_t)IRQn) >> 5] = (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F));
S32_NVIC->IP[IRQn] = Priority;
}
void PORTC_IRQHandler(void)
{
counter++;
PORTE->PCR[PTE8] |= PORT_PCR_ISF_MASK;
}
PCC-> PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK;
/* Configure port E8 as GPIO input */
PTE->PDDR &= ~(1<<PTE8);
PORTE->PCR[8] = PORT_PCR_MUX(1)|PORT_PCR_PFE_MASK|PORT_PCR_IRQC(0x9); /* Port E8: MUX = GPIO, input filter enabled */
S32_NVIC_EnableIRQ(PORTE_IRQn,9);
thanks in advance.