pub fn init<'d>(
    timer: impl EspWifiTimerSource + 'd,
    _rng: impl EspWifiRngSource + 'd,
    _radio_clocks: RADIO_CLK<'d>,
) -> Result<EspWifiController<'d>, InitializationError> {
    if crate::is_interrupts_disabled() {
        return Err(InitializationError::InterruptsDisabled);
    }

    // A minimum clock of 80MHz is required to operate WiFi module.
    const MIN_CLOCK: Rate = Rate::from_mhz(80);
    let clocks = Clocks::get();
    if clocks.cpu_clock < MIN_CLOCK {
        return Err(InitializationError::WrongClockConfig);
    }

    info!("esp-wifi configuration {:?}", crate::CONFIG);
    crate::common_adapter::chip_specific::enable_wifi_power_domain();
    phy_mem_init();

    setup_radio_isr();

    // Enable timer tick interrupt
    #[cfg(feature = "builtin-scheduler")]
    preempt_builtin::setup_timer(unsafe { timer.timer() });

    #[cfg(not(feature = "builtin-scheduler"))]
    let _ = timer; // mark used to suppress warning

    // This initializes the task switcher
    preempt::enable();

    init_tasks();
    yield_task();

    wifi_set_log_verbose();
    init_clocks();

    #[cfg(coex)]
    match crate::wifi::coex_initialize() {
        0 => {}
        error => return Err(InitializationError::General(error)),
    }

    Ok(EspWifiController {
        _inner: PhantomData,
    })
}
use esp_hal::{rng::Rng, timer::timg::TimerGroup};

let timg0 = TimerGroup::new(peripherals.TIMG0);
let init = esp_wifi::init(
timg0.timer0,
Rng::new(peripherals.RNG),
peripherals.RADIO_CLK,
)
.unwrap();
# }
```
esp-wifi/src/lib.rs