Skip to content

Commit ca7f448

Browse files
committed
Readme - add STDIO section
1 parent 7c834dc commit ca7f448

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@ for more details).
99
Because of this, you'll always want to make `mbed-drivers` a dependency of your mbed OS application. Check
1010
[our "Getting started" guide](https://docs.mbed.com/docs/getting-started-mbed-os/) for more details about `mbed-drivers`
1111
and mbed OS in general.
12+
13+
### STDIO retartgeting
14+
15+
The mbed-drivers defines retargeting of stdin, stdout and stderr to UART. The default baudrate for STDIO UART peripheral is set via ```YOTTA_CFG_MBED_OS_STDIO_DEFAULT_BAUD```. If this yotta config is not defined, the default value is 115200.
16+
17+
To change STDIO serial settings in the runtime, retrieve the Serial STDIO object ```get_stdio_serial()```.
18+
19+
```
20+
Serial& pc = get_stdio_serial();
21+
pc.baud(9600);
22+
```

test/serial_interrupt/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void app_start(int, char*[]) {
3838
MBED_HOSTTEST_SELECT(echo);
3939
MBED_HOSTTEST_DESCRIPTION(serial interrupt test);
4040
MBED_HOSTTEST_START("MBED_14");
41+
computer.baud(115200);
4142
computer.attach(&txCallback, Serial::TxIrq);
4243
computer.attach(&rxCallback, Serial::RxIrq);
4344
}

0 commit comments

Comments
 (0)