Skip to content

Commit ca1fa88

Browse files
committed
Gpio cdev add documentation
1 parent b50b73f commit ca1fa88

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ This project is developed and maintained by the [Embedded Linux team][team].
88

99
## [Documentation](https://docs.rs/linux-embedded-hal)
1010

11+
## GPIO character device
12+
13+
Since Linux kernel v4.4 the use of sysfs GPIO was deprecated and replaced by the character device GPIO.
14+
See [gpio-cdev documentation](https://github.com/rust-embedded/gpio-cdev#sysfs-gpio-vs-gpio-character-device) for details.
15+
16+
This crate includes feature flag `gpio_cdev` that replaces [sysfs_gpio](https://crates.io/crates/sysfs_gpio) by [gpio-cdev](https://crates.io/crates/gpio-cdev).
17+
To enable it update your Cargo.toml.
18+
```
19+
linux-embedded-hal = { version = "0.3", features = ["gpio_cdev"] }
20+
```
21+
1122
## License
1223

1324
Licensed under either of

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//! [0]: https://crates.io/keywords/embedded-hal
1212
1313
#![deny(missing_docs)]
14+
#![feature(doc_cfg)]
1415

1516
extern crate cast;
1617
extern crate embedded_hal as hal;
@@ -99,9 +100,11 @@ impl hal::blocking::delay::DelayMs<u64> for Delay {
99100
///
100101
/// [`gpio_cdev::LineHandle`]: https://docs.rs/gpio-cdev/0.2.0/gpio_cdev/struct.LineHandle.html
101102
#[cfg(feature = "gpio_cdev")]
103+
#[doc(cfg(feature = "gpio_cdev"))]
102104
pub struct Pin(pub gpio_cdev::LineHandle, bool);
103105

104106
#[cfg(feature = "gpio_cdev")]
107+
#[doc(cfg(feature = "gpio_cdev"))]
105108
impl Pin {
106109
/// See [`gpio_cdev::Line::request`][0] for details.
107110
///

0 commit comments

Comments
 (0)