mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Merge pull request #2776 from MaxiluxSystems/fix/adc-h5-ch0
stm32: adc: v3: [h5] set OR.OP0 to 1 when ADCx_INP0 is selected, per RM
This commit is contained in:
commit
370436d675
@ -222,6 +222,13 @@ impl<'d, T: Instance> Adc<'d, T> {
|
||||
// spin
|
||||
}
|
||||
|
||||
// RM0492, RM0481, etc.
|
||||
// "This option bit must be set to 1 when ADCx_INP0 or ADCx_INN1 channel is selected."
|
||||
#[cfg(adc_h5)]
|
||||
if pin.channel() == 0 {
|
||||
T::regs().or().modify(|reg| reg.set_op0(true));
|
||||
}
|
||||
|
||||
// Configure channel
|
||||
Self::set_channel_sample_time(pin.channel(), self.sample_time);
|
||||
|
||||
@ -244,6 +251,13 @@ impl<'d, T: Instance> Adc<'d, T> {
|
||||
|
||||
T::regs().cr().modify(|reg| reg.set_addis(true));
|
||||
|
||||
// RM0492, RM0481, etc.
|
||||
// "This option bit must be set to 1 when ADCx_INP0 or ADCx_INN1 channel is selected."
|
||||
#[cfg(adc_h5)]
|
||||
if pin.channel() == 0 {
|
||||
T::regs().or().modify(|reg| reg.set_op0(false));
|
||||
}
|
||||
|
||||
val
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user