interrupt from uart under wince 5.0

Mathias Tantau
hello,
does any one know the way to work with interrupts and write interrupt
routines under wince 5.0? I am interested in usart interrupts especially.
Thank you for every help,
             Mathias Tantau

domdom
Hello, 

You can have a look on the source code of my SPI driver :
http://www.domodom.fr/spip/Un-driver-SPI-pour-la-mini2440.html?lang=en

In the HW_Init() function, the 
KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, etc...) 
returns in gIntrSPI an interrupt number for IRQ_SPI0 (SPI 0 interrupt).

Then the InterruptInitialize function configures the system by giving it an
event that will be set by the system each time the SPI 0 interrupt occurs.

Finally, a thread SPI_IST is created, this thread will wait for the event :
 (WaitForSingleObject(pSPI->ISTEvent, INFINITE);
When the event is set, the following call must be made to clear the
interrupt :  InterruptDone(gIntrSPI);

You can find the definition of constants to pass to the KernelIoControl
function in the file C:\WINCE600\PLATFORM\Mini2440\SRC\INC\s3c2440a_intr.h

domdom

Mathias Tantau
hello domdom,
thank you for your help!
When I try to build my program with Microsoft eMbedded Visual C++, it
complains because <nkintr.h> is unknown and KernelIoControl as well. What
is mistaken here?

Mathias Tantau

domdom
I'm not sure that KernelIoControl can be called by an application.
The file nkintr.h is not in the BSP, then you have to find it in the source
files of Windows CE. Try to find the nkintr.h file in your c:/wince600 (or
in the directory where you installed Windows CE 6.0).
If you didn't install Windows CE, you have to do it.
domdom

Mathias Tantau
thank you domodom,
I have found a way to avoid the interrupt and it works well. Maybe I'll
come back to it later.
Mathias Tantau