Simple standard input/output (STDIO) abstraction for RIOT.
More...
Simple standard input/output (STDIO) abstraction for RIOT.
|
enum | {
STDIO_NULL
, STDIO_UART
, STDIO_RTT
, STDIO_SEMIHOSTING
,
STDIO_USBUS_CDC_ACM
, STDIO_TINYUSB_CDC_ACM
, STDIO_ESP32_SERIAL_JTAG
, STDIO_NIMBLE
,
STDIO_UDP
, STDIO_TELNET
, STDIO_ETHOS
, STDIO_SLIP
} |
|
|
void | stdio_init (void) |
| initialize the module
|
|
int | stdio_available (void) |
| Get the number of bytes available for reading from stdio.
|
|
void | stdio_clear_stdin (void) |
| Clear the input buffer.
|
|
ssize_t | stdio_read (void *buffer, size_t max_len) |
| read len bytes from stdio uart into buffer
|
|
ssize_t | stdio_write (const void *buffer, size_t len) |
| write len bytes from buffer into STDOUT
|
|
void | stdio_close (void) |
| Disable stdio and detach stdio providers.
|
|
|
isrpipe_t | stdin_isrpipe |
| isrpipe for writing stdin input to
|
|
◆ STDIO_PROVIDER
#define STDIO_PROVIDER |
( |
|
_type, |
|
|
|
_open, |
|
|
|
_close, |
|
|
|
_write |
|
) |
| |
Value:
.open = _open, \
.close = _close, \
.write = _write, \
};
#define XFA_CONST(type, xfa_name, prio)
Define variable in read-only cross-file array.
stdio implementation methods
- Parameters
-
_type | stdio provider type, for identification |
_open | attach / init function |
_close | close / disable function |
_write | write function |
Definition at line 154 of file stdio_base.h.
◆ STDIO_RX_BUFSIZE
#define STDIO_RX_BUFSIZE (64) |
◆ anonymous enum
Enumerator |
---|
STDIO_NULL | dummy stdio
|
STDIO_UART | stdio via UART
|
STDIO_RTT | stdio via Segger RTT
|
STDIO_SEMIHOSTING | stdio via Semihosting
|
STDIO_USBUS_CDC_ACM | stdio via USB CDC ACM (usbus)
|
STDIO_TINYUSB_CDC_ACM | tdio via USB CDC ACM (TinyUSB)
|
STDIO_ESP32_SERIAL_JTAG | stdio via ESP32 debug Serial/JTAG
|
STDIO_NIMBLE | stdio via BLE (NimBLE)
|
STDIO_UDP | stdio via UDP
|
STDIO_TELNET | stdio via telnet
|
STDIO_ETHOS | stdio via ethos (mutiplex)
|
Definition at line 44 of file stdio_base.h.
◆ stdio_available()
int stdio_available |
( |
void |
| ) |
|
Get the number of bytes available for reading from stdio.
- Warning
- This function is only available if the implementation supports it and the
stdio_available
module is enabled.
- Returns
- number of available bytes
◆ stdio_clear_stdin()
void stdio_clear_stdin |
( |
void |
| ) |
|
Clear the input buffer.
- Note
- Requires 'USEMODULE += stdin'
- Warning
- This function does only work if the stdio implementation supports it.
◆ stdio_read()
ssize_t stdio_read |
( |
void * |
buffer, |
|
|
size_t |
max_len |
|
) |
| |
read len
bytes from stdio uart into buffer
- Parameters
-
[out] | buffer | buffer to read into |
[in] | max_len | nr of bytes to read |
- Returns
- nr of bytes read
-
<0 on error
◆ stdio_write()
ssize_t stdio_write |
( |
const void * |
buffer, |
|
|
size_t |
len |
|
) |
| |
write len
bytes from buffer
into STDOUT
- Note
- Depending on the stdio backend(s) used, not all bytes might be written to stdout and accounted for if multiple backends are active, as not all stdout backends will do a blocking write.
- Parameters
-
[in] | buffer | buffer to read from |
[in] | len | nr of bytes to write |
- Returns
- nr of bytes written
-
<0 on error