Skip to main content

output

Function output 

Source
pub fn output(
    chip: impl AsRef<Path>,
    line: u32,
    initial: Level,
) -> Result<Line, OpenError>
Expand description

Opens a line as an output, driving initial from the moment it is taken.

Opening at the level that leaves the part off matters for anything that should not twitch at start-up: an active-low relay is opened Level::High.

§Arguments

  • chip - the GPIO chip’s device file, /dev/gpiochip0 on most boards.
  • line - the line’s number on that chip, the GPIO or BCM number on a Raspberry Pi.
  • initial - the level to drive as soon as the line is taken.

§Returns

The line.

§Errors

OpenError::Unsupported on any platform but Linux, or OpenError::Gpio when the chip or the line cannot be opened.