File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ fn main() -> ! {
64
64
let mut opamp2 = opamp2. pga (
65
65
pa7,
66
66
PgaModeInternal :: gain ( NonInvertingGain :: Gain4 ) ,
67
- //Some(gpioa.pa6),
68
67
Option :: < PA6 < Analog > > :: None , // Do not route output to any external pin, use internal AD instead
69
68
) ;
70
69
@@ -75,7 +74,10 @@ fn main() -> ! {
75
74
76
75
loop {
77
76
// Here we can sample the output of opamp2 as if it was a regular AD pin
78
- let sample = adc. convert ( & mut opamp2, stm32g4xx_hal:: adc:: config:: SampleTime :: Cycles_640_5 ) ;
77
+ let sample = adc. convert (
78
+ & mut opamp2,
79
+ stm32g4xx_hal:: adc:: config:: SampleTime :: Cycles_640_5 ,
80
+ ) ;
79
81
80
82
let millivolts = adc. sample_to_millivolts ( sample) ;
81
83
info ! ( "opamp2 thus 4x pa7: {}mV" , millivolts) ;
Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ pub use crate::time::U32Ext as _;
13
13
use crate :: {
14
14
dma:: { mux:: DmaMuxResources , traits:: TargetAddress , PeripheralToMemory } ,
15
15
gpio:: * ,
16
+ opamp,
16
17
rcc:: { Enable , Rcc , Reset } ,
17
18
signature:: { VtempCal110 , VtempCal30 , VDDA_CALIB } ,
18
- stm32, opamp ,
19
+ stm32,
19
20
} ;
20
21
use core:: fmt;
21
22
use core:: marker:: PhantomData ;
You can’t perform that action at this time.
0 commit comments