diff options
| author | xoviat <[email protected]> | 2025-11-13 07:38:06 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-11-13 07:38:06 -0600 |
| commit | c17d24d0cc8fedbe69b22032ea7323997ddfe4dc (patch) | |
| tree | d0c94234a9ec9bbd471a0382a752267f763fd50a /embassy-stm32/src/adc/mod.rs | |
| parent | 4dedc1307cb088d5d28655b8427ae3a6176a216d (diff) | |
extract averaging enum
Diffstat (limited to 'embassy-stm32/src/adc/mod.rs')
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 856c2e61e..c91d68e87 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -148,6 +148,26 @@ pub(crate) fn blocking_delay_us(us: u32) { | |||
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | #[cfg(any(adc_c0, adc_v3, adc_g0, adc_h5, adc_h7rs, adc_u0, adc_v4, adc_u5))] | ||
| 152 | /// Number of samples used for averaging. | ||
| 153 | #[derive(Copy, Clone, Debug)] | ||
| 154 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 155 | pub enum Averaging { | ||
| 156 | Disabled, | ||
| 157 | Samples2, | ||
| 158 | Samples4, | ||
| 159 | Samples8, | ||
| 160 | Samples16, | ||
| 161 | Samples32, | ||
| 162 | Samples64, | ||
| 163 | Samples128, | ||
| 164 | Samples256, | ||
| 165 | #[cfg(any(adc_c0, adc_v4, adc_u5))] | ||
| 166 | Samples512, | ||
| 167 | #[cfg(any(adc_c0, adc_v4, adc_u5))] | ||
| 168 | Samples1024, | ||
| 169 | } | ||
| 170 | |||
| 151 | #[cfg(any(adc_v2, adc_g4, adc_v3, adc_g0, adc_h5, adc_h7rs, adc_u0, adc_v4, adc_u5, adc_wba))] | 171 | #[cfg(any(adc_v2, adc_g4, adc_v3, adc_g0, adc_h5, adc_h7rs, adc_u0, adc_v4, adc_u5, adc_wba))] |
| 152 | #[allow(dead_code)] | 172 | #[allow(dead_code)] |
| 153 | pub(crate) enum ConversionMode { | 173 | pub(crate) enum ConversionMode { |
