NTC_THERMISTOR Driver 0.1.0
API reference
Loading...
Searching...
No Matches
ntc_thermistor_adc_interface.hpp
Go to the documentation of this file.
1// clang-format off: the table below must keep one row per line.
22// clang-format on
23#ifndef NTC_THERMISTOR_ADC_INTERFACE_HPP
24#define NTC_THERMISTOR_ADC_INTERFACE_HPP
25
26#include <concepts>
27#include <cstdint>
28
30
31namespace ntc_thermistor {
32
42template <typename Derived>
44public:
46 AdcInterface(const AdcInterface&) = delete;
49
50protected:
52 AdcInterface() noexcept = default;
54 ~AdcInterface() noexcept = default;
55};
56
63template <typename Port>
64concept AdcPort = std::derived_from<Port, AdcInterface<Port>> && requires {
65 detail::ExactHook<Port, bool() noexcept>::Take(&Port::EnsureInitialized);
66 detail::ExactHook<Port, bool(uint8_t, uint32_t&) noexcept>::Take(&Port::ReadRaw);
67};
68
69} // namespace ntc_thermistor
70
71#endif // NTC_THERMISTOR_ADC_INTERFACE_HPP
CRTP base of the platform ADC port.
Definition ntc_thermistor_adc_interface.hpp:43
AdcInterface(const AdcInterface &)=delete
Ports are not copied: the driver holds a reference.
AdcInterface & operator=(const AdcInterface &)=delete
Ports are not copied: the driver holds a reference.
AdcInterface() noexcept=default
Only the derived port is constructed.
Satisfied by a class that derives from AdcInterface<Port> and implements the required hooks with exac...
Definition ntc_thermistor_adc_interface.hpp:64
The NTC thermistor driver: everything it declares lives here; internals in detail.
Definition ntc_thermistor.hpp:25
Compile-time helpers of the NTC_THERMISTOR driver: typed integer literals, exact hook matching and en...