Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use interrupt in Wince Driver

33 views
Skip to first unread message

Dean Tsai

unread,
Feb 21, 2001, 5:00:05 AM2/21/01
to
Hi!

I want to develop a driver to control a 8255 ISA card. But I have some
trouble with inetrrupt. I use
InterruptInitialize( Int, hEvent, NULL, 0 );

to initialize "int" with "hEvent". But it return fail.( I try "int" with
3,4,5,6)
Does anyone know what is wrong ?

Dean


Roger

unread,
Feb 21, 2001, 5:17:08 AM2/21/01
to
Ok, so what this function is doing is associating an interrupt ID (Int) with
an open event handle (hEvent).

When the processor receives an interrupt WinCE will call a function as set
up by the HookInterrupt function to decide what device caused the interrupt.
(For example, the PCI bus can have a variety of different devices all using
the same physical interrupt line). This function will return to CE a *
unique * interrupt ID. The WinCE kernel will then use the interrupt ID to
signal an open event which will start your IST running to process the
interrupt.

What you need to know is the * unique * interrupt ID associated with your
8255 ISA card, and pass that in as your first argument.

Roger

"Dean Tsai" <dean...@advantech.com.tw> wrote in message
news:uvUxE0#mAHA.1384@tkmsftngp05...

Steve Maillet

unread,
Feb 21, 2001, 9:43:25 AM2/21/01
to
For the CEPC the LOGICAL IDs used in InterruptInitialize can be obtained by
calling MapIrQ2SysIntr(IRQNUM) so the call should be like this

DWORD g_SysIntr;

MyInitFunc()
{
//...
g_SysIntr=MapIrq2SysIntr(3); //Ideally should read this from registry and
NOT hard code it
InterruptInitialize(g_SysIntr,hEvent,NULL,0);
//...
}

The reason g_SysIntr is global here is that it must also be used by the IST
to call InterruptDone() there are ways around using a global but this was
simplest for illustration of the question at hand.

--
Steve Maillet
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com


"Dean Tsai" <dean...@advantech.com.tw> wrote in message
news:uvUxE0#mAHA.1384@tkmsftngp05...

Paul G. Tobey

unread,
Feb 21, 2001, 11:36:00 AM2/21/01
to
Right. Look at *any* of the sample network drivers for examples of how this
works...

Paul T.

"Roger" <Roger.R...@Ivron.com> wrote in message
news:uTfk0##mAHA.1472@tkmsftngp03...

Dean Tsai

unread,
Feb 22, 2001, 2:11:16 AM2/22/01
to
Dear Steve,

Thanks for your help. The Interrupt can wrok well with IRQNUM = 3,4,5.
But if I use IRQNUM = 6 to call MapIrQ2SysIntr(IRQNUM);
It return fail again. Why ?

Dean


"Steve Maillet" <nos...@nospam.com> wrote in message
news:eo320TBnAHA.1340@tkmsftngp03...


> For the CEPC the LOGICAL IDs used in InterruptInitialize can be obtained
by
> calling MapIrQ2SysIntr(IRQNUM) so the call should be like this
>
> DWORD g_SysIntr;
>
> MyInitFunc()
> {
> //...

> g_SysIntr=MapIrq2SysIntr(3); file://Ideally should read this from

Bill T

unread,
Feb 22, 2001, 1:21:55 PM2/22/01
to
IRQ 6 is prossibly already being used. If you build/run a debug version of
the kernel, a debug message will be output if it is already in use.

"Dean Tsai" <dean...@advantech.com.tw> wrote in message
news:uwCBZ6JnAHA.1972@tkmsftngp04...
0 new messages