SLS AVR Lib 0.1a
 
Loading...
Searching...
No Matches
uart_stdio.h File Reference

Standard IO thouth USART. More...

#include <stdio.h>
#include <avr-uart/uart.h>

Go to the source code of this file.

Macros

#define stdout_set_to_uart()
 Sets standard output via UART, by default alias for stdout_set_to_uart0.
 
#define stderr_set_to_uart()
 Sets standard error output via UART, by default alias for stdout_set_to_uart0.
 
#define stdin_set_from_uart()
 Sets standard input via UART, by default alias for stdout_set_to_uart0.
 

Functions

void stdout_set_to_uart0 (void)
 Sets standard output via USART0.
 
void stderr_set_to_uart0 (void)
 Sets standard error output via USART0.
 
void stdin_set_from_uart0 (void)
 Sets standard input via USART0.
 
void stdout_set_to_uart1 (void)
 Sets standard output via USART1.
 
void stderr_set_to_uart1 (void)
 Sets standard error output via USART1.
 
void stdin_set_from_uart1 (void)
 Sets standard input via USART1.
 
void stdout_set_to_uart2 (void)
 Sets standard output via USART2.
 
void stderr_set_to_uart2 (void)
 Sets standard error output via USART2.
 
void stdin_set_from_uart2 (void)
 Sets standard input via USART2.
 
void stdout_set_to_uart3 (void)
 Sets standard output via USART3.
 
void stderr_set_to_uart3 (void)
 Sets standard error output via USART3.
 
void stdin_set_from_uart3 (void)
 Sets standard input via USART3.
 

Detailed Description

Standard IO thouth USART.

Author
Simon Litt simon.nosp@m.@1it.nosp@m.t.net https://coding.1itt.net, https://github.com/SimonLitt
#define UART_BAUD_RATE 9600
...
int main(void) {
...
uart_init(UART_BAUD_SELECT(UART_BAUD_RATE, F_CPU));
printf("OK!\n");
fprintf(stderr, "Error!");
...
}
Standard IO thouth USART.
#define stdout_set_to_uart()
Sets standard output via UART, by default alias for stdout_set_to_uart0.
Definition uart_stdio.h:73
#define stderr_set_to_uart()
Sets standard error output via UART, by default alias for stdout_set_to_uart0.
Definition uart_stdio.h:76
#define UART_BAUD_RATE 9600
...
int main(void) {
...
uart_init(UART_BAUD_SELECT(UART_BAUD_RATE, F_CPU));
int ch = getchar();
if (ch != EOF) {
printf("GET: `%s`!\n", ch);
}
...
}
#define stdin_set_from_uart()
Sets standard input via UART, by default alias for stdout_set_to_uart0.
Definition uart_stdio.h:79

Macro Definition Documentation

◆ stderr_set_to_uart

#define stderr_set_to_uart ( )
Value:
void stderr_set_to_uart0(void)
Sets standard error output via USART0.

Sets standard error output via UART, by default alias for stdout_set_to_uart0.

See also
stdout_set_to_uart0

◆ stdin_set_from_uart

#define stdin_set_from_uart ( )
Value:
void stdin_set_from_uart0(void)
Sets standard input via USART0.

Sets standard input via UART, by default alias for stdout_set_to_uart0.

See also
stdout_set_to_uart0

◆ stdout_set_to_uart

#define stdout_set_to_uart ( )
Value:
void stdout_set_to_uart0(void)
Sets standard output via USART0.

Sets standard output via UART, by default alias for stdout_set_to_uart0.

See also
stdout_set_to_uart0

Function Documentation

◆ stderr_set_to_uart0()

void stderr_set_to_uart0 ( void )

Sets standard error output via USART0.

◆ stderr_set_to_uart1()

void stderr_set_to_uart1 ( void )

Sets standard error output via USART1.

◆ stderr_set_to_uart2()

void stderr_set_to_uart2 ( void )

Sets standard error output via USART2.

◆ stderr_set_to_uart3()

void stderr_set_to_uart3 ( void )

Sets standard error output via USART3.

◆ stdin_set_from_uart0()

void stdin_set_from_uart0 ( void )

Sets standard input via USART0.

◆ stdin_set_from_uart1()

void stdin_set_from_uart1 ( void )

Sets standard input via USART1.

◆ stdin_set_from_uart2()

void stdin_set_from_uart2 ( void )

Sets standard input via USART2.

◆ stdin_set_from_uart3()

void stdin_set_from_uart3 ( void )

Sets standard input via USART3.

◆ stdout_set_to_uart0()

void stdout_set_to_uart0 ( void )

Sets standard output via USART0.

◆ stdout_set_to_uart1()

void stdout_set_to_uart1 ( void )

Sets standard output via USART1.

◆ stdout_set_to_uart2()

void stdout_set_to_uart2 ( void )

Sets standard output via USART2.

◆ stdout_set_to_uart3()

void stdout_set_to_uart3 ( void )

Sets standard output via USART3.