pub trait Chip {
type Data: ForeignOwnable + Sync + Send;
const USE_VTABLE_ATTR: ();
const HAS_GET_DIRECTION: bool = false;
const HAS_DIRECTION_INPUT: bool = false;
const HAS_DIRECTION_OUTPUT: bool = false;
const HAS_GET: bool = false;
const HAS_SET: bool = false;
fn get_direction(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection> { ... }
fn direction_input(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result { ... }
fn direction_output(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32,
_value: bool
) -> Result { ... }
fn get(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result<bool> { ... }
fn set(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32,
_value: bool
) { ... }
}
Expand description
A gpio chip.
Required Associated Types
sourcetype Data: ForeignOwnable + Sync + Send
type Data: ForeignOwnable + Sync + Send
Context data associated with the gpio chip.
It determines the type of the context data passed to each of the methods of the trait.
Required Associated Constants
sourceconst USE_VTABLE_ATTR: ()
const USE_VTABLE_ATTR: ()
A marker to prevent implementors from forgetting to use #[vtable]
attribute when implementing this trait.
Provided Associated Constants
sourceconst HAS_GET_DIRECTION: bool = false
const HAS_GET_DIRECTION: bool = false
Indicates if the get_direction
method is overridden by the implementor.
sourceconst HAS_DIRECTION_INPUT: bool = false
const HAS_DIRECTION_INPUT: bool = false
Indicates if the direction_input
method is overridden by the implementor.
sourceconst HAS_DIRECTION_OUTPUT: bool = false
const HAS_DIRECTION_OUTPUT: bool = false
Indicates if the direction_output
method is overridden by the implementor.
Provided Methods
sourcefn get_direction(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection>
fn get_direction(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection>
Returns the direction of the given gpio line.
sourcefn direction_input(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result
fn direction_input(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32
) -> Result
Configures the direction as input of the given gpio line.
sourcefn direction_output(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32,
_value: bool
) -> Result
fn direction_output(
_data: <Self::Data as ForeignOwnable>::Borrowed<'_>,
_offset: u32,
_value: bool
) -> Result
Configures the direction as output of the given gpio line.
The value that will be initially output is also specified.