Hi Dustin,
> I'm trying to read information from DIO port but i wanna do it using
> interrupts. I already check chapter 21 of EP9301 user guide, and read
> about what register i need. My noob question is how can know that a
> interrupt occurs. can i have something like this?
>
> interrupts program(int1, int2)
> {
> ...
> ...
> }
>
> int main()
> {
> ...
> ...
> }
>
> and when the interrupt ocurrs jump to my interrupt program...
You can only ever write code like this when the processor is
in supervisor mode. If you want your program to run under
Linux, you need to write a device driver.
In the case of a device driver, Linux controls the interrupt
registers, and you register an interrupt handler with the
kernel. In the driver, when an interrupt occurs, you copy
the state of DIO to a buffer. That buffer can be read from
user-space using a read call. When user-space does a read,
it can be to block until the interrupt occurs.
There is a book by Rubini on writing device drivers.
You'll want the 2nd Edition for a 2.4-series kernel.
Its free on the web somewhere, start searching at Oreilly's
web site.
Take a shot at writing some code, and if you get stuck ask
on this list, and I'll see if I can help out.
Cheers,
Dave
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|