unsafe fn configure_external_oscillator_pll(
    frequency: OscillatorFrequency,
    startup_mode: OscillatorStartup,
) {
    // Use the cache
    flashcalw::FLASH_CONTROLLER.enable_cache();

    // Need the 32k RC oscillator for things like BPM module and AST.
    bscif::enable_rc32k();

    // start the external oscillator
    match frequency {
        OscillatorFrequency::Frequency16MHz => {
            match startup_mode {
                OscillatorStartup::FastStart => scif::setup_osc_16mhz_fast_startup(),
                OscillatorStartup::SlowStart => scif::setup_osc_16mhz_slow_startup(),
            };
        }
    }

    // Setup the PLL
    scif::setup_pll_osc_48mhz();

    // Go to high speed flash mode
    flashcalw::FLASH_CONTROLLER.enable_high_speed_flash();

    // Set the main clock to be the PLL
    select_main_clock(MainClock::PLL);
}
/// Configure the system clock to use the PLL with the 16 MHz external crystal
Configure the system clock to use the PLL with the 16 MHz external crystal
Configure the system clock to use the PLL with the 16 MHz external crystal
unsafe fn configure_external_oscillator_pll(
    frequency: OscillatorFrequency,
    startup_mode: OscillatorStartup,
) {
    // Use the cache
    flashcalw::FLASH_CONTROLLER.enable_cache();
    // Need the 32k RC oscillator for things like BPM module and AST.
    bscif::enable_rc32k();
    // start the external oscillator
    match frequency {
        OscillatorFrequency::Frequency16MHz => {
            match startup_mode {
                OscillatorStartup::FastStart => scif::setup_osc_16mhz_fast_startup(),
                OscillatorStartup::SlowStart => scif::setup_osc_16mhz_slow_startup(),
            };
        }
    }
    // Setup the PLL
    scif::setup_pll_osc_48mhz();
    // Go to high speed flash mode
    flashcalw::FLASH_CONTROLLER.enable_high_speed_flash();
    // Set the main clock to be the PLL
    select_main_clock(MainClock::PLL);
}
unsafe fn configure_external_oscillator_pll ( frequency : OscillatorFrequency , startup_mode : OscillatorStartup , ) { // Use the cache flashcalw :: FLASH_CONTROLLER . enable_cache ( ) ; // Need the 32k RC oscillator for things like BPM module and AST. bscif :: enable_rc32k ( ) ; // start the external oscillator match frequency { OscillatorFrequency :: Frequency16MHz => { match startup_mode { OscillatorStartup :: FastStart => scif :: setup_osc_16mhz_fast_startup ( ) , OscillatorStartup :: SlowStart => scif :: setup_osc_16mhz_slow_startup ( ) , } ; } } // Setup the PLL scif :: setup_pll_osc_48mhz ( ) ; // Go to high speed flash mode flashcalw :: FLASH_CONTROLLER . enable_high_speed_flash ( ) ; // Set the main clock to be the PLL select_main_clock ( MainClock :: PLL ) ; }
Configure the system clock to use the PLL with the 16 MHz external crystal
Configure the system clock to use the PLL with the 16 MHz external crystal
frequency
OscillatorFrequency
startup_mode
OscillatorStartup
frequency
OscillatorFrequency
startup_mode
OscillatorStartup