Skip to content

Commit

Permalink
api: gpio: update comment with example
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Aug 8, 2023
1 parent 488831f commit 5dec11a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apis/gpio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use libtock_platform::{
share::Handle, subscribe::OneId, DefaultConfig, ErrorCode, Subscribe, Syscalls, Upcall,
};

/// The Gpio driver
/// The GPIO driver.
///
/// # Example
/// ```ignore
/// use libtock::Gpios;
///
/// // Turn on led 0
/// let pin = Gpios::get_pin(0)?;
/// use libtock::gpio;
///
/// // Set pin to high.
/// let pin = gpio::Gpio::get_pin(0).unwrap().make_output().unwrap();
/// let _ = pin.set();
/// ```

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
Expand Down

0 comments on commit 5dec11a

Please sign in to comment.