Api details – Comtrol eCos User Manual

Page 376

Advertising
background image

Chapter 16. Serial driver details

If this bit is set in

tty_in_flags

, the character sequence "\n\r" (often sent by DOS/Windows based terminals)

will be mapped to "\n".

#define CYG_TTY_IN_FLAGS_BINARY 0x0004 // No input processing

If this bit is set in

tty_in_flags

, the input will not be manipulated in any way before being placed in the user’s

buffer.

#define CYG_TTY_IN_FLAGS_ECHO 0x0008 // Echo characters as processed

If this bit is set in

tty_in_flags

, characters will be echoed back to the serial port as they are processed.

API details

cyg_io_read(handle, buf, len)

This function is used to read data from the device. In the default case, data is read until an end-of-line character
("\n" or "\r") is read. Additionally, the characters are echoed back to the [terminal] device. Minimal editing of the
input is also supported.

Note: When connecting to a remote target via GDB it is not possible to provide console input while GDB is con-
nected. The GDB remote protocol does not support input. Users must disconnect from GDB if this functionality
is required.

cyg_io_write(handle, buf, len)

This function is used to send data to the device. In the default case, the end-of-line character "\n" is replaced by the
sequence "\n\r".

cyg_io_get_config(handle, key, buf, len)

This function is used to get information about the channel’s configuration at runtime.

CYG_IO_GET_CONFIG_TTY_INFO

Buf type:

cyg_tty_info_t

Function:

This function retrieves the current state of the driver.

Serial driver keys (see above) may also be specified in which case the call is passed directly to the serial driver.

cyg_io_set_config(handle, key, buf, len)

272

Advertising