stm32/rcc: remove builders on Config.

This makes API consistent with other Config structs in Embassy, where
the convention is to not use builders.
This commit is contained in:
Dario Nieuwenhuis
2022-01-04 11:18:59 +01:00
parent f744b74e90
commit cdc66e110f
12 changed files with 42 additions and 236 deletions

View File

@ -118,10 +118,10 @@ impl Into<u8> for MSIRange {
/// Clocks configutation
pub struct Config {
mux: ClockSrc,
ahb_pre: AHBPrescaler,
apb1_pre: APBPrescaler,
apb2_pre: APBPrescaler,
pub mux: ClockSrc,
pub ahb_pre: AHBPrescaler,
pub apb1_pre: APBPrescaler,
pub apb2_pre: APBPrescaler,
}
impl Default for Config {
@ -136,32 +136,6 @@ impl Default for Config {
}
}
impl Config {
#[inline]
pub fn clock_src(mut self, mux: ClockSrc) -> Self {
self.mux = mux;
self
}
#[inline]
pub fn ahb_pre(mut self, pre: AHBPrescaler) -> Self {
self.ahb_pre = pre;
self
}
#[inline]
pub fn apb1_pre(mut self, pre: APBPrescaler) -> Self {
self.apb1_pre = pre;
self
}
#[inline]
pub fn apb2_pre(mut self, pre: APBPrescaler) -> Self {
self.apb2_pre = pre;
self
}
}
/// RCC peripheral
pub struct Rcc<'d> {
_rb: peripherals::RCC,