Nut/OS  4.10.3
API Reference
usart.h File Reference

Synchronous/asynchronous serial device definitions. More...

#include <dev/uart.h>
Include dependency graph for usart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _RINGBUF
 Character device ring buffer structure. More...
struct  _USARTDCB
 USART device low level information structure. More...

Defines

#define USART_MF_RTSCONTROL   0x0001
#define USART_MF_CTSSENSE   0x0002
#define USART_MF_DTRCONTROL   0x0004
#define USART_MF_DSRSENSE   0x0008
#define USART_MF_DCDSENSE   0x0010
#define USART_MF_SENSEMASK   0x001A
#define USART_MF_CONTROLMASK   0x0005
#define USART_MF_XONXOFF   0x0020
 Software handshake.
#define USART_MF_LOCALECHO   0x0040
#define USART_MF_COOKEDMODE   0x0080
#define USART_MF_NOBUFFER   0x0100
#define USART_MF_LINEBUFFER   0x0200
#define USART_MF_BUFFERMASK   0x0300
#define USART_MF_HALFDUPLEX   0x0400
#define USART_MF_BLOCKREAD   0x0800
#define USART_SF_RTSOFF   0x0001
#define USART_SF_CTSOFF   0x0002
#define USART_SF_DTROFF   0x0004
#define USART_SF_DSROFF   0x0008
#define USART_SF_DCDOFF   0x0010
#define USART_SF_TXDISABLED   0x0040
#define USART_SF_RXDISABLED   0x0080

Typedefs

typedef struct _USARTDCB USARTDCB

Ring Buffer

#define USART_RXBUFSIZ   256
 Initial receive buffer size.
#define USART_RXHIWMARK   240
 Receiver's initial high water mark.
#define USART_RXLOWMARK   208
 Receiver's initial low water mark.
#define USART_TXBUFSIZ   64
 Initial transmit buffer size.
#define USART_TXHIWMARK   56
 Transmitter's initial high water mark.
#define USART_TXLOWMARK   40
 Transmitter's initial low water mark.
typedef struct _RINGBUF RINGBUF
 Character device ring buffer type.

Initial UART Configuration

#define USART_INITSPEED   115200
 Initial bit rate.

Function Prototypes

int UsartInit (NUTDEVICE *dev)
 Initialize the USART device.
int UsartIOCtl (NUTDEVICE *dev, int req, void *conf)
 Perform USART control functions.
int UsartRead (NUTFILE *fp, void *buffer, int size)
 Read from device.
int UsartWrite (NUTFILE *fp, CONST void *buffer, int len)
 Write a device or file.
int UsartWrite_P (NUTFILE *fp, PGM_P buffer, int len)
 Write a device or file.
NUTFILEUsartOpen (NUTDEVICE *dev, CONST char *name, int mode, int acc)
 Open an USART device.
int UsartClose (NUTFILE *fp)
 Close an USART device.
long UsartSize (NUTFILE *fp)
 Retrieves the number of characters in input buffer.

Detailed Description

Synchronous/asynchronous serial device definitions.

Definition in file usart.h.