1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/stm32_common/periph
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
..
dac.c build: fix unused parameter errors 2017-11-28 14:36:01 +01:00
dma.c cpu/stm32_common: adapt DMA driver for f0/1/3/l0/1/4 2019-01-08 09:32:18 +01:00
eeprom.c cpu: drivers/eeprom: refactor periph_eeprom implementation 2018-10-16 10:39:10 +02:00
flash_common.c cpu/stm32_common: add flashpage support for stm32l4 2018-08-06 12:33:03 +02:00
flashpage.c cpu/stm32_common: add flashpage support for stm32l4 2018-08-06 12:33:03 +02:00
gpio.c cpu/stm32/gpio: power up port G with L4 2018-12-27 14:15:25 +01:00
hwrng.c cpu/stm32_common/hwrng: use CPU_LINE for for stm32f410-specific code 2018-07-09 11:52:05 +02:00
i2c_1.c cpu/stm_common: Refactor and cleanup i2c_1 2018-12-20 18:05:11 +01:00
i2c_2.c cpu/stm_common: Refactor and fix implementation for i2c_2 2018-12-20 12:01:06 +01:00
Makefile cpu/stm32_common: remove inadapted periph_flash_common 2018-10-11 15:20:44 +02:00
pm.c cpu/stm32_common/pm: use CPU_LINE for L053-specific code 2018-12-21 11:24:43 +01:00
pwm.c make: fix sign-compare errors 2017-11-28 11:55:48 +01:00
qdec.c cpu/stm32_common: add qdec implementation 2018-02-23 23:17:26 +01:00
rtc.c cpu/stm32: removed file guards from periph drivers 2017-11-09 16:27:24 +01:00
rtt.c stm32_common/rtt: add support for stm32f4 2018-02-08 17:39:39 +01:00
spi.c cpu/stm32_common: adapt DMA driver for f0/1/3/l0/1/4 2019-01-08 09:32:18 +01:00
timer.c make: fix sign-compare errors 2017-11-28 11:55:48 +01:00
uart.c cpu/stm32_common: add support for uart_mode routine 2019-01-31 14:15:20 +01:00