pub fn usb_allocator(
    dm: impl Into<UsbDm>,
    dp: impl Into<UsbDp>,
    usb: pac::USB,
    clocks: &mut GenericClockController,
    mclk: &mut pac::MCLK,
) -> UsbBusAllocator<UsbBus> {
    use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};

    clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
    let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
    let usb_clock = &clocks.usb(&usb_gclk).unwrap();
    let (dm, dp) = (dm.into(), dp.into());
    UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, dm, dp, usb))
}
/// Convenience function for setting up USB
Convenience function for setting up USB
Convenience function for setting up USB
pub fn usb_allocator(
    dm: impl Into<UsbDm>,
    dp: impl Into<UsbDp>,
    usb: pac::USB,
    clocks: &mut GenericClockController,
    mclk: &mut pac::MCLK,
) -> UsbBusAllocator<UsbBus> {
    use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};
    clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
    let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
    let usb_clock = &clocks.usb(&usb_gclk).unwrap();
    let (dm, dp) = (dm.into(), dp.into());
    UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, dm, dp, usb))
}
pub fn usb_allocator ( dm : impl Into < UsbDm > , dp : impl Into < UsbDp > , usb : pac :: USB , clocks : & mut GenericClockController , mclk : & mut pac :: MCLK , ) -> UsbBusAllocator < UsbBus > { use pac :: gclk :: { genctrl :: SRC_A , pchctrl :: GEN_A } ; clocks . configure_gclk_divider_and_source ( GEN_A :: GCLK2 , 1 , SRC_A :: DFLL , false ) ; let usb_gclk = clocks . get_gclk ( GEN_A :: GCLK2 ) . unwrap ( ) ; let usb_clock = & clocks . usb ( & usb_gclk ) . unwrap ( ) ; let ( dm , dp ) = ( dm . into ( ) , dp . into ( ) ) ; UsbBusAllocator :: new ( UsbBus :: new ( usb_clock , mclk , dm , dp , usb ) ) }
Convenience function for setting up USB
Convenience function for setting up USB
dm
impl Into<UsbDm>
dp
impl Into<UsbDp>
usb
pac::USB
clocks
&mut GenericClockController
mclk
&mut pac::MCLK
dm
impl Into<UsbDm>
dp
impl Into<UsbDp>
usb
pac::USB
clocks
&mut GenericClockController
mclk
&mut pac::MCLK