Config

Struct Config 

Source
pub struct Config {
    pub hxt48_enable: ConfigOption<bool>,
    pub hrc48_enable: ConfigOption<bool>,
    pub dll1: ConfigOption<DllConfig>,
    pub dll2: ConfigOption<DllConfig>,
    pub clk_sys_sel: ConfigOption<ClkSysSel>,
    pub hclk_div: ConfigOption<u8>,
    pub pclk1_div: ConfigOption<u8>,
    pub pclk2_div: ConfigOption<u8>,
    pub usb: ConfigOption<UsbConfig>,
    pub tick: ConfigOption<TickConfig>,
    pub clk_peri_sel: ConfigOption<ClkPeriSel>,
}

Fields§

§hxt48_enable: ConfigOption<bool>

Enable the 48MHz external crystal oscillator

§hrc48_enable: ConfigOption<bool>

Enable the 48MHz internal RC oscillator

§dll1: ConfigOption<DllConfig>

Configuration for DLL1

§dll2: ConfigOption<DllConfig>

Configuration for DLL2 Note: Bootloader typically configures this to 288MHz for PSRAM and external flash

§clk_sys_sel: ConfigOption<ClkSysSel>

Select the clock source for system clock (clk_sys)

§hclk_div: ConfigOption<u8>

HCLK divider: HCLK = CLK_SYS / hclk_div Valid range: 0 to 255

§pclk1_div: ConfigOption<u8>

PCLK1 divider: PCLK1 = HCLK / 2^pclk1_div Valid range: 0 to 7

§pclk2_div: ConfigOption<u8>

PCLK2 divider: PCLK2 = HCLK / 2^pclk2_div Valid range: 0 to 7

§usb: ConfigOption<UsbConfig>

USB clock configuration

§tick: ConfigOption<TickConfig>

Tick clock configuration

§clk_peri_sel: ConfigOption<ClkPeriSel>

Select the clock source for peripheral clock

Implementations§

Source§

impl Config

Source

pub fn new_keep() -> Self

Source

pub unsafe fn apply(&self)

Apply the RCC clock configuration to the hardware registers

Safety This function is typically called by sifli_hal::init() (configured in sifli_hal::Config.rcc), but can also be called independently as long as it does not interfere with the clocks of already initialized peripherals. In the Bootloader, FLASH and PSRAM have already been initialized. You must ensure that their clocks are not broken. If configuring the clock after calling sifli_hal::init(), make sure not to break the clock of Timer used as the time driver.

Trait Implementations§

Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.