stdio.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_STDIO_H
8#define _PICO_STDIO_H
9
17#include "pico.h"
18
19// PICO_CONFIG: PICO_STDOUT_MUTEX, Enable/disable mutex around stdout, type=bool, default=1, group=pico_stdio
20#ifndef PICO_STDOUT_MUTEX
21#define PICO_STDOUT_MUTEX 1
22#endif
23
24// PICO_CONFIG: PICO_STDIO_ENABLE_CRLF_SUPPORT, Enable/disable CR/LF output conversion support, type=bool, default=1, group=pico_stdio
25#ifndef PICO_STDIO_ENABLE_CRLF_SUPPORT
26#define PICO_STDIO_ENABLE_CRLF_SUPPORT 1
27#endif
28
29// PICO_CONFIG: PICO_STDIO_DEFAULT_CRLF, Default for CR/LF conversion enabled on all stdio outputs, type=bool, default=1, depends=PICO_STDIO_ENABLE_CRLF_SUPPORT, group=pico_stdio
30#ifndef PICO_STDIO_DEFAULT_CRLF
31#define PICO_STDIO_DEFAULT_CRLF 1
32#endif
33
34// PICO_CONFIG: PICO_STDIO_STACK_BUFFER_SIZE, Define printf buffer size (on stack)... this is just a working buffer not a max output size, min=0, max=512, default=128, group=pico_stdio
35#ifndef PICO_STDIO_STACK_BUFFER_SIZE
36#define PICO_STDIO_STACK_BUFFER_SIZE 128
37#endif
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43
44typedef struct stdio_driver stdio_driver_t;
45
57void stdio_init_all(void);
58
67void stdio_flush(void);
68
75int getchar_timeout_us(uint32_t timeout_us);
76
84void stdio_set_driver_enabled(stdio_driver_t *driver, bool enabled);
85
95
104void stdio_set_translate_crlf(stdio_driver_t *driver, bool translate);
105
109int putchar_raw(int c);
110
114int puts_raw(const char *s);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif
int puts_raw(const char *s)
puts variant that skips any CR/LF conversion if enabled
Definition: stdio.c:160
void stdio_set_driver_enabled(stdio_driver_t *driver, bool enabled)
Adds or removes a driver from the list of active drivers used for input/output.
Definition: stdio.c:182
void stdio_flush(void)
Initialize all of the present standard stdio types that are linked into the binary.
Definition: stdio.c:200
int putchar_raw(int c)
putchar variant that skips any CR/LF conversion if enabled
Definition: stdio.c:154
int getchar_timeout_us(uint32_t timeout_us)
Return a character from stdin if there is one available within a timeout.
Definition: stdio.c:10
void stdio_set_translate_crlf(stdio_driver_t *driver, bool translate)
control conversion of line feeds to carriage return on transmissions
Definition: stdio.c:301
void stdio_init_all(void)
Initialize all of the present standard stdio types that are linked into the binary.
Definition: stdio.c:265
void stdio_filter_driver(stdio_driver_t *driver)
Control limiting of output to a single driver.
Definition: stdio.c:297
Definition: driver.h:13