OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [io-tty-driver.html] - Diff between revs 28 and 174

Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
> TTY driver</TITLE
> TTY driver</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="eCos Reference Manual"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
HREF="ecos-ref.html"><LINK
REL="UP"
REL="UP"
TITLE="Serial driver details"
TITLE="Serial driver details"
HREF="io-serial-driver-details.html"><LINK
HREF="io-serial-driver-details.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="Serial driver details"
TITLE="Serial driver details"
HREF="io-serial-driver-details.html"><LINK
HREF="io-serial-driver-details.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="How to Write a Driver"
TITLE="How to Write a Driver"
HREF="io-how-to-write-a-driver.html"></HEAD
HREF="io-how-to-write-a-driver.html"></HEAD
><BODY
><BODY
CLASS="SECTION"
CLASS="SECTION"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>eCos Reference Manual</TH
>eCos Reference Manual</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="io-serial-driver-details.html"
HREF="io-serial-driver-details.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
>Chapter 16. Serial driver details</TD
>Chapter 16. Serial driver details</TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="io-how-to-write-a-driver.html"
HREF="io-how-to-write-a-driver.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><DIV
><DIV
CLASS="SECTION"
CLASS="SECTION"
><H1
><H1
CLASS="SECTION"
CLASS="SECTION"
><A
><A
NAME="IO-TTY-DRIVER">TTY driver</H1
NAME="IO-TTY-DRIVER">TTY driver</H1
><P
><P
>Use the include file <TT
>Use the include file <TT
CLASS="FILENAME"
CLASS="FILENAME"
>&lt;cyg/io/ttyio.h&gt;</TT
>&lt;cyg/io/ttyio.h&gt;</TT
> for
> for
this driver.</P
this driver.</P
><P
><P
>This driver is built on top of the simple
>This driver is built on top of the simple
serial driver and is typically used for a device that interfaces with
serial driver and is typically used for a device that interfaces with
humans such as a terminal. It provides some minimal formatting of data
humans such as a terminal. It provides some minimal formatting of data
on output and allows for line-oriented editing on input.</P
on output and allows for line-oriented editing on input.</P
><DIV
><DIV
CLASS="SECTION"
CLASS="SECTION"
><H2
><H2
CLASS="SECTION"
CLASS="SECTION"
><A
><A
NAME="AEN10715">Runtime configuration</H2
NAME="AEN10715">Runtime configuration</H2
><P
><P
>Runtime configuration is achieved by exchanging data structures with
>Runtime configuration is achieved by exchanging data structures with
the driver via the <TT
the driver via the <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>cyg_io_set_config()</TT
>cyg_io_set_config()</TT
> and
> and
<TT
<TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>cyg_io_get_config()</TT
>cyg_io_get_config()</TT
> functions.</P
> functions.</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>typedef struct {
>typedef struct {
 cyg_uint32 tty_out_flags;
 cyg_uint32 tty_out_flags;
 cyg_uint32 tty_in_flags;
 cyg_uint32 tty_in_flags;
} cyg_tty_info_t;</PRE
} cyg_tty_info_t;</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>The field <TT
>The field <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_out_flags</I
>tty_out_flags</I
></TT
></TT
>
>
is used to control what happens to data as it is send to the serial
is used to control what happens to data as it is send to the serial
port. It contains a bitmap comprised of the bits as defined by the
port. It contains a bitmap comprised of the bits as defined by the
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYG_TTY_OUT_FLAGS_xxx</TT
>CYG_TTY_OUT_FLAGS_xxx</TT
> values below. </P
> values below. </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define CYG_TTY_OUT_FLAGS_CRLF 0x0001 // Map '\n' =&gt; '\n\r' on output</PRE
>#define CYG_TTY_OUT_FLAGS_CRLF 0x0001 // Map '\n' =&gt; '\n\r' on output</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this bit is set in <TT
>If this bit is set in <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_out_flags</I
>tty_out_flags</I
></TT
></TT
>,
>,
any occurrence of the character &quot;\n&quot; will
any occurrence of the character &quot;\n&quot; will
be replaced by the sequence &quot;\n\r&quot; before
be replaced by the sequence &quot;\n\r&quot; before
being sent to the device.</P
being sent to the device.</P
><P
><P
>The field <TT
>The field <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_in_flags</I
>tty_in_flags</I
></TT
></TT
>
>
is used to control how data is handled as it comes from the serial
is used to control how data is handled as it comes from the serial
port. It contains a bitmap comprised of the bits as defined by the
port. It contains a bitmap comprised of the bits as defined by the
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYG_TTY_IN_FLAGS_xxx</TT
>CYG_TTY_IN_FLAGS_xxx</TT
> values below. </P
> values below. </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define CYG_TTY_IN_FLAGS_CR 0x0001 // Map '\r' =&gt; '\n' on input</PRE
>#define CYG_TTY_IN_FLAGS_CR 0x0001 // Map '\r' =&gt; '\n' on input</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this bit is set in <TT
>If this bit is set in <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_in_flags</I
>tty_in_flags</I
></TT
></TT
>, the
>, the
character &quot;\r&quot; (&#8220;return&#8221; or &#8220;enter&#8221; on
character &quot;\r&quot; (&#8220;return&#8221; or &#8220;enter&#8221; on
most keyboards) will be mapped to &quot;\n&quot;.</P
most keyboards) will be mapped to &quot;\n&quot;.</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define CYG_TTY_IN_FLAGS_CRLF 0x0002 // Map '\n\r' =&gt; '\n' on input</PRE
>#define CYG_TTY_IN_FLAGS_CRLF 0x0002 // Map '\n\r' =&gt; '\n' on input</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this bit is set in <TT
>If this bit is set in <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_in_flags</I
>tty_in_flags</I
></TT
></TT
>, the
>, the
character sequence &quot;\n\r&quot; (often sent by DOS/Windows
character sequence &quot;\n\r&quot; (often sent by DOS/Windows
based terminals) will be mapped to &quot;\n&quot;. </P
based terminals) will be mapped to &quot;\n&quot;. </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define CYG_TTY_IN_FLAGS_BINARY 0x0004 // No input processing</PRE
>#define CYG_TTY_IN_FLAGS_BINARY 0x0004 // No input processing</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this bit is set in <TT
>If this bit is set in <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_in_flags</I
>tty_in_flags</I
></TT
></TT
>, the
>, the
input will not be manipulated in any way before being placed in
input will not be manipulated in any way before being placed in
the user&#8217;s buffer. </P
the user&#8217;s buffer. </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define CYG_TTY_IN_FLAGS_ECHO 0x0008 // Echo characters as processed</PRE
>#define CYG_TTY_IN_FLAGS_ECHO 0x0008 // Echo characters as processed</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this bit is set in <TT
>If this bit is set in <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>tty_in_flags</I
>tty_in_flags</I
></TT
></TT
>, characters
>, characters
will be echoed back to the serial port as they are processed. </P
will be echoed back to the serial port as they are processed. </P
></DIV
></DIV
><DIV
><DIV
CLASS="SECTION"
CLASS="SECTION"
><H2
><H2
CLASS="SECTION"
CLASS="SECTION"
><A
><A
NAME="AEN10742">API details</H2
NAME="AEN10742">API details</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cyg_io_read(handle, buf, len)</PRE
>cyg_io_read(handle, buf, len)</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>This function is used to read data from the device. In the
>This function is used to read data from the device. In the
default case, data is read until an end-of-line character ("\n"
default case, data is read until an end-of-line character ("\n"
or "\r") is read. Additionally, the characters are echoed
or "\r") is read. Additionally, the characters are echoed
back to the [terminal] device. Minimal editing
back to the [terminal] device. Minimal editing
of the input is also supported. </P
of the input is also supported. </P
><DIV
><DIV
CLASS="NOTE"
CLASS="NOTE"
><BLOCKQUOTE
><BLOCKQUOTE
CLASS="NOTE"
CLASS="NOTE"
><P
><P
><B
><B
>Note: </B
>Note: </B
>When connecting to a remote target via GDB it is not possible
>When connecting to a remote target via GDB it is not possible
to provide console input while GDB is connected. The GDB remote
to provide console input while GDB is connected. The GDB remote
protocol does not support input. Users must disconnect from GDB
protocol does not support input. Users must disconnect from GDB
if this functionality is required.</P
if this functionality is required.</P
></BLOCKQUOTE
></BLOCKQUOTE
></DIV
></DIV
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>
>
cyg_io_write(handle, buf, len)</PRE
cyg_io_write(handle, buf, len)</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>This function is used to send data to the device. In the default
>This function is used to send data to the device. In the default
case, the end-of-line character "\n" is replaced by the
case, the end-of-line character "\n" is replaced by the
sequence "\n\r". </P
sequence "\n\r". </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cyg_io_get_config(handle, key, buf, len)</PRE
>cyg_io_get_config(handle, key, buf, len)</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>This function is used to get information about the channel&#8217;s
>This function is used to get information about the channel&#8217;s
configuration at runtime. </P
configuration at runtime. </P
><P
><P
></P
></P
><DIV
><DIV
CLASS="VARIABLELIST"
CLASS="VARIABLELIST"
><DL
><DL
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYG_IO_GET_CONFIG_TTY_INFO</TT
>CYG_IO_GET_CONFIG_TTY_INFO</TT
></DT
></DT
><DD
><DD
><P
><P
></P
></P
><DIV
><DIV
CLASS="VARIABLELIST"
CLASS="VARIABLELIST"
><DL
><DL
><DT
><DT
>Buf type:</DT
>Buf type:</DT
><DD
><DD
><P
><P
>cyg_tty_info_t</P
>cyg_tty_info_t</P
></DD
></DD
><DT
><DT
>Function:</DT
>Function:</DT
><DD
><DD
><P
><P
>This function retrieves the current state of the
>This function retrieves the current state of the
            driver.
            driver.
            </P
            </P
