Skip to content

Commit

Permalink
feat: calibrating Differential ADC for G4
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Li <ivanli2048@gmail.com>
  • Loading branch information
IvanLi-CN committed Jan 7, 2025
1 parent 4790f8f commit a3c1b18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions embassy-stm32/src/adc/g4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ impl<'d, T: Instance> Adc<'d, T> {
T::regs().cr().modify(|w| w.set_adcal(true));

while T::regs().cr().read().adcal() {}

T::regs().cr().modify(|w| {
w.set_adcaldif(Adcaldif::DIFFERENTIAL);
});

T::regs().cr().modify(|w| w.set_adcal(true));

while T::regs().cr().read().adcal() {}
}

fn enable(&mut self) {
Expand Down

0 comments on commit a3c1b18

Please sign in to comment.