|
This page describes how the serial drivers work and how to access them.
|
|
This page describes how the serial drivers work and how to access them.
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
The [Serial communication](https://en.wikipedia.org/wiki/Serial_communication) can be both _synchronous_ or _asynchronous_.
|
|
|
|
|
|
|
|
Here you can see how it works (unidirectional case):
|
|
|
|
|
|
|
|
<div align="center"><img src="images/serial/serial.png" height="250"/><br/><i>Unidirectional serial transmission scheme.</i></div><br>
|
|
|
|
|
|
## Using `stdio.h` (*printf()*, *scanf()*, ...)
|
|
## Using `stdio.h` (*printf()*, *scanf()*, ...)
|
|
|
|
|
|
When you use functions like _printf()_, _scanf()_, _puts()_, _gets()_ etc... inside your code, Miosix redirects them to one of the microcontroller's serial ports, called the **default** serial port. This is defined in `miosix/config/arch/<your_arch>/<your_board>/board_settings.h`, along with the default baudrate and other related configurations. The file looks like this:
|
|
When you use functions like _printf()_, _scanf()_, _puts()_, _gets()_ etc... inside your code, Miosix redirects them to one of the microcontroller's serial ports, called the **default** serial port. This is defined in `miosix/config/arch/<your_arch>/<your_board>/board_settings.h`, along with the default baudrate and other related configurations. The file looks like this:
|
... | | ... | |