Menu Toggle
v2.3.1 (RP2350)
Toggle main menu visibility
Loading...
Searching...
No Matches
driver.h
1
/*
2
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
7
#ifndef _PICO_STDIO_DRIVER_H
8
#define _PICO_STDIO_DRIVER_H
9
10
#include "
pico/stdio.h
"
11
19
struct
stdio_driver
{
20
void (*
out_chars
)(
const
char
*buf,
int
len);
21
void (*
out_flush
)(void);
22
int (*
in_chars
)(
char
*buf,
int
len);
23
void (*
set_chars_available_callback
)(void (*fn)(
void
*),
void
*param);
24
stdio_driver_t *
next
;
25
#if PICO_STDIO_ENABLE_CRLF_SUPPORT
26
bool
last_ended_with_cr;
27
bool
crlf_enabled;
28
#endif
29
};
30
31
#endif
stdio.h
stdio_driver
A stdio driver that can be registered with the pico_stdio subsystem.
Definition
driver.h:19
stdio_driver::out_chars
void(* out_chars)(const char *buf, int len)
Output characters to the driver; may be NULL if output is not supported.
Definition
driver.h:20
stdio_driver::in_chars
int(* in_chars)(char *buf, int len)
Read available input characters; returns the number read, or may be NULL if input is not supported.
Definition
driver.h:22
stdio_driver::out_flush
void(* out_flush)(void)
Flush any buffered output; may be NULL.
Definition
driver.h:21
stdio_driver::set_chars_available_callback
void(* set_chars_available_callback)(void(*fn)(void *), void *param)
Register a callback to be invoked when input characters become available; may be NULL.
Definition
driver.h:23
stdio_driver::next
stdio_driver_t * next
Next driver in the linked list; managed by the stdio subsystem.
Definition
driver.h:24