1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/stm32_common
Yegor Yefremov 60f745a033 cpu/stm32_common: add support for uart_mode routine
Add support for specifying data bits, stop bits and parity at
runtime.

Introduce feature periph_uart_modecfg for uart_mode() till all
other CPUs implement it.

STM32 L1, F1, F2, F4 supports following modes:

* 7E1, 7E2
* 7O1, 7O2
* 8N1, 8N2
* 8E1, 8E2
* 8O1, 8O2

STM32 L0, L4, F0, F3, F7 supports following modes:

* 6E1, 6E2
* 6O1, 6O2
* 7E1, 7E2
* 7O1, 7O2
* 7N1, 7N2
* 8N1, 8N2
* 8E1, 8E2
* 8O1, 8O2

Use USART_CR1_M1 macro to detect 7-bit support because
even inside one family there could be devices that don't
support 7-bit mode. So just using a family macro is not
enough.

As stated in the datasheets for L0, L4, F0, F3, F7 devices,
data bits can only be changed when UART is disabled (UE=0).
Introduce uart_stop() routine to satisfy this requirement.

STM32 UART adds parity to the MSB of a byte to send. The same
also applies to the received bytes. As a result this bit must
be masked in order to get the pure data.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-01-31 14:15:20 +01:00
..
dist cpu/stm32_common: fix clk_conf 2017-10-11 12:39:02 +02:00
include cpu/stm32_common: add support for uart_mode routine 2019-01-31 14:15:20 +01:00
ldscripts stm32_common: Adjust ldscript memory segment attributes 2018-05-09 06:49:29 +02:00
periph cpu/stm32_common: add support for uart_mode routine 2019-01-31 14:15:20 +01:00
cpu_common.c cpu/stm32_common: add support for lpuart 2018-12-13 12:39:00 +01:00
cpu_init.c cpu/stm32_common: add DMA implementation for F2/F4/F7 2018-05-23 11:09:46 +02:00
doc.txt cpu/stm32_common: update doc 2017-09-01 10:15:26 +02:00
Makefile cpu/stm32_common: build common module 2016-03-16 12:17:16 +01:00
Makefile.features cpu/stm32_common: add support for uart_mode routine 2019-01-31 14:15:20 +01:00
Makefile.include cpu/stm32_common: remove inadapted periph_flash_common 2018-10-11 15:20:44 +02:00
stm32_mem_lengths.mk cpu/stm32_common: add variable for SRAM2 length on stm32l47xxx 2018-07-17 17:52:12 +02:00
stmclk_common.c cpu/stm32_common: always enable PWR module 2018-03-06 14:55:32 +01:00
stmclk_l0l1.c cpu/stm32_common: always enable PWR module 2018-03-06 14:55:32 +01:00
stmclk.c cpu/stm32_common: fix extra PLL enabling 2017-09-01 10:26:04 +02:00