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 2
2
//!
3
3
//! The GPIO pins are organised into groups of 16 pins which can be accessed through the
4
4
//! `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.
6
6
//! ```rust
7
7
//! // Acquire the GPIOC peripheral
8
8
//! // NOTE: `dp` is the device peripherals from the `PAC` crate
9
9
//! let mut gpioa = dp.GPIOA.split(&mut rcc.apb2);
10
10
//! ```
11
11
//!
12
+ //! See the documentation for [rcc::APB2](../rcc/struct.APB2.html) for details about the input parameter to
13
+ //! `split`.
14
+ //!
12
15
//! This gives you a struct containing two control registers `crl` and `crh`, and all the pins
13
16
//! `px0..px15`. These structs are what you use to interract with the pins to change their modes,
14
17
//! 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 {
36
36
}
37
37
38
38
/// 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
+ /// ```
39
47
pub struct Rcc {
40
48
/// AMBA High-performance Bus (AHB) registers
41
49
pub ahb : AHB ,
You can’t perform that action at this time.
0 commit comments