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
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
A stdio driver that can be registered with the pico_stdio subsystem.
Definition driver.h:19
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
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
void(* out_flush)(void)
Flush any buffered output; may be NULL.
Definition driver.h:21
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_t * next
Next driver in the linked list; managed by the stdio subsystem.
Definition driver.h:24