stdio.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#ifndef _PICO_STDIO_H
7#define _PICO_STDIO_H
8
9typedef struct stdio_driver stdio_driver_t;
10
11#define STDIO_ERROR -1
12#define STDIO_NO_INPUT -2
13
14static inline void stdio_usb_init() {}
15void stdio_uart_init();
16static inline void stdio_init_all() { stdio_uart_init(); }
17static inline void stdio_filter_driver(stdio_driver_t *driver) {}
18static inline void stdio_set_translate_crlf(stdio_driver_t *driver, bool enabled) {}
19static inline bool stdio_usb_connected(void) { return true; }
20int getchar_timeout_us(uint32_t timeout_us);
21#define puts_raw puts
22#define putchar_raw putchar
23
24#endif
void stdio_uart_init()
Explicitly initialize stdin/stdout over UART and add it to the current set of stdin/stdout drivers.
Definition: stdio.c:21
bool stdio_usb_connected(void)
Check if there is an active stdio CDC connection to a host.
Definition: stdio_usb.c:126
bool stdio_usb_init(void)
Explicitly initialize USB stdio and add it to the current set of stdin drivers.
Definition: stdio_usb.c:91
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