public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: rob.wj.jansen@philips.com
To: <ecos-discuss@sources.redhat.com>
Subject: Re: [ECOS] Runtime changing of serial port baud rate
Date: Tue, 22 May 2001 01:29:00 -0000	[thread overview]
Message-ID: <0056890030122957000002L972*@MHS> (raw)

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

             reply	other threads:[~2001-05-22  1:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22  1:29 rob.wj.jansen [this message]
2001-05-22  6:00 ` Jonathan Larmour
2001-05-22  6:13   ` Jesper Skov
  -- strict thread matches above, loose matches on Subject: below --
2001-05-21 22:57 Ho Shui Choy Stanley PS03B NCS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='0056890030122957000002L972*@MHS' \
    --to=rob.wj.jansen@philips.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).