This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: interrupt-driven serial read


Andreas.Karlsson@combitechsystems.com wrote:
> 
> I would like to get an interrupt when there is data coming in on /dev/ser0.
> Then a function should read this data for a certain amount of time. Where to
> start? Is the "simple-serial" driver supporting interrupts on my AEB?
> 
> Can I specify buffers to place the data in until my read-function is called?

The AEB serial driver in eCos is interrupt-driven and has internal buffers
of its own (the size of which can be set in your configuration).

The classic way to do what you want is for you to dedicate a separate
worker thread to doing blocking reads from the serial device. When data
arrives, that thread then does any signalling (e.g. by posting a semaphore)
as required.

In practice, you may want to reduce overhead by just modifying the AEB
serial driver's DSR to do any signalling required there, that means you
don't have two places doing buffering.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]