Skip to content

Commit e90577f

Browse files
authored
Merge pull request #526 from Tnze/master
Add enable/disable EOC interrupt functions for ADCs
2 parents 6c5dc88 + 72a5e95 commit e90577f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4646
- Add an option to allow overclocking [#494]
4747
- `new` on gpio mode [#506]
4848
- Add `Serial` `rx`/`tx` constructors [#509]
49+
- Add enable/disable EOC interrupt functions for ADCs [#526]
4950

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

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

src/adc.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,26 @@ macro_rules! adc_hal {
418418
self.disable_clock();
419419
self.rb
420420
}
421+
422+
/// Enable interrupt for EOC (end of convert)
423+
pub fn enable_eoc_interrupt(&mut self) {
424+
self.rb.cr1().write(|w| w.eocie().set_bit());
425+
}
426+
427+
/// Disable interrupt for EOC (end of convert)
428+
pub fn disable_eoc_interrupt(&mut self) {
429+
self.rb.cr1().write(|w| w.eocie().clear_bit());
430+
}
431+
432+
/// Enable interrupt for JEOC (EOC for injected channels)
433+
pub fn enable_jeoc_interrupt(&mut self) {
434+
self.rb.cr1().write(|w| w.jeocie().set_bit());
435+
}
436+
437+
/// Disable interrupt for JEOC (EOC for injected channels)
438+
pub fn disable_jeoc_interrupt(&mut self) {
439+
self.rb.cr1().write(|w| w.jeocie().clear_bit());
440+
}
421441
}
422442

423443
impl ChannelTimeSequence for Adc<$ADC> {

0 commit comments

Comments
 (0)