Skip to content
Snippets Groups Projects
Unverified Commit f8a7c026 authored by Kevin "Bear Puncher" Weiss's avatar Kevin "Bear Puncher" Weiss Committed by GitHub
Browse files

Merge pull request #10984 from yegorich/pr/uart/documentation-fix

periph/uart: improve documentation
parents 63fd8bc8 b8ff48cc
No related branches found
No related tags found
No related merge requests found
...@@ -14,24 +14,23 @@ ...@@ -14,24 +14,23 @@
* This is a basic UART (Universal Asynchronous Receiver Transmitter) interface * This is a basic UART (Universal Asynchronous Receiver Transmitter) interface
* to allow platform independent access to the MCU's serial communication * to allow platform independent access to the MCU's serial communication
* abilities. This interface is intentionally designed to be as simple as * abilities. This interface is intentionally designed to be as simple as
* possible, to allow for easy implementation and maximum portability. In RIOT * possible, to allow for easy implementation and maximum portability.
* we only use the common 8-N-1 format of the serial port (8 data bits, no *
* parity bit, one stop bit). * The simple interface provides capabilities to initialize and configure
* * the serial communication module, which automatically enables for receiving
* The simple interface provides capabilities to initialize the serial * data, as well as writing data to the UART port, which means transmitting
* communication module, which automatically enables for receiving data, as well * data. The UART device and the corresponding pins need to be mapped in
* as writing data to the UART port, which means transmitting data. The UART * `RIOT/boards/ * /include/periph_conf.h`. Furthermore, you need to select the
* device and the corresponding pins need to be mapped in
* `RIOT/boards/ * /include/periph_conf.h`. Furthermore you need to select the
* baudrate for initialization which is typically {9600, 19200, 38400, 57600, * baudrate for initialization which is typically {9600, 19200, 38400, 57600,
* 115200} baud. Additionally you should register a callback function that is * 115200} baud. Additionally, you should register a callback function that is
* executed in interrupt context when data is being received. The driver will * executed in interrupt context when data is being received. The driver will
* then read the received data byte, call the registered callback function and * then read the received data byte, call the registered callback function and
* pass the received data to it via its argument. The interface enforces the * pass the received data to it via its argument. The interface enforces the
* receiving to be implemented in an interrupt driven mode. Thus, you never know * receiving to be implemented in an interrupt driven mode. Thus, you never know
* how many bytes are going to be received and might want to handle that in your * how many bytes are going to be received and might want to handle that in your
* specific callback function. The transmit function can be implemented in any * specific callback function. The transmit function can be implemented in any
* way. * way. You can also configure parity, the number of data and stop bits, i.e.
* such combinations as 8-E-1, 7-N-2 etc. 8-N-1 mode is set by default.
* *
* By default the @p UART_DEV(0) device of each board is initialized and mapped * By default the @p UART_DEV(0) device of each board is initialized and mapped
* to STDIO in RIOT which is used for standard input/output functions like * to STDIO in RIOT which is used for standard input/output functions like
...@@ -175,7 +174,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg); ...@@ -175,7 +174,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg);
/** /**
* @brief Setup parity, data and stop bits for a given UART device * @brief Setup parity, data and stop bits for a given UART device
* *
* @param[in] uart UART device to initialize * @param[in] uart UART device to configure
* @param[in] data_bits number of data bits in a UART frame * @param[in] data_bits number of data bits in a UART frame
* @param[in] parity parity mode * @param[in] parity parity mode
* @param[in] stop_bits number of stop bits in a UART frame * @param[in] stop_bits number of stop bits in a UART frame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment