Refactored class names to start with capital letter

This commit is contained in:
BlackMark 2019-07-28 17:57:49 +02:00
parent 8e0ba5a463
commit 4a9cee922a
4 changed files with 43 additions and 43 deletions

View File

@ -37,7 +37,7 @@ struct choose_data_type<DataBits::NINE> {
template <uint32_t baudRate = 9600, DataBits dataBits = DataBits::EIGHT, Parity parity = Parity::NONE,
StopBits stopBits = StopBits::ONE>
struct config {
struct Config {
static constexpr auto BAUD_RATE = baudRate;
static constexpr auto DATA_BITS = dataBits;
static constexpr auto PARITY = parity;

View File

@ -187,8 +187,8 @@ static constexpr auto currentHardware = SupportedHardware::ATmega1284P;
} // namespace detail
template <Mode mode = Mode::ASYNCHRONOUS, class cfg = config<>, Driven driven = Driven::INTERRUPT>
class hardware0 {
template <Mode mode = Mode::ASYNCHRONOUS, class cfg = Config<>, Driven driven = Driven::INTERRUPT>
class Hardware0 {
public:
using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = cfg::DATA_BITS;

View File

@ -6,8 +6,8 @@
namespace uart {
template <io::P rxPin, io::P txPin, class cfg = config<>>
class software {
template <io::P rxPin, io::P txPin, class cfg = Config<>>
class Software {
public:
using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = cfg::DATA_BITS;

View File

@ -21,19 +21,19 @@ struct always_false {
} // namespace detail
template <class Driver>
class uart {
class Uart {
public:
// Initialization is done upon construction
uart()
Uart()
{
Driver::init();
}
// Moving and copying uart objects is not supported
uart(const uart &) = delete;
uart(uart &&) = delete;
uart &operator=(const uart &) = delete;
uart &operator=(uart &&) = delete;
Uart(const Uart &) = delete;
Uart(Uart &&) = delete;
Uart &operator=(const Uart &) = delete;
Uart &operator=(Uart &&) = delete;
static void txByte(typename Driver::data_t byte) FORCE_INLINE
{
@ -71,104 +71,104 @@ class uart {
//////////////////////////////////////////////////////////////////////////
// Output stream overloads
uart &operator<<(const char *str) FORCE_INLINE
Uart &operator<<(const char *str) FORCE_INLINE
{
txString(str);
return *this;
}
uart &operator<<(const ::detail::FlashString *str) FORCE_INLINE
Uart &operator<<(const ::detail::FlashString *str) FORCE_INLINE
{
txString(str);
return *this;
}
template <typename... Ts>
uart &operator<<(char)
Uart &operator<<(char)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(unsigned char)
Uart &operator<<(unsigned char)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(short)
Uart &operator<<(short)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(unsigned short)
Uart &operator<<(unsigned short)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(int)
Uart &operator<<(int)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(unsigned int)
Uart &operator<<(unsigned int)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(long)
Uart &operator<<(long)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(unsigned long)
Uart &operator<<(unsigned long)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(long long)
Uart &operator<<(long long)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(unsigned long long)
Uart &operator<<(unsigned long long)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(float)
Uart &operator<<(float)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(double)
Uart &operator<<(double)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(long double)
Uart &operator<<(long double)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(bool)
Uart &operator<<(bool)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator<<(const void *)
Uart &operator<<(const void *)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
@ -177,91 +177,91 @@ class uart {
// Input stream overloads
template <typename... Ts>
uart &operator>>(char &)
Uart &operator>>(char &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(unsigned char &)
Uart &operator>>(unsigned char &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(short &)
Uart &operator>>(short &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(unsigned short &)
Uart &operator>>(unsigned short &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(int &)
Uart &operator>>(int &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(unsigned int &)
Uart &operator>>(unsigned int &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(long &)
Uart &operator>>(long &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(unsigned long &)
Uart &operator>>(unsigned long &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(long long &)
Uart &operator>>(long long &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(unsigned long long &)
Uart &operator>>(unsigned long long &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(float &)
Uart &operator>>(float &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(double &)
Uart &operator>>(double &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(long double &)
Uart &operator>>(long double &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(bool &)
Uart &operator>>(bool &)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}
template <typename... Ts>
uart &operator>>(const void *&)
Uart &operator>>(const void *&)
{
static_assert(detail::always_false<Ts...>::value, "Not implemented");
}