v2.0.0
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
69 void stdio_uart_init_full(uart_inst_t *uart, uint baud_rate, int tx_pin, int rx_pin);
70
79void stdio_uart_deinit(void);
80
86void stdout_uart_deinit(void);
87
93void stdin_uart_deinit(void);
94
102 void stdio_uart_deinit_full(uart_inst_t *uart, int tx_pin, int rx_pin);
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif
stdio_uart_init_full
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...
stdout_uart_init
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:69
stdio_uart_deinit
void stdio_uart_deinit(void)
Explicitly deinitialize stdin/stdout over UART and remove it from the current set of stdin/stdout dri...
Definition: stdio_uart.c:101
stdout_uart_deinit
void stdout_uart_deinit(void)
Explicitly deinitialize stdout only (no stdin) over UART and remove it from the current set of stdout...
Definition: stdio_uart.c:115
stdin_uart_init
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:81
stdin_uart_deinit
void stdin_uart_deinit(void)
Explicitly deinitialize stdin only (no stdout) over UART and remove it from the current set of stdin ...
Definition: stdio_uart.c:121
stdio_uart_deinit_full
void stdio_uart_deinit_full(uart_inst_t *uart, int tx_pin, int rx_pin)
Perform custom deinitialization deinitialize stdin/stdout over UART and remove it from the current se...
stdio_uart_init
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:37
uart.h
stdio.h
stdio_driver
Definition: driver.h:12