stm32/usart: Data length is including parity. To get e.g. 8E1 you need to choose 9 data bits
This commit is contained in:
parent
6040517774
commit
f4677469f9
@ -219,7 +219,11 @@ impl<'d, T: Instance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> {
|
|||||||
w.set_ue(true);
|
w.set_ue(true);
|
||||||
w.set_te(true);
|
w.set_te(true);
|
||||||
w.set_re(true);
|
w.set_re(true);
|
||||||
w.set_m0(vals::M0::BIT8);
|
w.set_m0(if config.parity != Parity::ParityNone {
|
||||||
|
vals::M0::BIT9
|
||||||
|
} else {
|
||||||
|
vals::M0::BIT8
|
||||||
|
});
|
||||||
w.set_pce(config.parity != Parity::ParityNone);
|
w.set_pce(config.parity != Parity::ParityNone);
|
||||||
w.set_ps(match config.parity {
|
w.set_ps(match config.parity {
|
||||||
Parity::ParityOdd => vals::Ps::ODD,
|
Parity::ParityOdd => vals::Ps::ODD,
|
||||||
|
Loading…
Reference in New Issue
Block a user