pub enum GpioRequest {
Read {
responder: GpioReadResponder,
},
SetBufferMode {
mode: BufferMode,
responder: GpioSetBufferModeResponder,
},
GetInterrupt {
options: InterruptOptions,
responder: GpioGetInterruptResponder,
},
ConfigureInterrupt {
config: InterruptConfiguration,
responder: GpioConfigureInterruptResponder,
},
ReleaseInterrupt {
responder: GpioReleaseInterruptResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: GpioControlHandle,
method_type: MethodType,
},
}Expand description
Common error codes:
ZX_ERR_NOT_SUPPORTED: The requested operation is not supported by this controller.
Variants§
Read
Reads the current value of a GPIO, returning true for a high voltage and false for a
low voltage.
Fields
responder: GpioReadResponderSetBufferMode
Configures the output buffer as per mode.
GetInterrupt
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.
ConfigureInterrupt
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.
ReleaseInterrupt
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.
Fields
responder: GpioReleaseInterruptResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: GpioControlHandlemethod_type: MethodTypeImplementations§
Source§impl GpioRequest
impl GpioRequest
pub fn into_read(self) -> Option<GpioReadResponder>
pub fn into_set_buffer_mode( self, ) -> Option<(BufferMode, GpioSetBufferModeResponder)>
pub fn into_get_interrupt( self, ) -> Option<(InterruptOptions, GpioGetInterruptResponder)>
pub fn into_configure_interrupt( self, ) -> Option<(InterruptConfiguration, GpioConfigureInterruptResponder)>
pub fn into_release_interrupt(self) -> Option<GpioReleaseInterruptResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL