Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.gpio

PROTOCOLS

Gpio

Defined in fuchsia.hardware.gpio/gpio.fidl

ConfigIn

Configures a GPIO for input.

Request

NameType
flags uint32

Response

NameType
s zx/status

ConfigOut

Configures a GPIO for output.

Request

NameType
initial_value uint8

Response

NameType
s zx/status

GetInterrupt

Gets an interrupt object pertaining to a particular GPIO pin.

Request

NameType
flags uint32

Response

NameType
s zx/status
irq handle<interrupt>

Read

Reads the current value of a GPIO (0 or 1).

Request

<EMPTY>

Response

NameType
s zx/status
value uint8

ReleaseInterrupt

Release the interrupt.

Request

<EMPTY>

Response

NameType
s zx/status

SetAltFunction

Configures the GPIO pin for an alternate function (I2C, SPI, etc) the interpretation of "function" is platform dependent.

Request

NameType
function uint64

Response

NameType
s zx/status

SetDriveStrength

Set GPIO drive strength.

Request

NameType
ds_ua uint64

Response

NameType
s zx/status
actual_ds_ua uint64

SetPolarity

Set GPIO polarity.

Request

NameType
polarity GpioPolarity

Response

NameType
s zx/status

Write

Sets the current value of the GPIO (any non-zero value maps to 1).

Request

NameType
value uint8

Response

NameType
s zx/status

Gpio

Defined in fuchsia.hardware.gpio/gpio.fidl

ConfigIn

Configures a GPIO for input.

Request

NameType
flags GpioFlags

Response

NameType
result Gpio_ConfigIn_Result

ConfigOut

Configures a GPIO for output.

Request

NameType
initial_value uint8

Response

NameType
result Gpio_ConfigOut_Result

GetInterrupt

Gets an interrupt object pertaining to a particular GPIO pin. flags is passed as the options parameter when creating the interrupt.

Request

NameType
flags uint32

Response

NameType
result Gpio_GetInterrupt_Result

Read

Reads the current value of a GPIO (0 or 1).

Request

<EMPTY>

Response

NameType
result Gpio_Read_Result

ReleaseInterrupt

Release the interrupt.

Request

<EMPTY>

Response

NameType
result Gpio_ReleaseInterrupt_Result

SetDriveStrength

Sets the drive strength of the GPIO. actual_ds_ua is always >= ds_ua. If ds_ua is larger than max value, the drive strength will be set to the max value. Return error if unable to set drive strength. actual_ds_ua is not set in this case.

Request

NameType
ds_ua uint64

Response

NameType
result Gpio_SetDriveStrength_Result

Write

Sets the current value of the GPIO (any non-zero value maps to 1).

Request

NameType
value uint8

Response

NameType
result Gpio_Write_Result

STRUCTS

Gpio_ConfigIn_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

Gpio_ConfigOut_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

Gpio_GetInterrupt_Response resource

Defined in fuchsia.hardware.gpio/gpio.fidl

FieldTypeDescriptionDefault
irq handle<interrupt> No default

Gpio_Read_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

FieldTypeDescriptionDefault
value uint8 No default

Gpio_ReleaseInterrupt_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

Gpio_SetDriveStrength_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

FieldTypeDescriptionDefault
actual_ds_ua uint64 No default

Gpio_Write_Response

Defined in fuchsia.hardware.gpio/gpio.fidl

<EMPTY>

ENUMS

GpioFlags strict

Type: uint32

Defined in fuchsia.hardware.gpio/gpio.fidl

Flags for ConfigIn.

NameValueDescription
PULL_DOWN 0
PULL_UP 1
NO_PULL 2
PULL_MASK 3

GpioPolarity strict

Type: uint32

Defined in fuchsia.hardware.gpio/gpio.fidl

Values for SetPolarity.

NameValueDescription
LOW 0
HIGH 1

UNIONS

Gpio_ConfigIn_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_ConfigIn_Response
2 err zx/status

Gpio_ConfigOut_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_ConfigOut_Response
2 err zx/status

Gpio_GetInterrupt_Result strict resource

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_GetInterrupt_Response
2 err zx/status

Gpio_Read_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_Read_Response
2 err zx/status

Gpio_ReleaseInterrupt_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_ReleaseInterrupt_Response
2 err zx/status

Gpio_SetDriveStrength_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_SetDriveStrength_Response
2 err zx/status

Gpio_Write_Result strict

Defined in fuchsia.hardware.gpio/gpio.fidl

Ordinal
VariantTypeDescription
1 response Gpio_Write_Response
2 err zx/status

CONSTANTS

NameValueTypeDescription
GPIO_NO_PULL 2 uint32
GPIO_PULL_DOWN 0 uint32

Flags for ConfigIn.

GPIO_PULL_MASK 3 uint32
GPIO_PULL_UP 1 uint32