diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-04-18 11:09:00 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-18 11:09:00 +0000 |
| commit | 667400111a4d4e0118135ef314ae3e4443b24202 (patch) | |
| tree | 647fbe99fe907c92fcad985de9fc9356578e7d33 /examples | |
| parent | 7a620661da85c0a4b550abbde7df7e248fe0f155 (diff) | |
| parent | bbfebf968e31815a78ba9f19e7a6b2e26bad7456 (diff) | |
Merge pull request #4089 from IvanLi-CN/g4-opamp
feat(embassy-stm32/opamp): Add some STM32G4 opamp usage
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f334/src/bin/opamp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32f334/src/bin/opamp.rs b/examples/stm32f334/src/bin/opamp.rs index b30445ead..c344935d7 100644 --- a/examples/stm32f334/src/bin/opamp.rs +++ b/examples/stm32f334/src/bin/opamp.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | use defmt::info; | 4 | use defmt::info; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::adc::{Adc, SampleTime}; | 6 | use embassy_stm32::adc::{Adc, SampleTime}; |
| 7 | use embassy_stm32::opamp::{OpAmp, OpAmpGain}; | 7 | use embassy_stm32::opamp::OpAmp; |
| 8 | use embassy_stm32::peripherals::ADC2; | 8 | use embassy_stm32::peripherals::ADC2; |
| 9 | use embassy_stm32::time::mhz; | 9 | use embassy_stm32::time::mhz; |
| 10 | use embassy_stm32::{adc, bind_interrupts, Config}; | 10 | use embassy_stm32::{adc, bind_interrupts, Config}; |
| @@ -48,7 +48,7 @@ async fn main(_spawner: Spawner) -> ! { | |||
| 48 | 48 | ||
| 49 | let mut vrefint = adc.enable_vref(); | 49 | let mut vrefint = adc.enable_vref(); |
| 50 | let mut temperature = adc.enable_temperature(); | 50 | let mut temperature = adc.enable_temperature(); |
| 51 | let mut buffer = opamp.buffer_ext(p.PA7.reborrow(), p.PA6.reborrow(), OpAmpGain::Mul1); | 51 | let mut buffer = opamp.buffer_ext(p.PA7.reborrow(), p.PA6.reborrow()); |
| 52 | 52 | ||
| 53 | loop { | 53 | loop { |
| 54 | let vref = adc.read(&mut vrefint).await; | 54 | let vref = adc.read(&mut vrefint).await; |
