Skip to content

Commit 6634713

Browse files
committed
cross-referencing examples now
1 parent e04e590 commit 6634713

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

src/adc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
//!
33
//! ADC1 and ADC2 share a reset line. To initialise both of them, use the
44
//! [`adc12`](adc12) method.
5+
//!
6+
//! # Examples
7+
//!
8+
//! - [Reading a voltage using ADC1](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc.rs)
9+
//! - [Reading a temperature using ADC3](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/temperature.rs)
10+
//! - [Using ADC1 and ADC2 together](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc12.rs)
11+
//! - [Using ADC1 and ADC2 in parallel](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/adc12_parallel.rs)
512
613
use crate::hal::adc::{Channel, OneShot};
714
use crate::hal::blocking::delay::DelayUs;

src/spi.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//! Serial Peripheral Interface (SPI)
22
//!
33
//! This module implements the [embedded-hal](embedded-hal) traits for
4-
//! master mode SPI.
4+
//! master mode SPI. You can find an blocking SPI example
5+
//! [here](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/spi.rs) and an
6+
//! example using DMA [here](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/spi-dma.rs).
57
//!
68
//! # Usage
79
//!

src/timer.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Timers
2+
//!
3+
//! # Examples
4+
//!
5+
//! - [Blinky using a Timer](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/blinky_timer.rs)
26
37
// TODO: on the h7x3 at least, only TIM2, TIM3, TIM4, TIM5 can support 32 bits.
48
// TIM1 is 16 bit.
@@ -177,21 +181,6 @@ pub trait TimerExt<TIM> {
177181
}
178182

179183
/// Hardware timers
180-
///
181-
/// # Examples
182-
///
183-
/// ```
184-
/// let dp = pac::Peripherals::take().unwrap();
185-
/// let rcc = dp.RCC.constrain();
186-
/// let ccdr = rcc.freeze();
187-
/// let mut timer = Timer::tim1(dp.TIM1, ccdr.peripheral.TIM1, &ccdr.clocks);
188-
/// timer.start(1.hz());
189-
/// loop {
190-
/// // Do something here and then block for 1 second
191-
/// // do_something();
192-
/// block(timer.wait()).unwrap();
193-
/// }
194-
/// ```
195184
#[derive(Debug)]
196185
pub struct Timer<TIM> {
197186
clk: u32,

0 commit comments

Comments
 (0)