[][src]Struct gpio_cdev::Lines

pub struct Lines { /* fields omitted */ }

A collection of lines that can be accesses simultaneously

This is a collection of lines, all from the same GPIO chip that can all be accessed simultaneously

Methods

impl Lines[src]

pub fn chip(&self) -> Chip[src]

Get a handle to the parent chip for the lines

pub fn len(&self) -> usize[src]

Get the number of lines in the collection

pub fn request(
    &self,
    flags: LineRequestFlags,
    default: &[u8],
    consumer: &str
) -> Result<MultiLineHandle>
[src]

Request access to interact with these lines from the kernel

This is similar to the "export" operation present in the sysfs API with the key difference that we are also able to configure the GPIO with flags to specify how the line will be used at the time of request.

For an output, the default parameter specifies the value each line should have when it is configured as an output. The consumer string should describe the process consuming the line (this will be truncated to 31 characters if too long).

Errors

The main source of errors here is if the kernel returns an error to the ioctl performing the request here. This will result in an Error being returned with ErrorKind::Io.

One possible cause for an error here would be if the lines are already in use. One can check for this prior to making the request using is_kernel.

Trait Implementations

impl Debug for Lines[src]

impl Index<usize> for Lines[src]

type Output = Line

The returned type after indexing.

Auto Trait Implementations

impl Send for Lines

impl Sync for Lines

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]