summaryrefslogtreecommitdiff
path: root/cesar/ecos/packages/io/serial/current/include
diff options
context:
space:
mode:
authorsave2008-04-07 14:17:42 +0000
committersave2008-04-07 14:17:42 +0000
commit3d58a62727346b7ac1a6cb36fed1a06ed72228dd (patch)
treed7788c3cf9f76426aef0286d0202e2097f0fa0eb /cesar/ecos/packages/io/serial/current/include
parent095dca4b0a8d4924093bab424f71f588fdd84613 (diff)
Moved the complete svn base into the cesar directory.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1769 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ecos/packages/io/serial/current/include')
-rw-r--r--cesar/ecos/packages/io/serial/current/include/serial.h277
-rw-r--r--cesar/ecos/packages/io/serial/current/include/serialio.h212
-rw-r--r--cesar/ecos/packages/io/serial/current/include/ttyio.h89
3 files changed, 578 insertions, 0 deletions
diff --git a/cesar/ecos/packages/io/serial/current/include/serial.h b/cesar/ecos/packages/io/serial/current/include/serial.h
new file mode 100644
index 0000000000..7804d04926
--- /dev/null
+++ b/cesar/ecos/packages/io/serial/current/include/serial.h
@@ -0,0 +1,277 @@
+#ifndef CYGONCE_SERIAL_H
+#define CYGONCE_SERIAL_H
+// ====================================================================
+//
+// serial.h
+//
+// Device I/O
+//
+// ====================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+// ====================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas
+// Date: 1999-02-04
+// Purpose: Internal interfaces for serial I/O drivers
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+// ====================================================================
+
+// Serial I/O interfaces
+
+#include <pkgconf/system.h>
+#include <pkgconf/io_serial.h>
+
+#include <cyg/infra/cyg_type.h>
+#include <cyg/io/io.h>
+#include <cyg/io/serialio.h>
+#include <cyg/io/devtab.h>
+#include <cyg/hal/drv_api.h>
+
+#ifdef CYGPKG_IO_SERIAL_SELECT_SUPPORT
+#include <cyg/fileio/fileio.h>
+#endif
+
+typedef struct serial_channel serial_channel;
+typedef struct serial_funs serial_funs;
+
+// The block transfer request functions may fail for one of two
+// reasons. It's important for the caller to know which.
+typedef enum {
+ CYG_RCV_OK,
+ CYG_RCV_FULL,
+ CYG_RCV_DISABLED
+} rcv_req_reply_t;
+
+typedef enum {
+ CYG_XMT_OK,
+ CYG_XMT_EMPTY,
+ CYG_XMT_DISABLED
+} xmt_req_reply_t;
+
+// Pointers into upper-level driver which interrupt handlers need
+typedef struct {
+ // Initialize the channel
+ void (*serial_init)(serial_channel *chan);
+ // Cause an additional character to be output if one is available
+ void (*xmt_char)(serial_channel *chan);
+ // Consume an input character
+ void (*rcv_char)(serial_channel *chan, unsigned char c);
+#if CYGINT_IO_SERIAL_BLOCK_TRANSFER
+ // Request space for input characters
+ rcv_req_reply_t (*data_rcv_req)(serial_channel *chan, int avail,
+ int* space_avail, unsigned char** space);
+ // Receive operation completed
+ void (*data_rcv_done)(serial_channel *chan, int chars_rcvd);
+ // Request characters for transmission
+ xmt_req_reply_t (*data_xmt_req)(serial_channel *chan, int space,
+ int* chars_avail, unsigned char** chars);
+ // Transmit operation completed
+ void (*data_xmt_done)(serial_channel *chan, int chars_sent);
+#endif
+#if defined(CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS)
+ void (*indicate_status)(serial_channel *chan, cyg_serial_line_status_t *s );
+#endif
+} serial_callbacks_t;
+
+#if CYGINT_IO_SERIAL_BLOCK_TRANSFER
+# ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+# define SERIAL_CALLBACKS(_l,_init,_xmt_char,_rcv_char, _data_rcv_req, _data_rcv_done, _data_xmt_req, _data_xmt_done, _indicate_status) \
+serial_callbacks_t _l = { \
+ _init, \
+ _xmt_char, \
+ _rcv_char, \
+ _data_rcv_req, \
+ _data_rcv_done, \
+ _data_xmt_req, \
+ _data_xmt_done, \
+ _indicate_status \
+};
+# else
+# define SERIAL_CALLBACKS(_l,_init,_xmt_char,_rcv_char, _data_rcv_req, _data_rcv_done, _data_xmt_req, _data_xmt_done) \
+serial_callbacks_t _l = { \
+ _init, \
+ _xmt_char, \
+ _rcv_char, \
+ _data_rcv_req, \
+ _data_rcv_done, \
+ _data_xmt_req, \
+ _data_xmt_done \
+};
+# endif
+#else
+# ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+# define SERIAL_CALLBACKS(_l,_init,_xmt_char,_rcv_char,_indicate_status) \
+serial_callbacks_t _l = { \
+ _init, \
+ _xmt_char, \
+ _rcv_char, \
+ _indicate_status \
+};
+# else
+# define SERIAL_CALLBACKS(_l,_init,_xmt_char,_rcv_char) \
+serial_callbacks_t _l = { \
+ _init, \
+ _xmt_char, \
+ _rcv_char \
+};
+# endif
+#endif
+
+extern serial_callbacks_t cyg_io_serial_callbacks;
+
+typedef struct {
+ unsigned char *data;
+ volatile int put;
+ volatile int get;
+ int len;
+ volatile int nb; // count of bytes currently in buffer
+ int low_water; // For tx: min space in buffer before restart
+ // For rx: max buffer used before flow unthrottled
+#ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL
+ int high_water; // For tx: unused
+ // For rx: min buffer used before throttle
+#endif
+ cyg_drv_cond_t wait;
+ cyg_drv_mutex_t lock;
+ bool waiting;
+#ifdef CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING
+ bool blocking;
+#endif
+ volatile bool abort; // Set by an outsider to kill processing
+ volatile cyg_int32 pending; // This many bytes waiting to be sent
+#ifdef CYGPKG_IO_SERIAL_SELECT_SUPPORT
+ struct CYG_SELINFO_TAG selinfo; // select info
+#endif
+
+#ifdef CYGDBG_USE_ASSERTS
+#ifdef CYGINT_IO_SERIAL_BLOCK_TRANSFER
+ bool block_mode_xfer_running;
+#endif // CYGINT_IO_SERIAL_BLOCK_TRANSFER
+#endif // CYGDBG_USE_ASSERTS
+} cbuf_t;
+
+#define CBUF_INIT(_data, _len) \
+ {_data, 0, 0, _len}
+
+#ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL
+typedef struct {
+ cyg_uint32 flags;
+#ifdef CYGOPT_IO_SERIAL_FLOW_CONTROL_SOFTWARE
+ cyg_uint8 xchar;
+#endif
+} flow_desc_t;
+#endif
+
+// Private data which describes this channel
+struct serial_channel {
+ serial_funs *funs;
+ serial_callbacks_t *callbacks;
+ void *dev_priv; // Whatever is needed by actual device routines
+ cyg_serial_info_t config; // Current configuration
+ bool init;
+ cbuf_t out_cbuf;
+ cbuf_t in_cbuf;
+#ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL
+ flow_desc_t flow_desc;
+#endif
+#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+ cyg_serial_line_status_callback_fn_t status_callback;
+ CYG_ADDRWORD status_callback_priv;
+#endif
+};
+
+// Flow descriptor flag values
+#define CYG_SERIAL_FLOW_OUT_THROTTLED (1<<0)
+#define CYG_SERIAL_FLOW_IN_THROTTLED (1<<1)
+
+// Initialization macro for serial channel
+#define SERIAL_CHANNEL(_l, \
+ _funs, \
+ _dev_priv, \
+ _baud, _stop, _parity, _word_length, _flags) \
+serial_channel _l = { \
+ &_funs, \
+ &cyg_io_serial_callbacks, \
+ &(_dev_priv), \
+ CYG_SERIAL_INFO_INIT(_baud, _stop, _parity, _word_length, _flags), \
+};
+
+#define SERIAL_CHANNEL_USING_INTERRUPTS(_l, \
+ _funs, \
+ _dev_priv, \
+ _baud, _stop, _parity, _word_length, _flags, \
+ _out_buf, _out_buflen, \
+ _in_buf, _in_buflen) \
+serial_channel _l = { \
+ &_funs, \
+ &cyg_io_serial_callbacks, \
+ &(_dev_priv), \
+ CYG_SERIAL_INFO_INIT(_baud, _stop, _parity, _word_length, _flags), \
+ false, \
+ CBUF_INIT(_out_buf, _out_buflen), \
+ CBUF_INIT(_in_buf, _in_buflen) \
+};
+
+// Low level interface functions
+struct serial_funs {
+ // Send one character to the output device, return true if consumed
+ bool (*putc)(serial_channel *priv, unsigned char c);
+ // Fetch one character from the device
+ unsigned char (*getc)(serial_channel *priv);
+ // Change hardware configuration (baud rate, etc)
+ Cyg_ErrNo (*set_config)(serial_channel *priv, cyg_uint32 key, const void *xbuf,
+ cyg_uint32 *len);
+ // Enable the transmit channel and turn on transmit interrupts
+ void (*start_xmit)(serial_channel *priv);
+ // Disable the transmit channel and turn transmit interrupts off
+ void (*stop_xmit)(serial_channel *priv);
+};
+
+#define SERIAL_FUNS(_l,_putc,_getc,_set_config,_start_xmit,_stop_xmit) \
+serial_funs _l = { \
+ _putc, \
+ _getc, \
+ _set_config, \
+ _start_xmit, \
+ _stop_xmit \
+};
+
+extern cyg_devio_table_t cyg_io_serial_devio;
+
+#endif // CYGONCE_SERIAL_H
diff --git a/cesar/ecos/packages/io/serial/current/include/serialio.h b/cesar/ecos/packages/io/serial/current/include/serialio.h
new file mode 100644
index 0000000000..7d5f53c7ac
--- /dev/null
+++ b/cesar/ecos/packages/io/serial/current/include/serialio.h
@@ -0,0 +1,212 @@
+#ifndef CYGONCE_SERIALIO_H
+#define CYGONCE_SERIALIO_H
+// ====================================================================
+//
+// serialio.h
+//
+// Device I/O
+//
+// ====================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+// ====================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas
+// Date: 1999-02-04
+// Purpose: Special support for serial I/O devices
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+// ====================================================================
+
+// This file contains the user-level visible I/O interfaces
+
+#include <pkgconf/system.h>
+#include <pkgconf/io_serial.h>
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/io/config_keys.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Supported baud rates
+typedef enum {
+ CYGNUM_SERIAL_BAUD_50 = 1,
+ CYGNUM_SERIAL_BAUD_75,
+ CYGNUM_SERIAL_BAUD_110,
+ CYGNUM_SERIAL_BAUD_134_5,
+ CYGNUM_SERIAL_BAUD_150,
+ CYGNUM_SERIAL_BAUD_200,
+ CYGNUM_SERIAL_BAUD_300,
+ CYGNUM_SERIAL_BAUD_600,
+ CYGNUM_SERIAL_BAUD_1200,
+ CYGNUM_SERIAL_BAUD_1800,
+ CYGNUM_SERIAL_BAUD_2400,
+ CYGNUM_SERIAL_BAUD_3600,
+ CYGNUM_SERIAL_BAUD_4800,
+ CYGNUM_SERIAL_BAUD_7200,
+ CYGNUM_SERIAL_BAUD_9600,
+ CYGNUM_SERIAL_BAUD_14400,
+ CYGNUM_SERIAL_BAUD_19200,
+ CYGNUM_SERIAL_BAUD_38400,
+ CYGNUM_SERIAL_BAUD_57600,
+ CYGNUM_SERIAL_BAUD_115200,
+ CYGNUM_SERIAL_BAUD_230400
+} cyg_serial_baud_rate_t;
+#define CYGNUM_SERIAL_BAUD_MIN CYGNUM_SERIAL_BAUD_50
+#define CYGNUM_SERIAL_BAUD_MAX CYGNUM_SERIAL_BAUD_230400
+
+// Note: two levels of macro are required to get proper expansion.
+#define _CYG_SERIAL_BAUD_RATE(n) CYGNUM_SERIAL_BAUD_##n
+#define CYG_SERIAL_BAUD_RATE(n) _CYG_SERIAL_BAUD_RATE(n)
+
+// Stop bit selections
+typedef enum {
+ CYGNUM_SERIAL_STOP_1 = 1,
+ CYGNUM_SERIAL_STOP_1_5,
+ CYGNUM_SERIAL_STOP_2
+} cyg_serial_stop_bits_t;
+
+// Parity modes
+typedef enum {
+ CYGNUM_SERIAL_PARITY_NONE = 0,
+ CYGNUM_SERIAL_PARITY_EVEN,
+ CYGNUM_SERIAL_PARITY_ODD,
+ CYGNUM_SERIAL_PARITY_MARK,
+ CYGNUM_SERIAL_PARITY_SPACE
+} cyg_serial_parity_t;
+
+// Word length
+typedef enum {
+ CYGNUM_SERIAL_WORD_LENGTH_5 = 5,
+ CYGNUM_SERIAL_WORD_LENGTH_6,
+ CYGNUM_SERIAL_WORD_LENGTH_7,
+ CYGNUM_SERIAL_WORD_LENGTH_8
+} cyg_serial_word_length_t;
+
+typedef struct {
+ cyg_serial_baud_rate_t baud;
+ cyg_serial_stop_bits_t stop;
+ cyg_serial_parity_t parity;
+ cyg_serial_word_length_t word_length;
+ cyg_uint32 flags;
+} cyg_serial_info_t;
+
+// cyg_serial_info_t flags
+#define CYGNUM_SERIAL_FLOW_NONE (0)
+// receive flow control, send xon/xoff when necessary:
+#define CYGNUM_SERIAL_FLOW_XONXOFF_RX (1<<0)
+// transmit flow control, act on received xon/xoff:
+#define CYGNUM_SERIAL_FLOW_XONXOFF_TX (1<<1)
+// receive flow control, send RTS when necessary:
+#define CYGNUM_SERIAL_FLOW_RTSCTS_RX (1<<2)
+// transmit flow control, act when not CTS:
+#define CYGNUM_SERIAL_FLOW_RTSCTS_TX (1<<3)
+// receive flow control, send DTR when necessary:
+#define CYGNUM_SERIAL_FLOW_DSRDTR_RX (1<<4)
+// transmit flow control, act when not DSR:
+#define CYGNUM_SERIAL_FLOW_DSRDTR_TX (1<<5)
+
+// arguments for CYG_IO_SET_CONFIG_SERIAL_FLOW_CONTROL_FORCE
+#define CYGNUM_SERIAL_FLOW_THROTTLE_RX 0
+#define CYGNUM_SERIAL_FLOW_RESTART_RX 1
+#define CYGNUM_SERIAL_FLOW_THROTTLE_TX 2
+#define CYGNUM_SERIAL_FLOW_RESTART_TX 3
+
+// arguments for CYG_IO_SET_CONFIG_SERIAL_HW_RX_FLOW_THROTTLE
+#define CYGNUM_SERIAL_FLOW_HW_UNTHROTTLE 0
+#define CYGNUM_SERIAL_FLOW_HW_THROTTLE 0
+#define CYGNUM_SERIAL_FLOW_HW_UNTHROTTLE 0
+
+typedef struct {
+ cyg_int32 rx_bufsize;
+ cyg_int32 rx_count;
+ cyg_int32 tx_bufsize;
+ cyg_int32 tx_count;
+} cyg_serial_buf_info_t;
+
+#define CYG_SERIAL_INFO_INIT(_baud,_stop,_parity,_word_length,_flags) \
+ { _baud, _stop, _parity, _word_length, _flags}
+
+#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+
+# define CYGNUM_SERIAL_STATUS_FLOW 0
+# define CYGNUM_SERIAL_STATUS_BREAK 1
+# define CYGNUM_SERIAL_STATUS_FRAMEERR 2
+# define CYGNUM_SERIAL_STATUS_PARITYERR 3
+# define CYGNUM_SERIAL_STATUS_OVERRUNERR 4
+# define CYGNUM_SERIAL_STATUS_CARRIERDETECT 5
+# define CYGNUM_SERIAL_STATUS_RINGINDICATOR 6
+
+typedef struct {
+ cyg_uint32 which; // one of CYGNUM_SERIAL_STATUS_* above
+ cyg_uint32 value; // and its value
+} cyg_serial_line_status_t;
+
+typedef void (*cyg_serial_line_status_callback_fn_t)(
+ cyg_serial_line_status_t *s,
+ CYG_ADDRWORD priv );
+typedef struct {
+ cyg_serial_line_status_callback_fn_t fn;
+ CYG_ADDRWORD priv;
+} cyg_serial_line_status_callback_t;
+
+#endif // ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+
+// Default configuration
+#define CYG_SERIAL_BAUD_DEFAULT CYGNUM_SERIAL_BAUD_38400
+#define CYG_SERIAL_STOP_DEFAULT CYGNUM_SERIAL_STOP_1
+#define CYG_SERIAL_PARITY_DEFAULT CYGNUM_SERIAL_PARITY_NONE
+#define CYG_SERIAL_WORD_LENGTH_DEFAULT CYGNUM_SERIAL_WORD_LENGTH_8
+
+#ifdef CYGDAT_IO_SERIAL_FLOW_CONTROL_DEFAULT_XONXOFF
+# define CYG_SERIAL_FLAGS_DEFAULT (CYGNUM_SERIAL_FLOW_XONXOFF_RX|CYGNUM_SERIAL_FLOW_XONXOFF_TX)
+#elif defined(CYGDAT_IO_SERIAL_FLOW_CONTROL_DEFAULT_RTSCTS)
+# define CYG_SERIAL_FLAGS_DEFAULT (CYGNUM_SERIAL_FLOW_RTSCTS_RX|CYGNUM_SERIAL_FLOW_RTSCTS_TX)
+#elif defined(CYGDAT_IO_SERIAL_FLOW_CONTROL_DEFAULT_DSRDTR)
+# define CYG_SERIAL_FLAGS_DEFAULT (CYGNUM_SERIAL_FLOW_DSRDTR_RX|CYGNUM_SERIAL_FLOW_DSRDTR_TX)
+#else
+# define CYG_SERIAL_FLAGS_DEFAULT 0
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CYGONCE_SERIALIO_H */
+/* EOF serialio.h */
diff --git a/cesar/ecos/packages/io/serial/current/include/ttyio.h b/cesar/ecos/packages/io/serial/current/include/ttyio.h
new file mode 100644
index 0000000000..2505cc4fce
--- /dev/null
+++ b/cesar/ecos/packages/io/serial/current/include/ttyio.h
@@ -0,0 +1,89 @@
+#ifndef CYGONCE_TTYIO_H
+#define CYGONCE_TTYIO_H
+// ====================================================================
+//
+// ttyio.h
+//
+// Device I/O
+//
+// ====================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+// ====================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas
+// Date: 1999-02-04
+// Purpose: Special support for tty I/O devices
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+// ====================================================================
+
+// This file contains the user-level visible I/O interfaces
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/io/serialio.h>
+#include <cyg/io/config_keys.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ cyg_uint32 tty_out_flags;
+ cyg_uint32 tty_in_flags;
+} cyg_tty_info_t;
+
+// TTY flags - used to control behaviour when sending data to tty
+#define CYG_TTY_OUT_FLAGS_CRLF 0x0001 // Map '\n' => '\r\n' on output
+
+#define CYG_TTY_OUT_FLAGS_DEFAULT (CYG_TTY_OUT_FLAGS_CRLF)
+
+// TTY flags - used to control behaviour when receiving data from tty
+#define CYG_TTY_IN_FLAGS_CR 0x0001 // Map '\r' => '\n' on input
+#define CYG_TTY_IN_FLAGS_CRLF 0x0002 // Map '\r\n' => '\n' on input
+#define CYG_TTY_IN_FLAGS_ECHO 0x0004 // Echo characters as processed
+#define CYG_TTY_IN_FLAGS_BINARY 0x0008 // No input processing
+
+#define CYG_TTY_IN_FLAGS_DEFAULT (CYG_TTY_IN_FLAGS_CR|CYG_TTY_IN_FLAGS_ECHO)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CYGONCE_TTYIO_H */
+/* EOF ttyio.h */