Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

TLC16C550
[* Serial]

Collaboration diagram for TLC16C550:


Detailed Description

TLC16C550 UART driver.

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 ACE driver.

The _ioctl() function expects three parameters:


Modules

 XgACEStatus
 ACE device status flags,.
 XgACEHS
 ACE handshake modes.

Data Structures

struct  _ACEDCB
 ACE device control block structure. More...
struct  _ACEDCB
 ACE device control block structure. More...

Defines

#define ACE_SETSPEED
 ACE _ioctl() command code to set the line speed.
#define ACE_GETSPEED
 ACE _ioctl() command code to query the line speed.
#define ACE_SETDATABITS
 ACE _ioctl() command code to set the number of data bits.
#define ACE_GETDATABITS
 ACE _ioctl() command code to query the number of data bits.
#define ACE_SETPARITY
 ACE _ioctl() command code to set the parity mode.
#define ACE_GETPARITY
 ACE _ioctl() command code to query the parity mode.
#define ACE_SETSTOPBITS
 ACE _ioctl() command code to set the number of stop bits.
#define ACE_GETSTOPBITS
 ACE _ioctl() command code to query the number of stop bits.
#define ACE_SETSTATUS
 ACE _ioctl() command code to set the status.
#define ACE_GETSTATUS
 ACE _ioctl() command code to query the status.
#define ACE_SETREADTIMEOUT
 ACE _ioctl() command code to set the read timeout.
#define ACE_GETREADTIMEOUT
 ACE _ioctl() command code to query the read timeout.
#define ACE_SETWRITETIMEOUT
 ACE _ioctl() command code to set the write timeout.
#define ACE_GETWRITETIMEOUT
 ACE _ioctl() command code to query the write timeout.
#define ACE_SETLOCALECHO
 ACE _ioctl() command code to set the local echo mode.
#define ACE_GETLOCALECHO
 ACE _ioctl() command code to query the local echo mode.
#define ACE_SETFLOWCONTROL
 ACE _ioctl() command code to set the flow control mode.
#define ACE_GETFLOWCONTROL
 ACE _ioctl() command code to query the flow control mode.
#define ACE_SETCOOKEDMODE
 ACE _ioctl() command code to set the cooking mode.
#define ACE_GETCOOKEDMODE
 ACE _ioctl() command code to query the cooking mode.
#define ACE_SETBUFFERMODE
 ACE _ioctl() command code to set the buffering mode.
#define ACE_GETBUFFERMODE
 ACE _ioctl() command code to query the buffering mode.
#define ACE_SETTXBUFSIZ
 ACE _ioctl() command code to set the transmit buffer size.
#define ACE_GETTXBUFSIZ
 ACE _ioctl() command code to query the transmit buffer size.
#define ACE_SETRXBUFSIZ
 ACE _ioctl() command code to set the receive buffer size.
#define ACE_GETRXBUFSIZ
 ACE _ioctl() command code to query the receive buffer size.
#define ACE_SETTXBUFLWMARK
 ACE _ioctl() command code to set the transmit buffer low watermark.
#define ACE_GETTXBUFLWMARK
 ACE _ioctl() command code to query the transmit buffer low watermark.
#define ACE_SETTXBUFHWMARK
 ACE _ioctl() command code to set the transmit buffer high watermark.
#define ACE_GETTXBUFHWMARK
 ACE _ioctl() command code to query the transmit buffer high watermark.
#define ACE_SETRXBUFLWMARK
 ACE _ioctl() command code to set the receive buffer low watermark.
#define ACE_GETRXBUFLWMARK
 ACE _ioctl() command code to query the receive buffer low watermark.
#define ACE_SETRXBUFHWMARK
 ACE _ioctl() command code to set the receive buffer high watermark.
#define ACE_GETRXBUFHWMARK
 ACE _ioctl() command code to query the receive buffer high watermark.
#define ACE_SETBLOCKREAD
 ACE _ioctl() command code to set the block read mode.
#define ACE_GETBLOCKREAD
 ACE _ioctl() command code to query the receive buffer high watermark.
#define ACE_SETFIFO
 ACE _ioctl() command code to set the fifo mode and receive fifo trigger level.
#define ACE_GETFIFO
 ACE _ioctl() command code to query the fifo mode and receive fifo trigger level.
#define ACE_MF_RTSSENSE
#define ACE_MF_CTSCONTROL
#define ACE_MF_DTRSENSE
#define ACE_MF_DSRCONTROL
#define ACE_MF_DCDCONTROL
#define ACE_MF_RTSCONTROL
#define ACE_MF_CTSSENSE
#define ACE_MF_DTRCONTROL
#define ACE_MF_DSRSENSE
#define ACE_MF_DCDSENSE
#define ACE_MF_SENSEMASK
#define ACE_MF_CONTROLMASK
#define ACE_MF_XONXOFF
#define ACE_MF_LOCALECHO
#define ACE_MF_COOKEDMODE
#define ACE_MF_NOBUFFER
#define ACE_MF_LINEBUFFER
#define ACE_MF_BUFFERMASK
#define ACE_SF_RTSOFF
#define ACE_SF_CTSOFF
#define ACE_SF_DTROFF
#define ACE_SF_DSROFF
#define ACE_SF_DCDOFF
#define ACE_SF_TXDISABLED
#define ACE_SF_RXDISABLED
#define ACE_HS_DCERTSCTS
#define ACE_HS_DCEFULL
#define ACE_HS_DTERTSCTS
#define ACE_HS_DTEFULL
#define ACE_HS_XONXOFF
#define ACE_CLOCK

