Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/adc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ impl<ADC: Instance> DynamicAdc<ADC> {
#[inline(always)]
pub fn set_end_of_conversion_interrupt(&mut self, eoc: config::Eoc) {
self.config.end_of_conversion_interrupt = eoc;
let (en, eocs) = match eoc {
let (en_eoc, en_eos) = match eoc {
config::Eoc::Disabled => (false, false),
config::Eoc::Conversion => (true, true),
config::Eoc::Sequence => (true, false),
config::Eoc::Conversion => (true, false),
config::Eoc::Sequence => (false, true),
};
self.adc_reg
.ier()
.modify(|_, w| w.eosie().bit(eocs).eocie().bit(en));
.modify(|_, w| w.eosie().bit(en_eos).eocie().bit(en_eoc));
}

/// Enable/disable overrun interrupt
Expand Down Expand Up @@ -902,6 +902,12 @@ impl<ADC: Instance> DynamicAdc<ADC> {
self.adc_reg.isr().modify(|_, w| w.eoc().clear());
}

/// Resets the end-of-sequence flag
#[inline(always)]
pub fn clear_end_of_sequence_flag(&mut self) {
self.adc_reg.isr().modify(|_, w| w.eos().clear());
}

/// Block until the conversion is completed and return to configured
pub fn wait_for_conversion_sequence(&mut self) {
while !self.adc_reg.isr().read().eoc().bit_is_set() {}
Expand Down Expand Up @@ -1445,6 +1451,12 @@ impl<ADC: Instance> Adc<ADC, Active> {
pub fn clear_end_conversion_flag(&mut self) {
self.adc.clear_end_of_conversion_flag();
}

/// Clear the end of sequence interrupt flag
#[inline(always)]
pub fn clear_end_sequence_flag(&mut self) {
self.adc.clear_end_of_sequence_flag();
}
}

impl<ADC: Instance> Adc<ADC, DMA> {
Expand Down
Loading