@@ -141,6 +141,26 @@ struct ADCDomain {
141141 .sample_rate_hz = sample_rate_hz,
142142 .output = &output} {}
143143
144+ consteval ADC (
145+ const GPIODomain::Pin& pin,
146+ Resolution resolution = Resolution::BITS_12,
147+ SampleTime sample_time = SampleTime::CYCLES_8_5,
148+ ClockPrescaler prescaler = ClockPrescaler::DIV1,
149+ uint32_t sample_rate_hz = 0 ,
150+ Peripheral peripheral = Peripheral::AUTO,
151+ Channel channel = Channel::AUTO
152+ )
153+ : gpio{pin, GPIODomain::OperationMode::ANALOG, GPIODomain::Pull::None, GPIODomain::Speed::Low},
154+ e{.gpio_idx = 0 ,
155+ .pin = pin,
156+ .peripheral = peripheral,
157+ .channel = channel,
158+ .resolution = resolution,
159+ .sample_time = sample_time,
160+ .prescaler = prescaler,
161+ .sample_rate_hz = sample_rate_hz,
162+ .output = nullptr } {}
163+
144164 consteval ADC (
145165 const GPIODomain::Pin& pin,
146166 Peripheral peripheral,
@@ -160,6 +180,25 @@ struct ADCDomain {
160180 peripheral,
161181 channel) {}
162182
183+ consteval ADC (
184+ const GPIODomain::Pin& pin,
185+ Peripheral peripheral,
186+ Channel channel,
187+ Resolution resolution = Resolution::BITS_12,
188+ SampleTime sample_time = SampleTime::CYCLES_8_5,
189+ ClockPrescaler prescaler = ClockPrescaler::DIV1,
190+ uint32_t sample_rate_hz = 0
191+ )
192+ : ADC(
193+ pin,
194+ resolution,
195+ sample_time,
196+ prescaler,
197+ sample_rate_hz,
198+ peripheral,
199+ channel
200+ ) {}
201+
163202 template <class Ctx > consteval std::size_t inscribe (Ctx& ctx) const {
164203 const auto gpio_idx = gpio.inscribe (ctx);
165204 Entry entry = e;
0 commit comments