mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 23:02:30 +00:00
stm32/usart: implement stop_bits configuration
This commit is contained in:
parent
9af25c3396
commit
64ebb9b7fe
@ -770,7 +770,14 @@ fn configure(r: Regs, config: &Config, pclk_freq: Hertz, multiplier: u32, enable
|
||||
|
||||
unsafe {
|
||||
r.brr().write_value(regs::Brr(div));
|
||||
r.cr2().write(|_w| {});
|
||||
r.cr2().write(|w| {
|
||||
w.set_stop(match config.stop_bits {
|
||||
StopBits::STOP0P5 => vals::Stop::STOP0P5,
|
||||
StopBits::STOP1 => vals::Stop::STOP1,
|
||||
StopBits::STOP1P5 => vals::Stop::STOP1P5,
|
||||
StopBits::STOP2 => vals::Stop::STOP2,
|
||||
});
|
||||
});
|
||||
r.cr1().write(|w| {
|
||||
// enable uart
|
||||
w.set_ue(true);
|
||||
|
Loading…
Reference in New Issue
Block a user