Hi,
I've tried to make gioNotification() work, and while gioNotification() does get called when exposing the GPIO to a falling edge, the port and bit information given as parameters were always wrong.
It was not until I noticed that the IRQ offset register is cleared on read and then inspecting the halcogen generated gioLowLevelInterrupt that I think I see the problem:
From RM48 user manual table 22-11
GIO offset 2. These bits index the currently pending low-priority interrupt. This register and the
flag bit (in the GIOFLG register) are also cleared when this register is read, except in emulation
mode
The gioLowLevelInterrupt:
void gioLowLevelInterrupt(void)
{
uint32 offset;
/* USER CODE BEGIN (17) */
/* USER CODE END */
if (gioREG->OFF2 != 0U)
{
offset = gioREG->OFF2 - 1U;
if (offset >= 8U)
{
gioNotification(gioPORTB, offset - 8U);
}
else
{
gioNotification(gioPORTA, offset);
}
}
/* USER CODE BEGIN (18) */
/* USER CODE END */
}
It is seen that the OFF2 reg is read twice and therefore as I see it the register is cleared before assigned to "offset". If I modify the code to only read OFF2 once into a temp var, and then use that instead then the code works perfectly.
Best regards,
Nikolaj