#pragma once #include namespace adc { namespace detail { enum class Mode { SINGLE, AUTO, FREE_RUNNING, }; } // namespace detail enum class TriggerSource { FREE_RUNNING, ANALOG_COMP, EXTERNAL_INT_0, TIMER0_COMP_A, TIMER0_OVERFLOW, TIMER1_COMP_B, TIMER1_OVERFLOW, TIMER1_CAPTURE, }; template struct AutoMode { static constexpr auto SRC = src; }; struct FreeRunningMode { }; struct SingleMode { }; enum class VoltageRef { EXTERNAL, AVCC, INTERNAL, }; enum class InputSource { TEMP, VBG, GND, }; template struct Config { static constexpr auto MODE = detail::Mode::AUTO; static constexpr auto TRIGGER_SRC = Mode::SRC; static constexpr auto VREF = vref; static constexpr auto PRESCALER = prescaler; }; template struct Config { static constexpr auto MODE = detail::Mode::FREE_RUNNING; static constexpr auto VREF = vref; static constexpr auto PRESCALER = prescaler; }; template struct Config { static constexpr auto MODE = detail::Mode::SINGLE; static constexpr auto VREF = vref; static constexpr auto PRESCALER = prescaler; }; } // namespace adc