Struct gpio_cdev::Lines[][src]

pub struct Lines { /* fields omitted */ }
Expand description

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

Implementations

Get a handle to the parent chip for the lines

Get the number of lines in the collection

Get the number of lines in the collection

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::Ioctl.

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

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.