Re: PXA27x GPIO Interrupt

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi!

I was hoping that I wouldn't have to write an ISR, i.e. an IST would be
enough.

Thanks!

"umesh" <ujagga@xxxxxxxxx> wrote in message
news:1150967097.079022.77050@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi,
just a query to help you better , ru handling this interrupt in your
ISR if not then u should.
and moreover u r trying with IRQ_GPIO0 so sytem will send u back sys
intr associated with it not what you want so better implement it in ur
ISR, u need to modify your intr.c file too....

there are other ways of implementing it too, but first you try to get
this thing done which will be more easy to implement.

now ur event will be waiting for IRQ_GPIO0 interrupt,so you need to
handle this IRQ_GPIO0 in ur ISR too and enable it too...

cheers
Umesh

Fredrik Jansson wrote:
Hi!

I am trying to use GPIO PIN 22 to trigger an interrupt. I do the
following:

Set Pin 22 to function 0:
s_pGPIO->GAFR0_U &= ~(3u<<12); // Interupt is fn 0
Set Pin 22 to input:
s_pGPIO->GPDR0 &= ~XLLP_BIT_22; // Interupt
Enable rising edge:
s_pGPIO->GRER0 |= XLLP_BIT_22;
Disable falling edge:
s_pGPIO->GFER0 &= ~XLLP_BIT_22;

Then I start the IST, I have tried with both IRQ_GPIO0 and IRQ_GPIO1
below.

The problem is that I never see any interrupt when I fiddle with the pin.
The device also freaks out....

Any advice would be greatly appreciated.

Best regards
Fredrik Jansson

static BOOL RXIRQConfigure()
{
DWORD dwIrq = IRQ_GPIO0;
DWORD res;

res = KernelIoControl( IOCTL_HAL_REQUEST_SYSINTR,
&dwIrq,
sizeof( dwIrq ),
&s_dwSysInt,
sizeof( s_dwSysInt ),
NULL );

if (!res)
{
return FALSE;
}

s_hRXInterruptEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!s_hRXInterruptEvent)
{
return FALSE;
}

s_hRXInterruptDone = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!s_hRXInterruptDone)
{
return FALSE;
}

// Start InteruptThread
s_RXThreadAlive = TRUE;
s_hRXInterruptIST = CreateThread(0, 0, RXInterruptIST, 0,
CREATE_SUSPENDED, 0);

if (0 == s_hRXInterruptIST)
{
return FALSE;
}

SetThreadPriority(s_hRXInterruptIST, THREAD_PRIORITY_HIGHEST);

if ( !InterruptInitialize(s_dwSysInt,s_hRXInterruptEvent,NULL,0) )
{
//RETAILMSG (1, (TEXT("DEMO: InterruptInitialize
failed!!!\r\n")));
return FALSE;;
}

ResumeThread( s_hRXInterruptIST );
return TRUE;
}

static DWORD RXInterruptIST(LPVOID pVarg)
{
while (s_RXThreadAlive)
{
if (WAIT_TIMEOUT == WaitForSingleObject(s_hRXInterruptEvent,
INFINITE))
{
if (!s_RXThreadAlive)
{
break;
}
}

++s_hRXInterruptCnt;
if (s_pGPIO->GEDR0 & XLLP_BIT_22)
{
NKDbgPrintfW(L"RX Interupt");
s_pGPIO->GEDR0 |= XLLP_BIT_22;
}
InterruptDone(s_dwSysInt);
}

SetEvent(s_hRXInterruptDone);
return ERROR_SUCCESS;
}



.



Relevant Pages

  • Re: PXA27x GPIO Interrupt
    ... ISR, u need to modify your intr.c file too.... ... I am trying to use GPIO PIN 22 to trigger an interrupt. ... Set Pin 22 to function 0: ... DWORD dwIrq = IRQ_GPIO0; ...
    (microsoft.public.windowsce.platbuilder)
  • Re: PXA27x GPIO Interrupt
    ... Set Pin 22 to function 0: ... DWORD dwIrq = IRQ_GPIO0; ... sizeof(s_dwSysInt), ...
    (microsoft.public.windowsce.platbuilder)
  • PXA27x GPIO Interrupt
    ... Set Pin 22 to function 0: ... The problem is that I never see any interrupt when I fiddle with the pin. ... DWORD dwIrq = IRQ_GPIO0; ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Installable ISR - still having problems
    ... Here's the code and def file of My ISR ... DWORD CreateInstance( ... DWORD InstanceIndex; ... DWORD dwSysIntr; ...
    (microsoft.public.windowsce.platbuilder)