#pragma once

#include <span>
#include <string_view>

void InitUarts();

// send and poll the uart until transmitted
void UartWriteCrash(std::span<const std::byte> data);
inline void UartWriteCrash(std::string_view s) {
    return UartWriteCrash(std::as_bytes(std::span{s.data(), s.size()}));
}

void UartEcho();

void HandleUartTxFromIsr(void*, unsigned int transmitted);
void HandleUartRxFromIsr(void*, unsigned int);
void HandleUartIsr();
