synth/arm/uart.h
2022-05-16 20:59:17 -07:00

23 lines
530 B
C++

#pragma once
#include <span>
#include <string_view>
#include "xuartlite.h"
extern XUartLite* uart0;
void InitUarts();
// blocking
void UartSend(std::span<const std::byte> data);
inline void UartSend(std::string_view s) {
return UartSend(std::as_bytes(std::span{s.data(), s.size()}));
}
void UartSendCrash(std::span<const std::byte> data);
inline void UartSendCrash(std::string_view s) {
return UartSendCrash(std::as_bytes(std::span{s.data(), s.size()}));
}
void HandleUartTxFromIsr(void*, unsigned int transmitted);