Typedefs

typedef _ACEDCB ACEDCB

Functions

int AceInit (NUTDEVICE *dev)
 Initialize on chip ACE device.
int AceIOCtl (NUTDEVICE *dev, int req, void *conf)
 Perform ACE control functions.
int AceInput (NUTDEVICE *dev)
 Wait for input.
int AceOutput (NUTDEVICE *dev)
 Initiate output.
int AceFlush (NUTDEVICE *dev)
 Wait for output buffer empty.
int AceGetRaw (u_char *cp)
int AcePutRaw (u_char ch)
int AceRead (NUTFILE *fp, void *buffer, int size)
 Read from device.
int AceWrite (NUTFILE *fp, CONST void *buffer, int len)
int AceWrite_P (NUTFILE *fp, PGM_P buffer, int len)
NUTFILEAceOpen (NUTDEVICE *dev, CONST char *name, int mode, int acc)
 Open a device or file.
long AceSize (NUTFILE *fp)
 Request file size.
int AceClose (NUTFILE *fp)
 Close a device or file.


Define Documentation

#define ACE_GETBLOCKREAD
 

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

The configuration parameter specifies the block read mode

#define ACE_GETBUFFERMODE
 

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

The configuration parameter is set to the buffering mode.

#define ACE_GETCOOKEDMODE
 

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

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

#define ACE_GETDATABITS
 

ACE _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.

#define ACE_GETFIFO
 

ACE _ioctl() command code to query the fifo mode and receive fifo trigger level.

The configuration parameter specifies the receive fifo trigger level (x,1,4,8,14), x - fifo is disabled

#define ACE_GETFLOWCONTROL
 

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

The configuration parameter is set to the flow control mode.

#define ACE_GETLOCALECHO
 

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

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

#define ACE_GETPARITY
 

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

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

#define ACE_GETREADTIMEOUT
 

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

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

#define ACE_GETRXBUFHWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETRXBUFLWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETRXBUFSIZ
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETSPEED
 

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

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

#define ACE_GETSTATUS
 

ACE _ioctl() command code to query the status.

The configuration parameter is set to the current status.

#define ACE_GETSTOPBITS
 

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

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

#define ACE_GETTXBUFHWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETTXBUFLWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETTXBUFSIZ
 

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

The configuration parameter specifies the number of bytes.

#define ACE_GETWRITETIMEOUT
 

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

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

#define ACE_HS_DCEFULL
 

Full DCE handshake.

#define ACE_HS_DCERTSCTS
 

RTS/CTS DCE handshake.

#define ACE_HS_DTEFULL
 

Full DTE handshake.

#define ACE_HS_DTERTSCTS
 

RTS/CTS DTE handshake.

#define ACE_HS_XONXOFF
 

Software handshake.

#define ACE_MF_BUFFERMASK
 

Masks buffering mode flags.

#define ACE_MF_CONTROLMASK
 

Handshake control mask.

#define ACE_MF_COOKEDMODE
 

Should be used in stream, not device.

#define ACE_MF_CTSCONTROL
 

DCE output.

#define ACE_MF_CTSSENSE
 

DTE input.

#define ACE_MF_DCDCONTROL
 

DCE output.

#define ACE_MF_DCDSENSE
 

DTE input.

#define ACE_MF_DSRCONTROL
 

DCE output.

#define ACE_MF_DSRSENSE
 

DTE input.

#define ACE_MF_DTRCONTROL
 

DTE output.

#define ACE_MF_DTRSENSE
 

DCE input.

#define ACE_MF_LINEBUFFER
 

Line buffered.

#define ACE_MF_LOCALECHO
 

Should be used in stream, not device.

#define ACE_MF_NOBUFFER
 

No buffering.

#define ACE_MF_RTSCONTROL
 

DTE output.

#define ACE_MF_RTSSENSE
 

DCE input, low on port bit is +12V, which means ON.

#define ACE_MF_SENSEMASK
 

Handshake sense mask.

#define ACE_MF_XONXOFF
 

Software handshake.

#define ACE_SETBLOCKREAD
 

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

The configuration parameter specifies the block read mode

#define ACE_SETBUFFERMODE
 

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

The configuration parameter specifies the buffering mode.

#define ACE_SETCOOKEDMODE
 

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

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

#define ACE_SETDATABITS
 

ACE _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.

#define ACE_SETFIFO
 

ACE _ioctl() command code to set the fifo mode and receive fifo trigger level.

The configuration parameter specifies the receive fifo trigger level (x,1,4,8,14), x - disables fifo

#define ACE_SETFLOWCONTROL
 

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

The configuration parameter specifies the flow control mode.

#define ACE_SETLOCALECHO
 

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

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

