This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to make a Interrupt driven serial port driver?
- To: "Jonathan Larmour" <jlarmour at redhat dot com>
- Subject: Re: [ECOS] How to make a Interrupt driven serial port driver?
- From: "Ling Su" <lingsu at palmmicro dot com>
- Date: Sun, 29 Oct 2000 18:30:22 -0800
- Cc: <ecos-discuss at sources dot redhat dot com>
- References: <003d01c0407a$0f66d880$1201a8c0@crusoe> <39FC9A15.8DBAA00C@redhat.com>
> Look at the end of the serial driver, above the DSR. Here's what it says:
>
> // Note: This device presents a single interrupt for both channels. Thus
> the
> // interrupt handler has to query the device and decide which channel
needs
> service.
>
> and indeed in the code:
>
>
> stat = scc_read_ctl(port, R3);
> if (stat & (RR3_AExt | RR3_ATxIP | RR3_ARxIP)) {
> chan = vrc4373_chans[0]; // Hardware channel A
> vrc4373_int(chan, stat>>3); // Handle interrupt
> } else if (stat & (RR3_BExt | RR3_BTxIP | RR3_BRxIP)) {
> chan = vrc4373_chans[1]; // Hardware channel A
> vrc4373_int(chan, stat); // Handle interrupt
> } else {
>
> Although the second comment is wrong (it should be channel A then channel
> B, not two channel A's obviously) - I'll fix that now.
>
> So in fact it should already be interrupt driven.
>
> Or instead are you asking for some sort of automatic notification to your
> application when data arrives?
>
Yeah, exactly, what I am asking is how to make a kind of automatic
notification to my application, so that my own serial port handler can
continue process that data when data arrives. Any clue? Thanks!
Rgds,
-Ling