pub struct Lines { /* private fields */ }
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§
source§impl Lines
impl Lines
sourcepub fn request(
&self,
flags: LineRequestFlags,
default: &[u8],
consumer: &str,
) -> Result<MultiLineHandle, Error>
pub fn request( &self, flags: LineRequestFlags, default: &[u8], consumer: &str, ) -> Result<MultiLineHandle, Error>
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
.