RTEMS  5.0.0
Macros | Functions | Variables
termios.c File Reference
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/imfs.h>
#include <rtems/score/assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <sys/fcntl.h>
#include <sys/filio.h>
#include <sys/ttycom.h>
#include <rtems/termiostypes.h>

Macros

#define CBUFSIZE   (rtems_termios_cbufsize)
 
#define RAW_INPUT_BUFFER_SIZE   (rtems_termios_raw_input_size)
 
#define RAW_OUTPUT_BUFFER_SIZE   (rtems_termios_raw_output_size)
 
#define FL_IREQXOF   1U /* input queue requests stop of incoming data */
 
#define FL_ISNTXOF   2U /* XOFF has been sent to other side of line */
 
#define FL_IRTSOFF   4U /* RTS has been turned off for other side.. */
 
#define FL_ORCVXOF   0x10U /* XOFF has been received */
 
#define FL_OSTOP   0x20U /* output has been stopped due to XOFF */
 
#define FL_MDRTS   0x100U /* input controlled with RTS/CTS handshake */
 
#define FL_MDXON   0x200U /* input controlled with XON/XOFF protocol */
 
#define FL_MDXOF   0x400U /* output controlled with XON/XOFF protocol */
 
#define NODISC(n)
 
#define TERMIOS_TXTASK_PRIO   10
 
#define TERMIOS_RXTASK_PRIO   9
 
#define TERMIOS_TXTASK_STACKSIZE   1024
 
#define TERMIOS_RXTASK_STACKSIZE   1024
 
#define TERMIOS_TX_START_EVENT   RTEMS_EVENT_1
 
#define TERMIOS_TX_TERMINATE_EVENT   RTEMS_EVENT_0
 
#define TERMIOS_RX_PROC_EVENT   RTEMS_EVENT_1
 
#define TERMIOS_RX_TERMINATE_EVENT   RTEMS_EVENT_0
 

Functions

rtems_status_code rtems_termios_device_install (const char *device_file, const rtems_termios_device_handler *handler, const rtems_termios_device_flow *flow, rtems_termios_device_context *context)
 Installs a Termios device. More...
 
rtems_status_code rtems_termios_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks)
 
rtems_status_code rtems_termios_close (void *arg)
 
rtems_status_code rtems_termios_bufsize (size_t cbufsize, size_t raw_input, size_t raw_output)
 
rtems_status_code rtems_termios_ioctl (void *arg)
 
void rtems_termios_puts (const void *_buf, size_t len, struct rtems_termios_tty *tty)
 
rtems_status_code rtems_termios_write (void *arg)
 
rtems_status_code rtems_termios_read (void *arg)
 
void rtems_termios_rxirq_occured (struct rtems_termios_tty *tty)
 
int rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
 
int rtems_termios_dequeue_characters (void *ttyp, int len)
 

Variables

struct rtems_termios_linesw rtems_termios_linesw [MAXLDISC]
 
int rtems_termios_nlinesw
 

Detailed Description

TERMIOS serial line support

Macro Definition Documentation

◆ NODISC

#define NODISC (   n)
Value:
{ NULL, NULL, NULL, NULL, \
NULL, NULL, NULL, NULL }
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77

Function Documentation

◆ rtems_termios_device_install()

rtems_status_code rtems_termios_device_install ( const char *  device_file,
const rtems_termios_device_handler handler,
const rtems_termios_device_flow flow,
rtems_termios_device_context context 
)

Installs a Termios device.

The installed Termios device may be removed via unlink().

Parameters
[in]device_fileThe device file path.
[in]handlerThe device handler. It must be persistent throughout the installed time of the device.
[in]flowThe device flow control handler. The device flow control handler are optional and may be NULL. If present must be persistent throughout the installed time of the device.
[in]contextThe device context. It must be persistent throughout the installed time of the device.
Return values
RTEMS_SUCCESSFULSuccessful operation.
RTEMS_NO_MEMORYNot enough memory to create a device node.
RTEMS_UNSATISFIEDCreation of the device file failed.
RTEMS_INCORRECT_STATETermios is not initialized.
See also
rtems_termios_get_device_context().

Variable Documentation

◆ rtems_termios_linesw

Initial value:
=
{
NODISC(0),
NODISC(1),
NODISC(2),
NODISC(3),
NODISC(4),
NODISC(5),
NODISC(6),
NODISC(7),
}

◆ rtems_termios_nlinesw

int rtems_termios_nlinesw
Initial value:
=
Definition: termiostypes.h:479