14 lines
317 B
C
14 lines
317 B
C
|
#pragma once
|
||
|
|
||
|
#include <span>
|
||
|
#include <string_view>
|
||
|
|
||
|
#include "async.h"
|
||
|
#include "buffer.h"
|
||
|
|
||
|
async::task<buffer> UartRead(int size);
|
||
|
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()}));
|
||
|
}
|