pub trait Chip {
type Data: PointerWrapper + 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 PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection> { ... }
fn direction_input(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result { ... }
fn direction_output(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32,
_value: bool
) -> Result { ... }
fn get(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result<bool> { ... }
fn set(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32,
_value: bool
) { ... }
}
Expand description
A gpio chip.
Required Associated Types
type Data: PointerWrapper + Sync + Send
type Data: PointerWrapper + 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
const 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
const HAS_GET_DIRECTION: bool = false
const HAS_GET_DIRECTION: bool = false
Indicates if the get_direction
method is overridden by the implementor.
const HAS_DIRECTION_INPUT: bool = false
const HAS_DIRECTION_INPUT: bool = false
Indicates if the direction_input
method is overridden by the implementor.
const HAS_DIRECTION_OUTPUT: bool = false
const HAS_DIRECTION_OUTPUT: bool = false
Indicates if the direction_output
method is overridden by the implementor.
Provided Methods
fn get_direction(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection>
fn get_direction(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result<LineDirection>
Returns the direction of the given gpio line.
fn direction_input(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result
fn direction_input(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32
) -> Result
Configures the direction as input of the given gpio line.
fn direction_output(
_data: <Self::Data as PointerWrapper>::Borrowed<'_>,
_offset: u32,
_value: bool
) -> Result
fn direction_output(
_data: <Self::Data as PointerWrapper>::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.
Returns the current value of the given gpio line.