uart
1.4
Serial stream for Xmega/Wrapper for UART-driver Xmega
|
Stream for the communcation mode of HvA-Xmegaboard. More...
Macros | |
#define | ENABLE_UART_F0 1 |
UART0 from PORTF. | |
#define | BAUD 115200 |
baud rate | |
#define | CLK2X 0 |
no double clock speed | |
Functions | |
int | uart_fputc (char c, FILE *stream) |
Write a byte to the circular transmit buffer. This function is necessary for a standard stream. More... | |
int | uart_fgetc (FILE *stream) |
Get a byte from the circular receive buffer This function is necessary for a standard stream. More... | |
void | init_stream (uint32_t fcpu) |
Initialize a standard in/out stream It uses USART0 of port F, the baud rate is BAUD, doubleclockspeed is CLK2X and the interruptlevel is low The global interrupt is not yet set. More... | |
Variables | |
FILE | uart_stdinout = FDEV_SETUP_STREAM(uart_fputc, uart_fgetc, _FDEV_SETUP_RW) |
FILE structure for standard streams. | |
Stream for the communcation mode of HvA-Xmegaboard.
Makes a standard stream for the HvA-Xmegaboard. It is build on the wrapper. With these you can use printf
and scanf
to write to and read from the UART F0. The baud rate is 115200 and the protocol is 8N1.
Version 1.3 : Modified uart_fputc changed. With a full TX-buffer it doesn't skips characters anymore. It now waits until there is free space in the buffer.
Version 1.4 : The baud rate is changed toe 115200
void init_stream | ( | uint32_t | fcpu | ) |
Initialize a standard in/out stream It uses USART0 of port F, the baud rate is BAUD, doubleclockspeed is CLK2X and the interruptlevel is low The global interrupt is not yet set.
fcpu | the clock frequency |
int uart_fgetc | ( | FILE * | stream | ) |
Get a byte from the circular receive buffer This function is necessary for a standard stream.
stream | file pointer |
int uart_fputc | ( | char | c, |
FILE * | stream | ||
) |
Write a byte to the circular transmit buffer. This function is necessary for a standard stream.
c | character to be written |
stream | file pointer |