stdio_uart.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_STDIO_UART_H
8#define _PICO_STDIO_UART_H
9
10#include "pico/stdio.h"
11#include "hardware/uart.h"
12
21// PICO_CONFIG: PICO_STDIO_UART_DEFAULT_CRLF, Default state of CR/LF translation for UART output, type=bool, default=PICO_STDIO_DEFAULT_CRLF, group=pico_stdio_uart
22#ifndef PICO_STDIO_UART_DEFAULT_CRLF
23#define PICO_STDIO_UART_DEFAULT_CRLF PICO_STDIO_DEFAULT_CRLF
24#endif
25
26// PICO_CONFIG: PICO_STDIO_UART_SUPPORT_CHARS_AVAILABLE_CALLBACK, Enable UART STDIO support for stdio_set_chars_available_callback. Can be disabled to make use of the uart elsewhere, type=bool, default=1, group=pico_stdio_uart
27#ifndef PICO_STDIO_UART_SUPPORT_CHARS_AVAILABLE_CALLBACK
28#define PICO_STDIO_UART_SUPPORT_CHARS_AVAILABLE_CALLBACK 1
29#endif
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35extern stdio_driver_t stdio_uart;
36
45void stdio_uart_init(void);
46
52void stdout_uart_init(void);
53
59void stdin_uart_init(void);
60
69void stdio_uart_init_full(uart_inst_t *uart, uint baud_rate, int tx_pin, int rx_pin);
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif
void stdio_uart_init_full(uart_inst_t *uart, uint baud_rate, int tx_pin, int rx_pin)
Perform custom initialization initialize stdin/stdout over UART and add it to the current set of stdi...
void stdout_uart_init(void)
Explicitly initialize stdout only (no stdin) over UART and add it to the current set of stdout driver...
Definition: stdio_uart.c:52
void stdin_uart_init(void)
Explicitly initialize stdin only (no stdout) over UART and add it to the current set of stdin drivers...
Definition: stdio_uart.c:64
void stdio_uart_init(void)
Explicitly initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers.
Definition: stdio_uart.c:25
Definition: driver.h:12