Struct gpio_cdev::LineInfo

source ·
pub struct LineInfo { /* private fields */ }
Expand description

Information about a specific GPIO Line

Wraps kernel struct gpioline_info.

Implementations§

source§

impl LineInfo

source

pub fn line(&self) -> &Line

Get a handle to the line that this info represents

source

pub fn name(&self) -> Option<&str>

Name assigned to this chip if assigned

source

pub fn consumer(&self) -> Option<&str>

The name of this GPIO line, such as the output pin of the line on the chip, a rail or a pin header name on a board, as specified by the gpio chip.

source

pub fn direction(&self) -> LineDirection

Get the direction of this GPIO if configured

Lines are considered to be inputs if not explicitly marked as outputs in the line info flags by the kernel.

source

pub fn is_used(&self) -> bool

True if the any flags for the device are set (input or output)

source

pub fn is_kernel(&self) -> bool

True if this line is being used by something else in the kernel

If another driver or subsystem in the kernel is using the line then it cannot be used via the cdev interface. See relevant kernel code.

source

pub fn is_active_low(&self) -> bool

True if this line is marked as active low in the kernel

source

pub fn is_open_drain(&self) -> bool

True if this line is marked as open drain in the kernel

source

pub fn is_open_source(&self) -> bool

True if this line is marked as open source in the kernel

Trait Implementations§

source§

impl Debug for LineInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.