diff options
| author | Gabriel Smith <[email protected]> | 2025-12-16 12:27:43 -0500 |
|---|---|---|
| committer | Gabriel Smith <[email protected]> | 2025-12-16 12:30:36 -0500 |
| commit | b9395180fba64d42fb3e0977f4882d7555488c2f (patch) | |
| tree | cdc4a55fd2bb11469bf02733282deef2d33bd762 /embassy-stm32/src | |
| parent | c283ba36eb5516cdedc46acf6f9f234859161e2a (diff) | |
stm32/adc: allow DMA reads to loop through enabled channels
This was previously implemented for v3 ADCs, but that was lost in the
recent refactoring. I have gone through all the reference manuals to
verify that this should be supported for all chips, but it has only
been confirmed for the STM32H5 series.
Diffstat (limited to 'embassy-stm32/src')
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index da432f6ce..17b1dae77 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -214,7 +214,7 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 214 | #[cfg(any(adc_g4, adc_v3, adc_g0, adc_h5, adc_h7rs, adc_u0, adc_v4, adc_u5, adc_wba, adc_c0))] | 214 | #[cfg(any(adc_g4, adc_v3, adc_g0, adc_h5, adc_h7rs, adc_u0, adc_v4, adc_u5, adc_wba, adc_c0))] |
| 215 | /// Read one or multiple ADC regular channels using DMA. | 215 | /// Read one or multiple ADC regular channels using DMA. |
| 216 | /// | 216 | /// |
| 217 | /// `sequence` iterator and `readings` must have the same length. | 217 | /// `readings` must have a length that is a multiple of the length of the `sequence` iterator. |
| 218 | /// | 218 | /// |
| 219 | /// Example | 219 | /// Example |
| 220 | /// ```rust,ignore | 220 | /// ```rust,ignore |
| @@ -253,8 +253,8 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 253 | ) { | 253 | ) { |
| 254 | assert!(sequence.len() != 0, "Asynchronous read sequence cannot be empty"); | 254 | assert!(sequence.len() != 0, "Asynchronous read sequence cannot be empty"); |
| 255 | assert!( | 255 | assert!( |
| 256 | sequence.len() == readings.len(), | 256 | readings.len() % sequence.len() == 0, |
| 257 | "Sequence length must be equal to readings length" | 257 | "Readings length must be a multiple of sequence length" |
| 258 | ); | 258 | ); |
| 259 | assert!( | 259 | assert!( |
| 260 | sequence.len() <= 16, | 260 | sequence.len() <= 16, |
