### Xilinx Processor IP Library

<hl>Software Drivers</hl>

Main Page | Data Structures | File List | Data Fields | Globals

# xuartns550_format.c File Reference

## Detailed Description

This file contains the data format functions for the 16450/16550 UART driver. The data format functions allow the baud rate, number of data bits, number of stop bits and parity to be set and retrieved.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes
     ----- ---- -------- -----------------------------------------------
     1.00b jhl  03/11/02 Repartitioned driver for smaller files.
     1.00b rmm  05/15/03 Fixed diab compiler warnings.
     1.11a sv   03/20/07 Updated to use the new coding guidelines.

## Functions

int | XUartNs550_SetDataFormat (XUartNs550 *InstancePtr, XUartNs550Format *FormatPtr)
void | XUartNs550_GetDataFormat (XUartNs550 *InstancePtr, XUartNs550Format *FormatPtr)

## Function Documentation

void XUartNs550_GetDataFormat | ( | XUartNs550 * | InstancePtr,
|  | XUartNs550Format * | FormatPtr
| ) |

Gets the data format for the specified UART. The data format includes the baud rate, number of data bits, number of stop bits, and parity.

Parameters:

  | InstancePtr | is a pointer to the XUartNs550 instance .
  | FormatPtr | is a pointer to a format structure that will contain the data format after this call completes.

Returns:
  None.

Note:
  None.

int XUartNs550_SetDataFormat | ( | XUartNs550 * | InstancePtr,
|  | XUartNs550Format * | FormatPtr
| ) |

Sets the data format for the specified UART. The data format includes the baud rate, number of data bits, number of stop bits, and parity. It is the caller's responsibility to ensure that the UART is not sending or receiving data when this function is called.

Parameters:

  | InstancePtr | is a pointer to the XUartNs550 instance .
  | FormatPtr | is a pointer to a format structure containing the data format to be set.

Returns:

- XST_SUCCESS if the data format was successfully set.
- XST_UART_BAUD_ERROR indicates the baud rate could not be set because of the amount of error with the baud rate and the input clock frequency.
- XST_INVALID_PARAM if one of the parameters was not valid.

Note:

The data types in the format type, data bits and parity, are 32 bit fields to prevent a compiler warning that is a bug with the GNU PowerPC compiler. The asserts in this function will cause a warning if these fields are bytes.
The baud rates tested include: 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200.

Copyright © 1995-2009 Xilinx, Inc. All rights reserved.