File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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+ /// ```
3947pub struct Rcc {
4048 /// AMBA High-performance Bus (AHB) registers
4149 pub ahb : AHB ,
You can’t perform that action at this time.
0 commit comments