dreamcast/sh7091/serial.hpp
Zack Buhman f8dc9f1250 example: add video_output example
The intent of this example is to change video output modes in response
to swapping the cable type.
2024-03-09 17:15:36 +08:00

35 lines
704 B
C++

#include "string.hpp"
namespace serial {
void init(uint8_t bit_rate);
void character(const char c);
void string(const char * s);
void string(const uint8_t * s, uint32_t len);
void hexlify(const uint8_t n);
using hex = string::hex_type;
using dec = string::dec_type;
template <typename T, typename conv_type>
void integer(const T n, const char end, const uint32_t length);
template <typename T, typename conv_type = hex>
inline void integer(const T n, const char end)
{
constexpr uint32_t length = (sizeof (T)) * 2;
return integer<T, conv_type>(n, end, length);
}
template <typename T, typename conv_type = hex>
inline void integer(const T n)
{
return integer<T, conv_type>(n, '\n');
}
}