public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Runtime changing of serial port baud rate
@ 2001-05-21 22:57 Ho Shui Choy Stanley PS03B NCS
  0 siblings, 0 replies; 4+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-21 22:57 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

Does eCos support runtime changing of serial port baud rate?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Runtime changing of serial port baud rate
  2001-05-22  6:00 ` Jonathan Larmour
@ 2001-05-22  6:13   ` Jesper Skov
  0 siblings, 0 replies; 4+ messages in thread
From: Jesper Skov @ 2001-05-22  6:13 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: rob.wj.jansen, ecos-discuss, Jesper Skov

>>>>> "Jonathan" == Jonathan Larmour <jlarmour@redhat.com> writes:

Jonathan> Jesper, I'd be interested in what
Jonathan> CYGACC_CALL_IF_SET_SERIAL_BAUD() is for in the case. Just
Jonathan> "legacy" CygMon stuff and should be ignored?

Yes, exactly. We should weed out the unused legacy entries as we
decided back in Jan but since it doesn't really break anything it's
been on the backburner...

Jesper

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Runtime changing of serial port baud rate
  2001-05-22  1:29 rob.wj.jansen
@ 2001-05-22  6:00 ` Jonathan Larmour
  2001-05-22  6:13   ` Jesper Skov
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Larmour @ 2001-05-22  6:00 UTC (permalink / raw)
  To: rob.wj.jansen; +Cc: ecos-discuss, Jesper Skov

rob.wj.jansen@philips.com wrote:
> 
> Stanley,
> 
> > Does eCos support runtime changing of serial port baud rate?
> >
> > Thanks
> > Stanley
> 
> Yes, but only if you use the serial driver instead of the diagnostics I/O.
> Look at the chapters 11 and 12 in the eCos Reference Manual.

In a small number of cases it's also true for the diagnostic I/O. Gary
Thomas recently added this for sa11x0 diag. You would need to include
<cyg/hal/hal_if.h> and use CYGACC_COMM_IF_CONTROL(). You can see an example
in redboot/current/src/main.c:set_console_baud_rate().

Jesper, I'd be interested in what CYGACC_CALL_IF_SET_SERIAL_BAUD() is for
in the case. Just "legacy" CygMon stuff and should be ignored?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Runtime changing of serial port baud rate
@ 2001-05-22  1:29 rob.wj.jansen
  2001-05-22  6:00 ` Jonathan Larmour
  0 siblings, 1 reply; 4+ messages in thread
From: rob.wj.jansen @ 2001-05-22  1:29 UTC (permalink / raw)
  To: ecos-discuss

Stanley,

> Does eCos support runtime changing of serial port baud rate?
>
> Thanks
> Stanley

Yes, but only if you use the serial driver instead of the diagnostics I/O.
Look at the chapters 11 and 12 in the eCos Reference Manual.

Setting the baudrate involves some magic with the cyg_io_***_config functions:

    cyg_io_handle_t      ser_handle;
    cyg_io_serial_info_t ser_info;

    cyg_io_lookup("/dev/ser1", &ser_handle);
    cyg_io_get_config(ser_handle, CYG_IO_GET_CONFIG_SERIAL_INFO, &ser_info, sizeof(ser_info));

    ser_info.baud        = CYGNUM_SERIAL_BAUD_110;
    ser_info.word_length = CYGNUM_SERIAL_WORD_LENGTH_7;

    cyg_io_set_config(ser_handle, CYG_IO_SET_CONFIG_SERIAL_INFO, &ser_info, sizeof(ser_info));

You might want to add the obvious #include lines, checks for the error values returned and
maybe some other baudrate figures (but these ones enable you to use your old mechanical TTY ;-)

Cheers,

	Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-05-22  6:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-21 22:57 [ECOS] Runtime changing of serial port baud rate Ho Shui Choy Stanley PS03B NCS
2001-05-22  1:29 rob.wj.jansen
2001-05-22  6:00 ` Jonathan Larmour
2001-05-22  6:13   ` Jesper Skov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).