Skip to content

Commit

Permalink
Merge pull request #526 from Tnze/master
Browse files Browse the repository at this point in the history
Add enable/disable EOC interrupt functions for ADCs
  • Loading branch information
burrbull authored Jan 21, 2025
2 parents 6c5dc88 + 72a5e95 commit e90577f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Add an option to allow overclocking [#494]
- `new` on gpio mode [#506]
- Add `Serial` `rx`/`tx` constructors [#509]
- Add enable/disable EOC interrupt functions for ADCs [#526]

[#416]: https://github.com/stm32-rs/stm32f1xx-hal/pull/416
[#453]: https://github.com/stm32-rs/stm32f1xx-hal/pull/453
Expand All @@ -69,6 +70,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#514]: https://github.com/stm32-rs/stm32f1xx-hal/pull/514
[#516]: https://github.com/stm32-rs/stm32f1xx-hal/pull/516
[#520]: https://github.com/stm32-rs/stm32f1xx-hal/pull/520
[#526]: https://github.com/stm32-rs/stm32f1xx-hal/pull/526

## [v0.10.0] - 2022-12-12

Expand Down
20 changes: 20 additions & 0 deletions src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,26 @@ macro_rules! adc_hal {
self.disable_clock();
self.rb
}

/// Enable interrupt for EOC (end of convert)
pub fn enable_eoc_interrupt(&mut self) {
self.rb.cr1().write(|w| w.eocie().set_bit());
}

/// Disable interrupt for EOC (end of convert)
pub fn disable_eoc_interrupt(&mut self) {
self.rb.cr1().write(|w| w.eocie().clear_bit());
}

/// Enable interrupt for JEOC (EOC for injected channels)
pub fn enable_jeoc_interrupt(&mut self) {
self.rb.cr1().write(|w| w.jeocie().set_bit());
}

/// Disable interrupt for JEOC (EOC for injected channels)
pub fn disable_jeoc_interrupt(&mut self) {
self.rb.cr1().write(|w| w.jeocie().clear_bit());
}
}

impl ChannelTimeSequence for Adc<$ADC> {
Expand Down

0 comments on commit e90577f

Please sign in to comment.