Skip to main content

input

Function input 

Source
pub fn input(
    chip: impl AsRef<Path>,
    line: u32,
    consumer: &str,
) -> Result<CdevPin, OpenError>
Expand description

Requests a GPIO line as an input.

§Arguments

  • chip - the GPIO chip’s device file.
  • line - the line offset on that chip.
  • consumer - the name the kernel shows as holding the line.

§Returns

The line, implementing InputPin.

§Errors

Returns OpenError::Gpio if the chip or line cannot be opened or requested.