Skip to content

Commit 4c8b953

Browse files
committed
Allow turning an enabled ADC into a dynamic one
1 parent 1caf712 commit 4c8b953

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/adc/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,13 @@ impl<ADC: Instance> Adc<ADC, Configured> {
13371337
}
13381338
}
13391339

1340+
/// Releases the Adc as a DynamicAdc.
1341+
/// While this is not unsafe; using methods while the Adc is in the wrong state will mess it up.
1342+
#[inline(always)]
1343+
pub fn into_dynamic_adc(self) -> DynamicAdc<ADC> {
1344+
self.adc
1345+
}
1346+
13401347
/// Starts conversion sequence. Waits for the hardware to indicate it's actually started.
13411348
#[inline(always)]
13421349
pub fn start_conversion(mut self) -> Adc<ADC, Active> {

0 commit comments

Comments
 (0)