#define ACE_SETPARITY
 

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

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

#define ACE_SETREADTIMEOUT
 

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

The configuration parameter specifies the read timeout in milliseconds.

#define ACE_SETRXBUFHWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETRXBUFLWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETRXBUFSIZ
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETSPEED
 

ACE _ioctl() command code to set the line speed.

The configuration parameter specifies the input and output bit rate per second.

#define ACE_SETSTATUS
 

ACE _ioctl() command code to set the status.

The configuration parameter specifies the status to set.

#define ACE_SETSTOPBITS
 

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

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

#define ACE_SETTXBUFHWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETTXBUFLWMARK
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETTXBUFSIZ
 

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

The configuration parameter specifies the number of bytes.

#define ACE_SETWRITETIMEOUT
 

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

The configuration parameter specifies the write timeout in milliseconds.

#define ACE_SF_CTSOFF
 

Set CTS line is off.

#define ACE_SF_DCDOFF
 

Set DCD line is off.

#define ACE_SF_DSROFF
 

Set DSR line is off.

#define ACE_SF_DTROFF
 

Set DTR line is off.

#define ACE_SF_RTSOFF
 

Set RTS line is off.

#define ACE_SF_RXDISABLED
 

Receiver disabled.

#define ACE_SF_TXDISABLED
 

Transmitter disabled.


Typedef Documentation

typedef struct _ACEDCB ACEDCB
 

ACE device control block type.


Function Documentation

int AceFlush NUTDEVICE dev  ) 
 

Wait for output buffer empty.

If the output buffer contains any data, the calling thread is suspended until all data has been transmitted.

Parameters:
dev Indicates the ACE device.
Returns:
0 on success, -1 otherwise.

int AceInit NUTDEVICE dev  ) 
 

Initialize on chip ACE device.

Prepares the device for subsequent reading or writing. Enables ACE transmitter and receiver interrupts.

Parameters:
dev Identifies the device to initialize.
Returns:
0 on success, -1 otherwise.

int AceInput NUTDEVICE dev  ) 
 

Wait for input.

This function checks the input buffer for any data. If the buffer is empty, the calling thread will be blocked until at least one new character is received or a timeout occurs.

Parameters:
dev Indicates the ACE device.
Returns:
0 on success, -1 on timeout.

int AceIOCtl NUTDEVICE dev,
int  req,
void *  conf
 

Perform ACE control functions.

Parameters:
dev Identifies the device that receives the device-control function.
req Requested control function. May be set to one of the following constants:
  • ACE_SETSPEED, conf points to an u_long value containing the baudrate.
  • ACE_GETSPEED, conf points to an u_long value receiving the current baudrate.
  • ACE_SETDATABITS, conf points to an u_long value containing the number of data bits, 5, 6, 7 or 8.
  • ACE_GETDATABITS, conf points to an u_long value receiving the number of data bits, 5, 6, 7 or 8.
  • ACE_SETPARITY, conf points to an u_long value containing the parity, 0 (no), 1 (odd) or 2 (even).
  • ACE_GETPARITY, conf points to an u_long value receiving the parity, 0 (no), 1 (odd) or 2 (even).
  • ACE_SETSTOPBITS, conf points to an u_long value containing the number of stop bits 1 or 2.
  • ACE_GETSTOPBITS, conf points to an u_long value receiving the number of stop bits 1 or 2.
  • ACE_SETSTATUS
  • ACE_GETSTATUS
  • ACE_SETREADTIMEOUT, conf points to an u_long value containing the read timeout.
  • ACE_GETREADTIMEOUT, conf points to an u_long value receiving the read timeout.
  • ACE_SETWRITETIMEOUT, conf points to an u_long value containing the write timeout.
  • ACE_GETWRITETIMEOUT, conf points to an u_long value receiving the write timeout.
  • ACE_SETLOCALECHO, conf points to an u_long value containing 0 (off) or 1 (on).
  • ACE_GETLOCALECHO, conf points to an u_long value receiving 0 (off) or 1 (on).
  • ACE_SETFLOWCONTROL, conf points to an u_long value containing combined ACE_FCTL_ values.
  • ACE_GETFLOWCONTROL, conf points to an u_long value containing receiving ACE_FCTL_ values.
  • ACE_SETCOOKEDMODE, conf points to an u_long value containing 0 (off) or 1 (on).
  • ACE_GETCOOKEDMODE, conf points to an u_long value receiving 0 (off) or 1 (on).
conf Points to a buffer that contains any data required for the given control function or receives data from that function.
Returns:
0 on success, -1 otherwise.
Warning:
Timeout values are given in milliseconds and are limited to the granularity of the system timer. To disable timeout, set the parameter to NUT_WAIT_INFINITE.

int AceOutput NUTDEVICE dev  ) 
 

Initiate output.

This function checks the output buffer for any data. If the buffer contains at least one character, the transmitter is started, if not already running. The function returns immediately, without waiting for the character being completely transmitted. Any remaining characters in the output buffer are transmitted in the background.

Parameters:
dev Indicates the ACE device.
Returns:
0 on success, -1 otherwise.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/