diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-01-07 15:43:29 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-01-07 15:43:29 +0000 |
| commit | 92376401bbf8f3b83a1ca1694068a4735a3fe609 (patch) | |
| tree | f36e25ea12023ede1f23bb52de255b14fd4e295b | |
| parent | 4790f8ff35107ef7574b02d6553b9063db3e6b23 (diff) | |
| parent | a3c1b18b0279065470939b823d11dc777b257dc1 (diff) | |
Merge pull request #3735 from IvanLi-CN/feat/Calibrating-Differential-ADC-for-G4
feat: Calibrating Differential Inputs ADC for G4
| -rw-r--r-- | embassy-stm32/src/adc/g4.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/embassy-stm32/src/adc/g4.rs b/embassy-stm32/src/adc/g4.rs index 555a91d17..0291ef4de 100644 --- a/embassy-stm32/src/adc/g4.rs +++ b/embassy-stm32/src/adc/g4.rs | |||
| @@ -191,6 +191,14 @@ impl<'d, T: Instance> Adc<'d, T> { | |||
| 191 | T::regs().cr().modify(|w| w.set_adcal(true)); | 191 | T::regs().cr().modify(|w| w.set_adcal(true)); |
| 192 | 192 | ||
| 193 | while T::regs().cr().read().adcal() {} | 193 | while T::regs().cr().read().adcal() {} |
| 194 | |||
| 195 | T::regs().cr().modify(|w| { | ||
| 196 | w.set_adcaldif(Adcaldif::DIFFERENTIAL); | ||
| 197 | }); | ||
| 198 | |||
| 199 | T::regs().cr().modify(|w| w.set_adcal(true)); | ||
| 200 | |||
| 201 | while T::regs().cr().read().adcal() {} | ||
| 194 | } | 202 | } |
| 195 | 203 | ||
| 196 | fn enable(&mut self) { | 204 | fn enable(&mut self) { |
