STM32: combine RccPeripherals reset() and enable() to reset_and_enable()

This commit is contained in:
pbert
2023-10-11 18:06:43 +02:00
parent eb368f77a4
commit f65a96c541
37 changed files with 105 additions and 154 deletions

View File

@ -152,9 +152,8 @@ impl<'d, T: BasicInstance> BufferedUart<'d, T> {
config: Config,
) -> Result<Self, ConfigError> {
// UartRx and UartTx have one refcount ea.
T::enable();
T::enable();
T::reset();
T::reset_and_enable();
T::reset_and_enable();
Self::new_inner(peri, rx, tx, tx_buffer, rx_buffer, config)
}
@ -173,9 +172,8 @@ impl<'d, T: BasicInstance> BufferedUart<'d, T> {
into_ref!(cts, rts);
// UartRx and UartTx have one refcount ea.
T::enable();
T::enable();
T::reset();
T::reset_and_enable();
T::reset_and_enable();
rts.set_as_af(rts.af_num(), AFType::OutputPushPull);
cts.set_as_af(cts.af_num(), AFType::Input);
@ -201,9 +199,8 @@ impl<'d, T: BasicInstance> BufferedUart<'d, T> {
into_ref!(de);
// UartRx and UartTx have one refcount ea.
T::enable();
T::enable();
T::reset();
T::reset_and_enable();
T::reset_and_enable();
de.set_as_af(de.af_num(), AFType::OutputPushPull);
T::regs().cr3().write(|w| {