ts-7000
[Top] [All Lists]

Re: [ts-7000] DIO Interrupts

To:
Subject: Re: [ts-7000] DIO Interrupts
From: David Hawkins <>
Date: Fri, 02 Nov 2007 08:52:54 -0700
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/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU