[][src]Struct linux_embedded_hal::CdevPin

pub struct CdevPin(pub LineHandle, _);

Newtype around gpio_cdev::LineHandle that implements the embedded-hal traits

Implementations

impl CdevPin[src]

pub fn new(handle: LineHandle) -> Result<Self, Error>[src]

See gpio_cdev::Line::request for details.

Methods from Deref<Target = LineHandle>

pub fn get_value(&self) -> Result<u8, Error>[src]

Request the current state of this Line from the kernel

This call is expected to succeed for both input and output lines. It should be noted, however, that some drivers may not be able to give any useful information when the value is requested for an output line.

This value should be 0 or 1 which a "1" representing that the line is active. Usually this means that the line is at logic-level high but it could mean the opposite if the line has been marked as being ACTIVE_LOW.

pub fn set_value(&self, value: u8) -> Result<(), Error>[src]

Request that the line be driven to the specified value

The value should be 0 or 1 with 1 representing a request to make the line "active". Usually "active" means logic level high unless the line has been marked as ACTIVE_LOW.

Calling set_value on a line that is not an output will likely result in an error (from the kernel).

pub fn line(&self) -> &Line[src]

Get the Line information associated with this handle.

Trait Implementations

impl Deref for CdevPin[src]

type Target = LineHandle

The resulting type after dereferencing.

impl DerefMut for CdevPin[src]

impl InputPin for CdevPin[src]

type Error = Error

Error type

impl OutputPin for CdevPin[src]

type Error = Error

Error type

Auto Trait Implementations

impl RefUnwindSafe for CdevPin

impl Send for CdevPin

impl Sync for CdevPin

impl Unpin for CdevPin

impl UnwindSafe for CdevPin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.