Altera Embedded Peripherals IP User Manual

Page 77

Advertising
background image

Table 8-2: Example: Printing Characters to a UART Core as stdout

#include <stdio.h>
int main ()
{
printf("Hello world.\n");
return 0;
}

The following code demonstrates reading characters from and sending messages to a UART device using

the C standard library. In this example, the system contains a UART core named

uart1

that is not

necessarily configured as the

stdout

device. In this case, the program treats the device like any other node

in the HAL file system.

8-8

HAL System Library Support

UG-01085

2014.24.07

Altera Corporation

UART Core

Send Feedback

Advertising