Skip to content

Commit 1355bc8

Browse files
authored
Merge pull request #65 from mattico/adc-typo
ADC: Fix typo in function names
2 parents 24f6f9f + 4b838c6 commit 1355bc8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/adc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ fn main() -> ! {
2626
let mut adc = dp.ADC.constrain(&mut rcc);
2727
adc.set_sample_time(SampleTime::T_80);
2828
adc.set_precision(Precision::B_12);
29-
adc.set_oversamling_ratio(OversamplingRatio::X_16);
30-
adc.set_oversamling_shift(16);
31-
adc.oversamling_enable(true);
29+
adc.set_oversampling_ratio(OversamplingRatio::X_16);
30+
adc.set_oversampling_shift(16);
31+
adc.oversampling_enable(true);
3232

3333
delay.delay(20.us()); // Wait for ADC voltage regulator to stabilize
3434
adc.calibrate();

examples/adc_ext_trig_double_dma_serial.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ fn main() -> ! {
166166
let u = u_raw.saturating_sub(32) as f32 / 4_096_f32 * 3.3;
167167
hprintln!("u: {:.4} V ", u).unwrap();
168168

169-
adc.set_oversamling_ratio(adc::OversamplingRatio::X_16);
170-
adc.set_oversamling_shift(4);
171-
adc.oversamling_enable(true);
169+
adc.set_oversampling_ratio(adc::OversamplingRatio::X_16);
170+
adc.set_oversampling_shift(4);
171+
adc.oversampling_enable(true);
172172
adc.prepare_injected(&mut pa3, InjTrigSource::TRG_2);
173173
adc.start_injected();
174174

src/analog/adc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,20 @@ impl Adc {
196196
}
197197

198198
/// The nuber of bits, the oversampling result is shifted in bits at the end of oversampling
199-
pub fn set_oversamling_shift(&mut self, nrbits: u8) {
199+
pub fn set_oversampling_shift(&mut self, nrbits: u8) {
200200
self.rb
201201
.cfgr2
202202
.modify(|_, w| unsafe { w.ovss().bits(nrbits) });
203203
}
204204

205205
/// Oversampling of adc according to datasheet of stm32g0, when oversampling is enabled
206-
pub fn set_oversamling_ratio(&mut self, ratio: OversamplingRatio) {
206+
pub fn set_oversampling_ratio(&mut self, ratio: OversamplingRatio) {
207207
self.rb
208208
.cfgr2
209209
.modify(|_, w| unsafe { w.ovsr().bits(ratio as u8) });
210210
}
211211

212-
pub fn oversamling_enable(&mut self, enable: bool) {
212+
pub fn oversampling_enable(&mut self, enable: bool) {
213213
self.rb.cfgr2.modify(|_, w| w.ovse().bit(enable));
214214
}
215215

0 commit comments

Comments
 (0)