Skip to content

Commit e1ec823

Browse files
jbeaurivageianrrees
authored andcommitted
Doc and formatting fixes
1 parent cf3accc commit e1ec823

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

hal/src/peripherals/adc/builder.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ impl From<super::Error> for BuilderError {
116116
/// the sample rate of the ADC
117117
///
118118
/// To begin with, the ADC Clock is driven by the peripheral clock divided with
119-
/// a divider (see [Config::clock_divider]).
119+
/// a divider (see [`with_clock_divider`](Self::with_clock_divider)).
120120
///
121-
/// Each sample is read by the ADC over
122-
/// [Config::sample_clock_cycles] clock cycles, and then transmitted
123-
/// to the ADC register over [Config::bit_width] clock cycles (1
124-
/// clock cycle per bit)
121+
/// Each sample is read by the ADC over `n` clock cycles (see
122+
/// [`with_clock_cycles_per_sample`](Self::with_clock_cycles_per_sample)), and
123+
/// then transmitted to the ADC register over `t` clock cycles (1
124+
/// clock cycle per bit, see [`AdcResolution`]).
125125
///
126126
/// The ADC can also be configured to combine multiple simultaneous readings in
127-
/// either an average or summed mode (See [Accumulation]), this also affects
127+
/// either an average or summed mode (see [Accumulation]), this also affects
128128
/// the overall sample rate of the ADC as the ADC has to do multiple
129129
/// samples before a result is ready.
130130
///
@@ -204,12 +204,13 @@ impl AdcBuilder {
204204

205205
/// Sets the number of ADC clock cycles taken to sample a single
206206
/// sample. The higher this number, the longer it will take the ADC to
207-
/// sample each sample. Smaller values will make the ADC perform more samples per second,
208-
/// but there may be more noise in each sample leading to irratic values.
207+
/// sample each sample. Smaller values will make the ADC perform more
208+
/// samples per second, but there may be more noise in each sample
209+
/// leading to irratic values.
209210
///
210211
/// ## Safety
211-
/// * This function will clamp input value between 1 and 63, to conform to the ADC registers
212-
/// min and max values.
212+
/// * This function will clamp input value between 1 and 63, to conform to
213+
/// the ADC registers min and max values.
213214
pub fn with_clock_cycles_per_sample(mut self, num: u8) -> Self {
214215
self.sample_clock_cycles = Some(num.clamp(1, 63)); // Clamp in range
215216
self

hal/src/peripherals/adc/d5x/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pub mod pin;
22

3-
use pac::{adc0::inputctrl::Muxposselect, Supc};
3+
use pac::Supc;
44

55
#[cfg(feature = "async")]
66
use super::{async_api, FutureAdc};

hal/src/peripherals/adc/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ impl<I: AdcInstance> Adc<I> {
216216
///
217217
/// ## Important
218218
///
219-
/// This function will return [Error::ClockTooFast] if the clock source provided
220-
/// is faster than 48 MHz, since this is the maximum frequency for the
221-
/// ADC as per the datasheet.
219+
/// This function will return [Error::ClockTooFast] if the clock source
220+
/// provided is faster than 48 MHz, since this is the maximum frequency
221+
/// for the ADC as per the datasheet.
222222
#[hal_cfg(any("adc-d11", "adc-d21"))]
223223
#[inline]
224224
pub(crate) fn new(
@@ -238,9 +238,9 @@ impl<I: AdcInstance> Adc<I> {
238238
Ok(new_adc)
239239
}
240240

241-
/// Switch the ['Adc'] to ['FutureAdc'], allowing for the use of async reading
242-
/// methods. You are required to provide the struct created by the
243-
/// [`bind_interrupts`](crate::bind_interrupts) macro to prove
241+
/// Switch the ['Adc'] to ['FutureAdc'], allowing for the use of async
242+
/// reading methods. You are required to provide the struct created by
243+
/// the [`bind_interrupts`](crate::bind_interrupts) macro to prove
244244
/// that the interrupt sources have been correctly configured. This function
245245
/// will automatically enable the relevant NVIC interrupt sources. However,
246246
/// you are required to configure the desired interrupt priorities prior to

0 commit comments

Comments
 (0)