This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Connecting stdin and stdout to serial port...


"Russ.Shaw" wrote:
> 
> Hi all,
> 
> I'm using gcc for the H8/3048, and am using the standard
> C libraries.
> 
> To use scanf(), printf() etc, files need to be defined
> for stdin and stdout. Somehow, these have to be connected
> to the input and output of the rs232 serial port.
> 
> What's the usual way of doing this?
> 
> I currently have an array that gets filled by received
> characters (interrupt driven), and an output array that
> gets its contents emptied out the serial port when a
> function triggers the tx interrupt. After the array
> empties, the tx interrupt is disabled.

If you were using RTEMS <hint>, you would have named
devices like under UNIX and it would work just like 
under UNIX -- including POSIX termios support.

The other way is to write support for open, etc. that knows
what integer file descriptor is associated with each
serial port and does the magic.

> --
> *******************************************
> *   Russell Shaw, B.Eng, M.Eng(Research)  *
> *      email: russell@webaxs.net          *
> *      Australia                          *
> *******************************************
> 
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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