[ECOS] How to make a Interrupt driven serial port driver?
Ling Su
lingsu@palmmicro.com
Sun Oct 29 18:28:00 GMT 2000
> 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
More information about the Ecos-discuss
mailing list