pub fn uart0(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom0: pac::SERCOM0,
    mclk: &mut pac::MCLK,
    uart_rx: impl Into<IoSet3Sercom0Pad2>,
    uart_tx: impl Into<IoSet3Sercom0Pad0>,
) -> Uart0 {
    let gclk0 = clocks.gclk0();
    let clock = &clocks.sercom0_core(&gclk0).unwrap();
    let baud = baud.into();
    let pads = uart::Pads::default().rx(uart_rx.into()).tx(uart_tx.into());
    uart::Config::new(mclk, sercom0, pads, clock.freq())
        .baud(baud, BaudMode::Fractional(Oversampling::Bits16))
        .enable()
}
/// Utility function for setting up SERCOM0 pins as an additional
/// UART peripheral.
Utility function for setting up SERCOM0 pins as an additional
UART peripheral.
Utility function for setting up SERCOM0 pins as an additional UART peripheral .
pub fn uart0(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom0: pac::SERCOM0,
    mclk: &mut pac::MCLK,
    uart_rx: impl Into<IoSet3Sercom0Pad2>,
    uart_tx: impl Into<IoSet3Sercom0Pad0>,
) -> Uart0 {
    let gclk0 = clocks.gclk0();
    let clock = &clocks.sercom0_core(&gclk0).unwrap();
    let baud = baud.into();
    let pads = uart::Pads::default().rx(uart_rx.into()).tx(uart_tx.into());
    uart::Config::new(mclk, sercom0, pads, clock.freq())
        .baud(baud, BaudMode::Fractional(Oversampling::Bits16))
        .enable()
}
pub fn uart0 ( clocks : & mut GenericClockController , baud : impl Into < Hertz > , sercom0 : pac :: SERCOM0 , mclk : & mut pac :: MCLK , uart_rx : impl Into < IoSet3Sercom0Pad2 > , uart_tx : impl Into < IoSet3Sercom0Pad0 > , ) -> Uart0 { let gclk0 = clocks . gclk0 ( ) ; let clock = & clocks . sercom0_core ( & gclk0 ) . unwrap ( ) ; let baud = baud . into ( ) ; let pads = uart :: Pads :: default ( ) . rx ( uart_rx . into ( ) ) . tx ( uart_tx . into ( ) ) ; uart :: Config :: new ( mclk , sercom0 , pads , clock . freq ( ) ) . baud ( baud , BaudMode :: Fractional ( Oversampling :: Bits16 ) ) . enable ( ) }
Utility function for setting up SERCOM0 pins as an additional
UART peripheral.
Utility function for setting up SERCOM0 pins as an additional UART peripheral .
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom0
pac::SERCOM0
mclk
&mut pac::MCLK
uart_rx
impl Into<IoSet3Sercom0Pad2>
uart_tx
impl Into<IoSet3Sercom0Pad0>
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom0
pac::SERCOM0
mclk
&mut pac::MCLK
uart_rx
impl Into<IoSet3Sercom0Pad2>
uart_tx
impl Into<IoSet3Sercom0Pad0>