></DD
></DD
></DL
></DL
></DIV
></DIV
></DD
></DD
></DL
></DL
></DIV
></DIV
><P
><P
>Serial driver keys (see above) may also be specified
>Serial driver keys (see above) may also be specified
in which case the call is passed directly to the serial
in which case the call is passed directly to the serial
driver. </P
driver. </P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cyg_io_set_config(handle, key, buf, len)</PRE
>cyg_io_set_config(handle, key, buf, len)</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>This function is used to modify the channel&#8217;s configuration
>This function is used to modify the channel&#8217;s configuration
at runtime. </P
at runtime. </P
><P
><P
></P
></P
><DIV
><DIV
CLASS="VARIABLELIST"
CLASS="VARIABLELIST"
><DL
><DL
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYG_IO_SET_CONFIG_TTY_INFO</TT
>CYG_IO_SET_CONFIG_TTY_INFO</TT
></DT
></DT
><DD
><DD
><P
><P
></P
></P
><DIV
><DIV
CLASS="VARIABLELIST"
CLASS="VARIABLELIST"
><DL
><DL
><DT
><DT
>Buf type:</DT
>Buf type:</DT
><DD
><DD
><P
><P
>cyg_tty_info_t</P
>cyg_tty_info_t</P
></DD
></DD
><DT
><DT
>Function:</DT
>Function:</DT
><DD
><DD
><P
><P
>This function changes the current state of the
>This function changes the current state of the
            driver.</P
            driver.</P
></DD
></DD
></DL
></DL
></DIV
></DIV
></DD
></DD
></DL
></DL
></DIV
></DIV
><P
><P
>Serial driver
>Serial driver
keys (see above) may also be specified in which case the
keys (see above) may also be specified in which case the
call is passed directly to the serial driver. </P
call is passed directly to the serial driver. </P
></DIV
></DIV
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="io-serial-driver-details.html"
HREF="io-serial-driver-details.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ecos-ref.html"
HREF="ecos-ref.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="io-how-to-write-a-driver.html"
HREF="io-how-to-write-a-driver.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
>Serial driver details</TD
>Serial driver details</TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="io-serial-driver-details.html"
HREF="io-serial-driver-details.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
>How to Write a Driver</TD
>How to Write a Driver</TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.