pub struct GpioProxy { /* private fields */ }Implementations§
Source§impl GpioProxy
impl GpioProxy
Sourcepub fn take_event_stream(&self) -> GpioEventStream
pub fn take_event_stream(&self) -> GpioEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn read(
&self,
) -> QueryResponseFut<GpioReadResult, DefaultFuchsiaResourceDialect>
pub fn read( &self, ) -> QueryResponseFut<GpioReadResult, DefaultFuchsiaResourceDialect>
Reads the current value of a GPIO, returning true for a high voltage and false for a
low voltage.
Sourcepub fn set_buffer_mode(
&self,
mode: BufferMode,
) -> QueryResponseFut<GpioSetBufferModeResult, DefaultFuchsiaResourceDialect>
pub fn set_buffer_mode( &self, mode: BufferMode, ) -> QueryResponseFut<GpioSetBufferModeResult, DefaultFuchsiaResourceDialect>
Configures the output buffer as per mode.
Sourcepub fn get_interrupt(
&self,
options: InterruptOptions,
) -> QueryResponseFut<GpioGetInterruptResult, DefaultFuchsiaResourceDialect>
pub fn get_interrupt( &self, options: InterruptOptions, ) -> QueryResponseFut<GpioGetInterruptResult, DefaultFuchsiaResourceDialect>
Gets an interrupt object pertaining to a particular GPIO pin. Only one interrupt may
be outstanding per pin, and it must be released by calling ReleaseInterrupt() before the
next call to GetInterrupt() will succeed. The interrupt is unmasked prior to being
returned to the caller.
Returns ZX_ERR_ALREADY_EXISTS if GetInterrupt() has already been called without a
subsequent call to ReleaseInterrupt(), ZX_ERR_INVALID_ARGS if options is invalid, or
ZX_ERR_ACCESS_DENIED if another client has the interrupt.
Sourcepub fn configure_interrupt(
&self,
config: &InterruptConfiguration,
) -> QueryResponseFut<GpioConfigureInterruptResult, DefaultFuchsiaResourceDialect>
pub fn configure_interrupt( &self, config: &InterruptConfiguration, ) -> QueryResponseFut<GpioConfigureInterruptResult, DefaultFuchsiaResourceDialect>
Configures the polarity of an interrupt and whether it is edge- or level-triggered. Only the
client with the interrupt can call ConfigureInterrupt(), unless no client has an
interrupt.
Returns ZX_ERR_INVALID_ARGS if no fields are set in config, or ZX_ERR_ACCESS_DENIED if
another client has the interrupt.
Sourcepub fn release_interrupt(
&self,
) -> QueryResponseFut<GpioReleaseInterruptResult, DefaultFuchsiaResourceDialect>
pub fn release_interrupt( &self, ) -> QueryResponseFut<GpioReleaseInterruptResult, DefaultFuchsiaResourceDialect>
Releases the interrupt, allowing GetInterrupt() to be called again or by another
client. A client’s interrupt is automatically released when it disconnects from the
server. The interrupt is masked upon release.
Returns ZX_ERR_NOT_FOUND if the interrupt has already been released, or if
GetInterrupt() has not been called. Returns ZX_ERR_ACCESS_DENIED if another client has
the interrupt.
Trait Implementations§
Source§impl GpioProxyInterface for GpioProxy
impl GpioProxyInterface for GpioProxy
type ReadResponseFut = QueryResponseFut<Result<bool, i32>>
type SetBufferModeResponseFut = QueryResponseFut<Result<(), i32>>
type GetInterruptResponseFut = QueryResponseFut<Result<Interrupt, i32>>
type ConfigureInterruptResponseFut = QueryResponseFut<Result<(), i32>>
type ReleaseInterruptResponseFut = QueryResponseFut<Result<(), i32>>
fn read(&self) -> Self::ReadResponseFut
fn set_buffer_mode(&self, mode: BufferMode) -> Self::SetBufferModeResponseFut
fn get_interrupt( &self, options: InterruptOptions, ) -> Self::GetInterruptResponseFut
fn configure_interrupt( &self, config: &InterruptConfiguration, ) -> Self::ConfigureInterruptResponseFut
fn release_interrupt(&self) -> Self::ReleaseInterruptResponseFut
Source§impl Proxy for GpioProxy
impl Proxy for GpioProxy
Source§type Protocol = GpioMarker
type Protocol = GpioMarker
Proxy controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
Source§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
PEER_CLOSED signal.