Nut/OS  4.10.3
API Reference
UART I/O Control Functions

UART _ioctl() commands. More...

Collaboration diagram for UART I/O Control Functions:

Modules

 UART Status
 

UART device status flags,.


 XgUARTHS
 

UART handshake modes.


 XgUARTClock
 

UART device clock modes.


Defines

#define UART_SETSPEED   0x0101
 UART _ioctl() command code to set the line speed.
#define UART_GETSPEED   0x0102
 UART _ioctl() command code to query the line speed.
#define UART_SETDATABITS   0x0103
 UART _ioctl() command code to set the number of data bits.
#define UART_GETDATABITS   0x0104
 UART _ioctl() command code to query the number of data bits.
#define UART_SETPARITY   0x0105
 UART _ioctl() command code to set the parity mode.
#define UART_GETPARITY   0x0106
 UART _ioctl() command code to query the parity mode.
#define UART_SETSTOPBITS   0x0107
 UART _ioctl() command code to set the number of stop bits.
#define UART_GETSTOPBITS   0x0108
 UART _ioctl() command code to query the number of stop bits.
#define UART_SETSTATUS   0x0109
 UART _ioctl() command code to set the status.
#define UART_GETSTATUS   0x010a
 UART _ioctl() command code to query the status.
#define UART_SETREADTIMEOUT   0x010b
 UART _ioctl() command code to set the read timeout.
#define UART_GETREADTIMEOUT   0x010c
 UART _ioctl() command code to query the read timeout.
#define UART_SETWRITETIMEOUT   0x010d
 UART _ioctl() command code to set the write timeout.
#define UART_GETWRITETIMEOUT   0x010e
 UART _ioctl() command code to query the write timeout.
#define UART_SETLOCALECHO   0x010f
 UART _ioctl() command code to set the local echo mode.
#define UART_GETLOCALECHO   0x0110
 UART _ioctl() command code to query the local echo mode.
#define UART_SETFLOWCONTROL   0x0111
 UART _ioctl() command code to set the flow control mode.
#define UART_GETFLOWCONTROL   0x0112
 UART _ioctl() command code to query the flow control mode.
#define UART_SETCOOKEDMODE   0x0113
 UART _ioctl() command code to set the cooking mode.
#define UART_GETCOOKEDMODE   0x0114
 UART _ioctl() command code to query the cooking mode.
#define UART_SETBUFFERMODE   0x0115
 UART _ioctl() command code to set the buffering mode.
#define UART_GETBUFFERMODE   0x0116
 UART _ioctl() command code to query the buffering mode.
#define HDLC_SETIFNET   0x0117
 UART _ioctl() command code to set the network interface mode.
#define HDLC_GETIFNET   0x0118
 UART _ioctl() command code to query the network interface mode.
#define UART_SETCLOCKMODE   0x0119
 UART _ioctl() command code to set the clock mode.
#define UART_GETCLOCKMODE   0x011a
 UART _ioctl() command code to query the clock mode.
#define UART_SETTXBUFSIZ   0x011b
 UART _ioctl() command code to set the transmit buffer size.
#define UART_GETTXBUFSIZ   0x011c
 UART _ioctl() command code to query the transmit buffer size.
#define UART_SETRXBUFSIZ   0x011d
 UART _ioctl() command code to set the receive buffer size.
#define UART_GETRXBUFSIZ   0x011e
 UART _ioctl() command code to query the receive buffer size.
#define UART_SETTXBUFLWMARK   0x0120
 UART _ioctl() command code to set the transmit buffer low watermark.
#define UART_GETTXBUFLWMARK   0x0121
 UART _ioctl() command code to query the transmit buffer low watermark.
#define UART_SETTXBUFHWMARK   0x0122
 UART _ioctl() command code to set the transmit buffer high watermark.
#define UART_GETTXBUFHWMARK   0x0123
 UART _ioctl() command code to query the transmit buffer high watermark.
#define UART_SETRXBUFLWMARK   0x0124
 UART _ioctl() command code to set the receive buffer low watermark.
#define UART_GETRXBUFLWMARK   0x0125
 UART _ioctl() command code to query the receive buffer low watermark.
#define UART_SETRXBUFHWMARK   0x0126
 UART _ioctl() command code to set the receive buffer high watermark.
#define UART_GETRXBUFHWMARK   0x0127
 UART _ioctl() command code to query the receive buffer high watermark.
#define UART_SETBLOCKREAD   0x0128
 UART _ioctl() command code to set the block read mode.
#define UART_GETBLOCKREAD   0x0129
 UART _ioctl() command code to query the receive buffer high watermark.
#define UART_SETRAWMODE   0x012a
 UART _ioctl() command code to set physical device to the raw mode.
#define UART_GETRAWMODE   0x012b
 UART _ioctl() command code to query the raw mode.
#define HDLC_SETTXACCM   0x012c
 AHDLC _ioctl() command code to set the ACCM (Control Character Mask).
