uart/hardware0.hpp

44 lines
727 B
C++
Raw Normal View History

#pragma once
2019-07-28 12:15:19 +02:00
#include "config.hpp"
namespace uart {
2019-07-28 12:15:19 +02:00
enum class Mode {
ASYNCHRONOUS,
ASYNCHRONOUS_2X,
SYNCHRONOUS_MASTER,
SYNCHRONOUS_SLAVE,
SPI,
};
2019-07-28 14:09:09 +02:00
enum class Driven {
INTERRUPT,
BLOCKING,
};
template <Mode mode, class cfg = config<>, Driven driven = Driven::INTERRUPT>
class hardware0 {
public:
2019-07-28 14:09:09 +02:00
using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = cfg::DATA_BITS;
static void init() {}
static void txByte(data_t byte)
{
static_cast<void>(byte);
}
static data_t rxByte() {}
static data_t peek() {}
2019-07-28 12:15:19 +02:00
private:
2019-07-28 14:09:09 +02:00
static constexpr auto BAUD_RATE = cfg::BAUD_RATE;
static constexpr auto PARITY = cfg::PARITY;
static constexpr auto STOP_BITS = cfg::STOP_BITS;
};
} // namespace uart