#pragma once

#include <span>
#include <string_view>

#include "lib/async.h"
#include "lib/buffer.h"

async::task<buffer> UartRead(int size);
async::task<std::byte> UartReadLoop();
async::task<> UartWrite(std::span<const std::byte> data);
inline async::task<> UartWrite(std::string_view s) {
    co_await UartWrite(std::as_bytes(std::span{s.data(), s.size()}));
}
async::task<> UartWriteLoop(async::gimme<std::span<const std::byte>>& data);
