This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Interrupts and Serial Ports
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Steve Knowlton <sknowlton at custom-mfg-eng dot com>
- Cc: Andrew Lunn <andrew at lunn dot ch>, ecos-discuss at sources dot redhat dot com
- Date: Tue, 9 Nov 2004 08:19:09 +0100
- Subject: Re: [ECOS] Interrupts and Serial Ports
- References: <53e0555cc0fb5972fe3b7b33d4cd3088418ccf3e@Custom> <20041108141601.GC3689@lunn.ch> <7d932f2516f9b8ef4aa38387e0688956419127a3@Custom>
On Mon, Nov 08, 2004 at 03:39:16PM -0500, Steve Knowlton wrote:
> Andrew,
>
> Thanks for the response. I'm pretty sure I am using the full driver and
> not the one for diagnostic output. I have the ports set up as /dev/ser0
> and /dev/ser1 in the config
> tool. I just need to know the correct way to read data from the port.
>
> I have set up a handle to the port using the cyg_io_lookup function and
> configuring
> it to 9600 baud ( plus the other parameters such as stop bits etc ) and
> set up
> for non blocking reads. I am looping through the cyg_io_read function at
> a rapid
> rate but am still not reading anything. I know that polling is not the
> best way to do
> this but I don't know how to set up an interrupt driven scheme since the
> driver is
> already using the interrupt vector. Is there a way to hook onto this
> interrupt vector
> so that I can use this interrupt to signal the arrival of data at the port?
The serial driver will be doing all the interrupt handling for you. So
just do a blocking read and you will be unblocked when the data
arrives.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss