Skip to content

Commit

Permalink
docs: add details on how to obtain a GCR instance and correct typo (#2)
Browse files Browse the repository at this point in the history
* Add details on how to obtain a gcr instance and correct typo

* use let mut
  • Loading branch information
thealtofwar authored Jan 21, 2025
1 parent e4152f9 commit 0b1b491
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ macro_rules! gpio {
///
/// ## Example
/// ```
/// // Initialize a Gcr
/// let mut gcr = Gcr::new(peripherals.gcr, peripherals.lpgcr);
/// // Initialize the GPIO0 peripheral
/// let gpio0 = hal::gpio::Gpio0::new(p.gpio0, &mut gcr.reg);
/// // Split into pins
Expand All @@ -367,9 +369,9 @@ macro_rules! gpio {
/// // Split into pins
/// let pins2 = gpio2.split();
/// // Set up pins for LED control/output
/// let led_red = gpio2.p2_0.into_input_output();
/// let led_green = gpio2.p2_1.into_input_output();
/// let led_blue = gpio2.p2_2.into_input_output();
/// let led_red = pins2.p2_0.into_input_output();
/// let led_green = pins2.p2_1.into_input_output();
/// let led_blue = pins2.p2_2.into_input_output();
///
/// // Acquired pins can then be passed to other peripherals in
/// // the HAL or embedded-hal driver crates.
Expand Down

0 comments on commit 0b1b491

Please sign in to comment.