Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Typedefs | Functions
termios.h File Reference

Go to the source code of this file.

Data Structures

struct  termios
 
struct  winsize
 

Macros

#define NCCS   32
 
#define IGNBRK   0000001
 
#define BRKINT   0000002
 
#define IGNPAR   0000004
 
#define INPCK   0000020
 
#define ISTRIP   0000040
 
#define INLCR   0000100
 
#define IGNCR   0000200
 
#define ICRNL   0000400
 
#define IXON   0002000
 
#define IXOFF   0010000
 
#define OPOST   0000001 /* Output is processed at all */
 
#define ONLCR   0000004 /* A newline goes out as a return and a newline */
 
#define CS8   0000060
 
#define CSIZE   0000060
 
#define PARENB   0000400
 
#define ISIG   0000001
 
#define ICANON   0000002
 
#define ECHO   0000010
 
#define ECHOE   0000020
 
#define ECHOK   0000040
 
#define ECHONL   0000100
 
#define IEXTEN   0100000
 
#define VINTR   0
 
#define VQUIT   1
 
#define VERASE   2
 
#define VKILL   3
 
#define VEOF   4
 
#define VTIME   5
 
#define VMIN   6
 
#define TCSANOW   0
 
#define TCSADRAIN   1
 
#define TCSAFLUSH   2
 
#define B0   0
 
#define B9600   13
 
#define B115200   17
 
#define TCGETS   0x5401
 
#define TCSETS   0x5402
 
#define TIOCGWINSZ   0x5413
 

Typedefs

typedef unsigned char cc_t
 
typedef unsigned int speed_t
 
typedef unsigned int tcflag_t
 

Functions

int tcgetattr (int fd, struct termios *termios_p)
 Read the settings of the terminal a descriptor refers to. More...
 
int tcsetattr (int fd, int actions, const struct termios *termios_p)
 Replace the settings of the terminal a descriptor refers to. More...
 

Detailed Description

The knobs of the line discipline, see drivers/periph/uart.c

Function Documentation

◆ tcgetattr()

int tcgetattr ( int  fd,
struct termios termios_p 
)

Read the settings of the terminal a descriptor refers to.

Parameters
fdThe file descriptor to provide.
termios_pThe buffer for returning the settings.
Return values
int0 on success and -1 on error, with the reason left in errno.

◆ tcsetattr()

int tcsetattr ( int  fd,
int  actions,
const struct termios termios_p 
)

Replace the settings of the terminal a descriptor refers to.

Parameters
fdThe file descriptor to provide.
actionsWhen the change takes effect. Tenok does not buffer, so every one of them takes effect at once.
termios_pThe settings to apply.
Return values
int0 on success and -1 on error, with the reason left in errno.