pub struct Chip { /* private fields */ }Expand description
GPIO chip
A GPIO chip object is associated with an open file descriptor to the GPIO character device. It exposes basic information about the chip and allows callers to retrieve information about each line, watch lines for state changes and make line requests.
Implementations§
Source§impl Chip
impl Chip
Sourcepub fn line_info(&self, offset: Offset) -> Result<Info>
pub fn line_info(&self, offset: Offset) -> Result<Info>
Get a snapshot of information about the line.
Sourcepub fn watch_line_info(&self, offset: Offset) -> Result<Info>
pub fn watch_line_info(&self, offset: Offset) -> Result<Info>
Get the current snapshot of information about the line at given offset and start watching it for future changes.
Sourcepub fn wait_info_event(&self, timeout: Option<Duration>) -> Result<bool>
pub fn wait_info_event(&self, timeout: Option<Duration>) -> Result<bool>
Wait for line status events on any of the watched lines on the chip.
Sourcepub fn read_info_event(&self) -> Result<Event>
pub fn read_info_event(&self) -> Result<Event>
Read a single line status change event from the chip. If no events are pending, this function will block.
Sourcepub fn line_offset_from_name(&self, name: &str) -> Result<Offset>
pub fn line_offset_from_name(&self, name: &str) -> Result<Offset>
Map a GPIO line’s name to its offset within the chip.
Trait Implementations§
impl Eq for Chip
impl Send for Chip
impl StructuralPartialEq for Chip
Auto Trait Implementations§
impl Freeze for Chip
impl RefUnwindSafe 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