pub struct GpioChip {
pub name: String,
pub label: String,
pub lines: u32,
/* private fields */
}Expand description
Provide high-level access to Linux gpiochip Driver
Fields§
§name: Stringname for the chip
label: Stringlabel for the chip
lines: u32amount of gpios provided by the chip
Implementations§
Source§impl GpioChip
impl GpioChip
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<GpioChip>
pub fn new<P: AsRef<Path>>(path: P) -> Result<GpioChip>
Open the gpiochip with the provided path
Typically, the path will be something like "/dev/gpiochip0".
Sourcepub fn request(
&self,
consumer: &str,
flags: RequestFlags,
gpio: u32,
default: u8,
) -> Result<GpioHandle>
pub fn request( &self, consumer: &str, flags: RequestFlags, gpio: u32, default: u8, ) -> Result<GpioHandle>
Request a GpioHandle for a single gpio
Sourcepub fn request_array(
&self,
consumer: &str,
flags: RequestFlags,
gpios: &[u32],
default_values: &[u8],
) -> Result<GpioArrayHandle>
pub fn request_array( &self, consumer: &str, flags: RequestFlags, gpios: &[u32], default_values: &[u8], ) -> Result<GpioArrayHandle>
Request a GpioArrayHandle for multiple gpios, that should be get/set simultaneously
Sourcepub fn request_event(
&self,
consumer: &str,
gpio: u32,
handleflags: RequestFlags,
eventflags: EventRequestFlags,
) -> Result<GpioEventHandle>
pub fn request_event( &self, consumer: &str, gpio: u32, handleflags: RequestFlags, eventflags: EventRequestFlags, ) -> Result<GpioEventHandle>
Request a GpioEventHandle for a single gpio
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpioChip
impl RefUnwindSafe for GpioChip
impl Send for GpioChip
impl Sync for GpioChip
impl Unpin for GpioChip
impl UnwindSafe for GpioChip
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