Input/Output Functions - 2023.1 English

Standalone Library Documentation: BSP and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2023-05-16
Version
2023.1 English

The embedded libraries contain standard C functions for Input/Output (I/O), such as printf and scanf. These functions are large and might not be suitable for embedded processors. The prototypes for these functions are available in the stdio.h file. These I/O routines require that a newline is terminated with both a CR and LF. Ensure that your terminal CR/LF behavior corresponds to this requirement.

For example:

Note: The C standard I/O routines such as printf, scanf, vfprintf are, by default, line buffered. To change the buffering scheme to no buffering, you must call setvbuf appropriately.
setvbuf (stdout, NULL, _IONBF, 0);

These I/O routines require that a newline is terminated with both a CR and LF. Ensure that your terminal CR/LF behavior corresponds to this requirement. For more information on setting the standard input and standard output devices for a system, see GNU Compiler Tools in Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400). In addition to the standard C functions, the Vitis IDE processors library provides the following smaller I/O functions:

Quick Function Reference

Type Name Arguments
void print void
void putnum void
void xil_printf void