Skip to content

Commit e77e6f0

Browse files
committed
some more inter-doc links to make RCC usage easier
1 parent 7d19bee commit e77e6f0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/gpio.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
//!
33
//! The GPIO pins are organised into groups of 16 pins which can be accessed through the
44
//! `gpioa`, `gpiob`... modules. To get access to the pins, you first need to convert them into a
5-
//! HAL designed struct from the `pac` struct using the `spilit` function.
5+
//! HAL designed struct from the `pac` struct using the [split](trait.GpioExt.html#tymethod.split) function.
66
//! ```rust
77
//! // Acquire the GPIOC peripheral
88
//! // NOTE: `dp` is the device peripherals from the `PAC` crate
99
//! let mut gpioa = dp.GPIOA.split(&mut rcc.apb2);
1010
//! ```
1111
//!
12+
//! See the documentation for [rcc::APB2](../rcc/struct.APB2.html) for details about the input parameter to
13+
//! `split`.
14+
//!
1215
//! This gives you a struct containing two control registers `crl` and `crh`, and all the pins
1316
//! `px0..px15`. These structs are what you use to interract with the pins to change their modes,
1417
//! or their inputs or outputs. For example, to set `pa5` high, you would call

src/rcc.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ impl RccExt for RCC {
3636
}
3737

3838
/// Constrained RCC peripheral
39+
///
40+
/// Aquired by calling the [constrain](../trait.RccExt.html#tymethod.constrain) method
41+
/// on the Rcc struct from the `PAC`
42+
///
43+
/// ```rust
44+
/// let dp = pac::Peripherals::take().unwrap();
45+
/// let mut rcc = dp.RCC.constrain();
46+
/// ```
3947
pub struct Rcc {
4048
/// AMBA High-performance Bus (AHB) registers
4149
pub ahb: AHB,

0 commit comments

Comments
 (0)