Function defmt_serial::defmt_serial

source ·
pub fn defmt_serial(serial: impl Write<u8> + 'static)
Expand description

Assign a serial peripheral to receive defmt-messages.

    let mut serial = hal::uart::Uart0::new(dp.UART0, pins.tx0, pins.rx0);
    defmt_serial::defmt_serial(serial);

    defmt::info!("Hello from defmt!");

The peripheral should implement the embedded_hal::blocking::serial::Write trait. If your HAL already has the non-blocking Write implemented, it can opt-in to the default implementation.