pub struct Chip { /* private fields */ }
Expand description
A Linux chardev GPIO chip interface
It can be used to get information about the chip and lines and to request GPIO lines that can be used as inputs or outputs.
Implementations§
source§impl Chip
impl Chip
sourcepub fn new(device: impl AsDevicePath) -> Result<Chip>
pub fn new(device: impl AsDevicePath) -> Result<Chip>
Create a new GPIO chip interface using path
sourcepub fn list_devices() -> Result<Vec<PathBuf>>
pub fn list_devices() -> Result<Vec<PathBuf>>
List all found chips
sourcepub fn line_info(&self, line: LineId) -> Result<LineInfo>
pub fn line_info(&self, line: LineId) -> Result<LineInfo>
Request the info of a specific GPIO line.
sourcepub fn request_lines<Direction: DirectionType>(
&self,
options: Options<Direction, impl AsRef<[LineId]>, impl AsRef<str>>
) -> Result<Lines<Direction>>
pub fn request_lines<Direction: DirectionType>( &self, options: Options<Direction, impl AsRef<[LineId]>, impl AsRef<str>> ) -> Result<Lines<Direction>>
Request the GPIO chip to configure the lines passed as argument as inputs or outputs
Calling this operation is a precondition to being able to set the state of the GPIO lines. All the lines passed in one request must share the configured options such as active state, edge detect, GPIO bias, output drive and consumer string.
Methods from Deref<Target = ChipInfo>§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chip
impl RefUnwindSafe for Chip
impl Send for Chip
impl Sync for Chip
impl Unpin for Chip
impl UnwindSafe for Chip
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more