Added driving parameter

This commit is contained in:
BlackMark 2019-07-28 14:09:09 +02:00
parent d9a05d0273
commit fd7e8e7238

View File

@ -12,11 +12,16 @@ enum class Mode {
SPI, SPI,
}; };
template <Mode mode, class config> enum class Driven {
INTERRUPT,
BLOCKING,
};
template <Mode mode, class cfg = config<>, Driven driven = Driven::INTERRUPT>
class hardware0 { class hardware0 {
public: public:
using data_t = typename config::data_t; using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = config::DATA_BITS; static constexpr auto DATA_BITS = cfg::DATA_BITS;
static void init() {} static void init() {}
@ -30,9 +35,9 @@ class hardware0 {
static data_t peek() {} static data_t peek() {}
private: private:
static constexpr auto BAUD_RATE = config::BAUD_RATE; static constexpr auto BAUD_RATE = cfg::BAUD_RATE;
static constexpr auto PARITY = config::PARITY; static constexpr auto PARITY = cfg::PARITY;
static constexpr auto STOP_BITS = config::STOP_BITS; static constexpr auto STOP_BITS = cfg::STOP_BITS;
}; };
} // namespace uart } // namespace uart