|
hello,
Just a clarification using a I/O pin as interrupt source, how I can configure it as level or edge interrupt source:
I have this code
static const struct pio_desc hw_pio[] = { {"SCIRQ", AT91C_PIN_PD(4), 0, PIO_PULLUP, PIO_INPUT}, };
//set the PD4 as input for interrupt pio_setup(hw_pio, (sizeof(hw_pio)/sizeof(struct pio_desc))); // Request SysIntr for IRQ PD4 dwLogIntr = (LOGINTR_BASE_PIOD + 4); SetLastError(ERROR_SUCCESS);
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &dwLogIntr, sizeof(DWORD), &Sysintr, sizeof(DWORD), &dwBytesReturned)) { RETAILMSG(1, (TEXT("ERROR: Failed to request the sysintr, errorcode = %d \r\n"),GetLastError())); Sysintr = SYSINTR_UNDEFINED; return (FALSE); }
That's enough to set the pin as level interrupt? thanks!
|