#define HDLC_GETTXACCM   0x012d
 AHDLC _ioctl() command code to get the ACCM (Control Character Mask).
#define UART_SETHDPXMODE   0x012c
 UART _ioctl() command code to set physical device to half duplex mode.
#define UART_GETHDPXMODE   0x012d
 UART _ioctl() command code to query the halfduplex mode.

Detailed Description

UART _ioctl() commands.

These commands are used to control and retrieve hardware specific configurations. The definitions are kept independent from the underlying hardware, but not all commands may be fully implemented in each UART driver.

The _ioctl() function expects three parameters:


Define Documentation

#define UART_GETSPEED   0x0102

UART _ioctl() command code to query the line speed.

The configuration parameter is set to the input and output bit rate per second.

Definition at line 116 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETDATABITS   0x0103

UART _ioctl() command code to set the number of data bits.

The configuration parameter specifies the number of data bits, 5, 6, 7, 8 or 9.

Definition at line 123 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETDATABITS   0x0104

UART _ioctl() command code to query the number of data bits.

The configuration parameter is set to the number of data bits, 5, 6, 7, 8 or 9.

Definition at line 130 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETPARITY   0x0105

UART _ioctl() command code to set the parity mode.

The configuration parameter specifies the type of the parity bit, 0 (none), 1 (odd) or 2 (even).

Definition at line 137 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETPARITY   0x0106

UART _ioctl() command code to query the parity mode.

The configuration parameter is set to the type of the parity bit, 0 (none), 1 (odd) or 2 (even).

Definition at line 144 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETSTOPBITS   0x0107

UART _ioctl() command code to set the number of stop bits.

The configuration parameter specifies the number of stop bits, 1 or 2.

Definition at line 150 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETSTOPBITS   0x0108

UART _ioctl() command code to query the number of stop bits.

The configuration parameter is set to the number of stop bits, 1 or 2.

Definition at line 156 of file uart.h.

Referenced by AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETSTATUS   0x0109

UART _ioctl() command code to set the status.

The configuration parameter specifies the status to set.

Definition at line 162 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETSTATUS   0x010a

UART _ioctl() command code to query the status.

The configuration parameter is set to the current status.

Definition at line 168 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETREADTIMEOUT   0x010b

UART _ioctl() command code to set the read timeout.

The configuration parameter specifies the read timeout in milliseconds.

Examples:
pppc/pppc.c.

