fuchsia.hardware.gpio

Added: 25

PROTOCOLS

Gpio

Defined in fuchsia.hardware.gpio/gpio.fidl

Common error codes:

  • ZX_ERR_NOT_SUPPORTED: The requested operation is not supported by this controller.

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.

Request

NameType
config InterruptConfiguration

Response

NameType
payload Gpio_ConfigureInterrupt_Result

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.

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.

Request

NameType
options InterruptOptions

Response

NameType
payload Gpio_GetInterrupt_Result

Read

Reads the current value of a GPIO, returning true for a high voltage and false for a low voltage.

Request

<EMPTY>

Response

NameType
payload Gpio_Read_Result

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.

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.

Request

<EMPTY>

Response

NameType
payload Gpio_ReleaseInterrupt_Result

SetBufferMode

Configures the output buffer as per mode.

Request

NameType
mode BufferMode

Response

NameType
payload Gpio_SetBufferMode_Result

STRUCTS

Gpio_ConfigureInterrupt_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

Gpio_GetInterrupt_Response resource

Defined in fuchsia.hardware.gpio/gpio.fidl

FieldTypeDescriptionDefault
interrupt handle<interrupt> No default

Gpio_Read_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

FieldTypeDescriptionDefault
value bool No default

Gpio_ReleaseInterrupt_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

Gpio_SetBufferMode_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

ENUMS

BufferMode strict

Type: uint32

Defined in fuchsia.hardware.gpio/gpio.fidl

Whether to drive the GPIO to a high or low voltage, or disable the output buffer.

NameValueDescription
0
1
2

InterruptMode strict

Type: uint32

Defined in fuchsia.hardware.gpio/gpio.fidl

NameValueDescription
0
1
2
3
4

TABLES

InterruptConfiguration

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalFieldTypeDescription
mode InterruptMode

UNIONS

Gpio_ConfigureInterrupt_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalVariantTypeDescription
response Gpio_ConfigureInterrupt_Response
err zx/Status

Gpio_GetInterrupt_Result strict resource

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalVariantTypeDescription
response Gpio_GetInterrupt_Response
err zx/Status

Gpio_Read_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalVariantTypeDescription
response Gpio_Read_Response
err zx/Status

Gpio_ReleaseInterrupt_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalVariantTypeDescription
response Gpio_ReleaseInterrupt_Response
err zx/Status

Gpio_SetBufferMode_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

OrdinalVariantTypeDescription
response Gpio_SetBufferMode_Response
err zx/Status

BITS

InterruptOptions flexible

Type: uint32

Defined in fuchsia.hardware.gpio/gpio.fidl

NameValueDescription

SERVICES

Service

Defined in fuchsia.hardware.gpio/gpio.fidl

NameTypeTransport
device fuchsia.hardware.gpio/Gpio Channel