stm32/usart: implement stop_bits configuration
This commit is contained in:
		@@ -770,7 +770,14 @@ fn configure(r: Regs, config: &Config, pclk_freq: Hertz, multiplier: u32, enable
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    unsafe {
 | 
					    unsafe {
 | 
				
			||||||
        r.brr().write_value(regs::Brr(div));
 | 
					        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| {
 | 
					        r.cr1().write(|w| {
 | 
				
			||||||
            // enable uart
 | 
					            // enable uart
 | 
				
			||||||
            w.set_ue(true);
 | 
					            w.set_ue(true);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user