Definition at line 175 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), NutChatSend(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETREADTIMEOUT   0x010c

UART _ioctl() command code to query the read timeout.

The configuration parameter is set to the read timeout in milliseconds.

Definition at line 182 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETWRITETIMEOUT   0x010d

UART _ioctl() command code to set the write timeout.

The configuration parameter specifies the write timeout in milliseconds.

Definition at line 189 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETWRITETIMEOUT   0x010e

UART _ioctl() command code to query the write timeout.

The configuration parameter is set to the write timeout in milliseconds.

Definition at line 196 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETLOCALECHO   0x010f

UART _ioctl() command code to set the local echo mode.

The configuration parameter specifies the local echo mode, 0 (off) or 1 (on).

Definition at line 203 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETLOCALECHO   0x0110

UART _ioctl() command code to query the local echo mode.

The configuration parameter is set to the local echo mode, 0 (off) or 1 (on).

Definition at line 210 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETFLOWCONTROL   0x0111

UART _ioctl() command code to set the flow control mode.

The configuration parameter specifies the flow control mode.

Definition at line 216 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETFLOWCONTROL   0x0112

UART _ioctl() command code to query the flow control mode.

The configuration parameter is set to the flow control mode.

Definition at line 222 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETCOOKEDMODE   0x0113

UART _ioctl() command code to set the cooking mode.

The configuration parameter specifies the character cooking mode, 0 (raw) or 1 (EOL translation).

Definition at line 229 of file uart.h.

Referenced by UartAvrIOCtl(), and UsartIOCtl().

#define UART_GETCOOKEDMODE   0x0114

UART _ioctl() command code to query the cooking mode.

The configuration parameter is set to the character cooking mode, 0 (raw) or 1 (EOL translation).

Definition at line 236 of file uart.h.

Referenced by UartAvrIOCtl(), and UsartIOCtl().

#define UART_SETBUFFERMODE   0x0115

UART _ioctl() command code to set the buffering mode.

The configuration parameter specifies the buffering mode.

Definition at line 242 of file uart.h.

#define UART_GETBUFFERMODE   0x0116

UART _ioctl() command code to query the buffering mode.

The configuration parameter is set to the buffering mode.

Definition at line 248 of file uart.h.

#define HDLC_SETIFNET   0x0117

UART _ioctl() command code to set the network interface mode.

The configuration parameter specifies the network interface mode.

Examples:
pppc/pppc.c.

Definition at line 254 of file uart.h.

Referenced by AhdlcAt91IOCtl(), AhdlcAvrIOCtl(), IpcpLowerDown(), and NutNetIfConfig2().

#define HDLC_GETIFNET   0x0118

UART _ioctl() command code to query the network interface mode.

The configuration parameter is set to the network interface mode.

Definition at line 260 of file uart.h.

Referenced by AhdlcAt91IOCtl(), and AhdlcAvrIOCtl().

#define UART_SETCLOCKMODE   0x0119

UART _ioctl() command code to set the clock mode.

The configuration parameter specifies the clock mode.

Definition at line 266 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETCLOCKMODE   0x011a

UART _ioctl() command code to query the clock mode.

The configuration parameter is set to the clock mode.

Definition at line 272 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETTXBUFSIZ   0x011b

UART _ioctl() command code to set the transmit buffer size.

The configuration parameter specifies the number of bytes.

Definition at line 278 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETTXBUFSIZ   0x011c

UART _ioctl() command code to query the transmit buffer size.

The configuration parameter specifies the number of bytes.

Definition at line 284 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETRXBUFSIZ   0x011d

UART _ioctl() command code to set the receive buffer size.

The configuration parameter specifies the number of bytes.

Definition at line 290 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETRXBUFSIZ   0x011e

UART _ioctl() command code to query the receive buffer size.

The configuration parameter specifies the number of bytes.

Definition at line 296 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETTXBUFLWMARK   0x0120

UART _ioctl() command code to set the transmit buffer low watermark.

The configuration parameter specifies the number of bytes.

Definition at line 302 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETTXBUFLWMARK   0x0121

UART _ioctl() command code to query the transmit buffer low watermark.

The configuration parameter specifies the number of bytes.

Definition at line 308 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETTXBUFHWMARK   0x0122

UART _ioctl() command code to set the transmit buffer high watermark.

The configuration parameter specifies the number of bytes.

Definition at line 314 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETTXBUFHWMARK   0x0123

UART _ioctl() command code to query the transmit buffer high watermark.

The configuration parameter specifies the number of bytes.

Definition at line 320 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETRXBUFLWMARK   0x0124

UART _ioctl() command code to set the receive buffer low watermark.

The configuration parameter specifies the number of bytes.

Definition at line 326 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETRXBUFLWMARK   0x0125

UART _ioctl() command code to query the receive buffer low watermark.

The configuration parameter specifies the number of bytes.

Definition at line 332 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETRXBUFHWMARK   0x0126

UART _ioctl() command code to set the receive buffer high watermark.

The configuration parameter specifies the number of bytes.

Definition at line 338 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETRXBUFHWMARK   0x0127

UART _ioctl() command code to query the receive buffer high watermark.

The configuration parameter specifies the number of bytes.

Definition at line 344 of file uart.h.

Referenced by UsartIOCtl().

#define UART_SETBLOCKREAD   0x0128

UART _ioctl() command code to set the block read mode.

The configuration parameter specifies the block read mode.

Definition at line 350 of file uart.h.

#define UART_GETBLOCKREAD   0x0129

UART _ioctl() command code to query the receive buffer high watermark.

The configuration parameter specifies the block read mode.

Definition at line 356 of file uart.h.

#define UART_SETRAWMODE   0x012a

UART _ioctl() command code to set physical device to the raw mode.

The configuration parameter specifies the raw mode for device. In raw mode data encapsulation is not allowed to be done. This allows other processing to be done on physical device.

Definition at line 364 of file uart.h.

Referenced by AhdlcAt91IOCtl(), and AhdlcAvrIOCtl().

#define UART_GETRAWMODE   0x012b

UART _ioctl() command code to query the raw mode.

The configuration parameter specified the raw mode.

Definition at line 370 of file uart.h.

Referenced by AhdlcAt91IOCtl(), and AhdlcAvrIOCtl().

#define HDLC_SETTXACCM   0x012c

AHDLC _ioctl() command code to set the ACCM (Control Character Mask).

During the LCP stage of PPP negotiation both peers inform each other which of the control characters (0-31) will not require escaping when being transmitted. This allows the PPP layer to tell the HDLC layer about this so that data may be transmitted quicker (no escapes).

Definition at line 379 of file uart.h.

Referenced by AhdlcAvrIOCtl().

#define HDLC_GETTXACCM   0x012d

AHDLC _ioctl() command code to get the ACCM (Control Character Mask).

Just in case someone ever wants to see what it currently is.

Definition at line 385 of file uart.h.

Referenced by AhdlcAvrIOCtl().

#define UART_SETHDPXMODE   0x012c

UART _ioctl() command code to set physical device to half duplex mode.

The configuration parameter specifies the halfduplex mode for device. In raw mode

Definition at line 391 of file uart.h.

Referenced by UsartIOCtl().

#define UART_GETHDPXMODE   0x012d

UART _ioctl() command code to query the halfduplex mode.

Definition at line 396 of file uart.h.

Referenced by UsartIOCtl().