Skip to content

Commit 3d5fad5

Browse files
maribucrasbe
andcommitted
sys/stdio: better document configuration
This changes the documentation of how to configure stdio, especially with regard on how to configure the stdio frontends with `printf_float`, `printf_long_long`, and `stdin`. Co-authored-by: crasbe <[email protected]>
1 parent c3ac00c commit 3d5fad5

File tree

3 files changed

+46
-16
lines changed

3 files changed

+46
-16
lines changed

makefiles/pseudomodules.inc.mk

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,8 @@ PSEUDOMODULES += picolibc
342342
PSEUDOMODULES += picolibc_stdout_buffered
343343
PSEUDOMODULES += pktqueue
344344
PSEUDOMODULES += posix_headers
345-
## @defgroup sys_stdio_printf_float Support for printing floats
346-
## @ingroup sys_stdio
347-
## @{
348-
## This module enables printing of floats, if the printf implementation has
349-
## configurable features.
350345
PSEUDOMODULES += printf_float
351-
## @}
352-
## @defgroup sys_stdio_printf_long_long Support for printing long long
353-
## @ingroup sys_stdio
354-
## @{
355-
## This module enables printing of long long / unsigned long long, if the printf
356-
## implementation has configurable features.
357346
PSEUDOMODULES += printf_long_long
358-
## @}
359347
PSEUDOMODULES += prng
360348
PSEUDOMODULES += prng_%
361349
PSEUDOMODULES += psa_riot_cipher_aes_common

sys/include/stdio_base.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
*/
99

1010
/**
11-
* @defgroup sys_stdio STDIO abstraction
12-
* @ingroup sys
13-
*
14-
* @brief Simple standard input/output (STDIO) abstraction for RIOT
11+
* @addtogroup sys_stdio STDIO abstraction
1512
*
1613
* @{
1714
* @file

sys/stdio/doc.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@defgroup sys_stdio STDIO abstraction
2+
@ingroup sys
3+
4+
@brief Simple standard input/output (STDIO) abstraction for RIOT
5+
6+
# Abstract
7+
8+
STDIO in RIOT is split into two parts: An interface to the stdio transports
9+
consisting mainly of @ref stdio_read and @ref stdio_write provided by RIOT,
10+
and the standard C stdio functions (such as `printf()`, `puts()`, `scanf()`)
11+
provided by the standard C library.
12+
13+
## Configuring STDIO
14+
15+
While the standard features for input and output are enabled by default, some
16+
additional features have to be enabled explicitly due to higher memory
17+
consumption. This includes the following features:
18+
19+
| Module | Features |
20+
|:-------------------- |:--------------------------------------------- |
21+
| `printf_float` | Support for printing floats/doubles |
22+
| `printf_long_long` | Support for printing (unsigned) long long |
23+
| `stdin` | Support for input (default is output only) |
24+
25+
The additional features can be enabled in the application Makefile:
26+
```Makefile
27+
USEMODULE += printf_float
28+
```
29+
30+
@note Modules that depend on a certain stdio feature will depend on that. E.g.
31+
when using the @ref sys_shell module, the module `stdin` is
32+
automatically used, as it is a dependency.
33+
34+
## Enable STDIO Backends
35+
36+
The various transports supported by RIOT are enabled by selecting the
37+
corresponding modules, such as @ref sys_stdio_uart, @ref usbus_cdc_acm_stdio,
38+
or @ref sys_stdio_rtt. All available options can are shown as mdoules in the
39+
list below.
40+
41+
As with the additional features, you can specify the STDIO backend to be used in your application Makefile:
42+
43+
```Makefile
44+
USEMODULE += stdio_cdc_acm
45+
```

0 commit comments

Comments
 (0)