PROTOCOLS
Device
Defined in fuchsia.hardware.gpio/gpio.fidl
OpenSession
Opens a new session on the device.
At most one session is permitted at one time; the server end will be
closed with ZX_ERR_ALREADY_BOUND
if a session already exists.
Request
Name | Type |
---|---|
session |
server_end<Gpio>
|
Gpio
Defined in fuchsia.hardware.gpio/gpio.fidl
ConfigIn
Configures a GPIO for input.
Request
Name | Type |
---|---|
flags |
GpioFlags
|
Response
Name | Type |
---|---|
payload |
Gpio_ConfigIn_Result
|
ConfigOut
Configures a GPIO for output.
Request
Name | Type |
---|---|
initial_value |
uint8
|
Response
Name | Type |
---|---|
payload |
Gpio_ConfigOut_Result
|
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
of no fields are set, or ZX_ERR_ACCESS_DENIED
if another
client has the interrupt.
Request
Name | Type |
---|---|
config |
InterruptConfiguration
|
Response
Name | Type |
---|---|
payload |
Gpio_ConfigureInterrupt_Result
|
GetDriveStrength
Gets the configured drive strength of the GPIO in microamps (ua).
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Gpio_GetDriveStrength_Result
|
GetInterrupt
Gets an interrupt object pertaining to a particular GPIO pin. flags
is passed as the options
parameter when
creating the interrupt.
Request
Name | Type |
---|---|
flags |
uint32
|
Response
Name | Type |
---|---|
payload |
Gpio_GetInterrupt_Result
|
GetName
Get the name of a GPIO.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Gpio_GetName_Result
|
GetPin
Get the pin of a GPIO
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Gpio_GetPin_Result
|
Read
Reads the current value of a GPIO, returning true
for a high voltage and false
for a
low voltage.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Gpio_Read_Result
|
ReleaseInterrupt
Release the interrupt.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Gpio_ReleaseInterrupt_Result
|
SetAltFunction
Configures the GPIO pin for an alternate function (I2C, SPI, etc) the interpretation of "function" is platform dependent.
Request
Name | Type |
---|---|
function |
uint64
|
Response
Name | Type |
---|---|
payload |
Gpio_SetAltFunction_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
Name | Type |
---|---|
ds_ua |
uint64
|
Response
Name | Type |
---|---|
payload |
Gpio_SetDriveStrength_Result
|
Write
Sets the current value of the GPIO (any non-zero value maps to 1).
Request
Name | Type |
---|---|
value |
uint8
|
Response
Name | Type |
---|---|
payload |
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_ConfigureInterrupt_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
<EMPTY>
Gpio_GetDriveStrength_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
result_ua |
uint64
|
No default |
Gpio_GetInterrupt_Response resource
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
irq |
handle<interrupt>
|
No default |
Gpio_GetName_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
name |
string[256]
|
No default |
Gpio_GetPin_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
pin |
uint32
|
No default |
Gpio_Read_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
bool
|
No default |
Gpio_ReleaseInterrupt_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
<EMPTY>
Gpio_SetAltFunction_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
<EMPTY>
Gpio_SetDriveStrength_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
Field | Type | Description | Default |
---|---|---|---|
actual_ds_ua |
uint64
|
No default |
Gpio_Write_Response
Defined in fuchsia.hardware.gpio/gpio.fidl
<EMPTY>
ENUMS
BufferMode strict
Type: uint32
Defined in fuchsia.hardware.gpio/gpio.fidl
Name | Value | Description |
---|---|---|
INPUT |
0 |
|
OUTPUT_LOW |
1 |
|
OUTPUT_HIGH |
2 |
GpioFlags strict
Type: uint32
Defined in fuchsia.hardware.gpio/gpio.fidl
Flags for ConfigIn
.
Name | Value | Description |
---|---|---|
PULL_DOWN |
0 |
|
PULL_UP |
1 |
|
NO_PULL |
2 |
GpioPolarity strict
Type: uint32
Defined in fuchsia.hardware.gpio/gpio.fidl
Values for SetPolarity
.
Name | Value | Description |
---|---|---|
LOW |
0 |
|
HIGH |
1 |
InterruptMode strict
Type: uint32
Defined in fuchsia.hardware.gpio/gpio.fidl
Name | Value | Description |
---|---|---|
EDGE_LOW |
0 |
|
EDGE_HIGH |
1 |
|
EDGE_BOTH |
2 |
|
LEVEL_LOW |
3 |
|
LEVEL_HIGH |
4 |
TABLES
InterruptConfiguration
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
mode |
InterruptMode
|
UNIONS
Gpio_ConfigIn_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_ConfigIn_Response
|
|
2 |
err |
zx/Status
|
Gpio_ConfigOut_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_ConfigOut_Response
|
|
2 |
err |
zx/Status
|
Gpio_ConfigureInterrupt_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_ConfigureInterrupt_Response
|
|
2 |
err |
zx/Status
|
Gpio_GetDriveStrength_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_GetDriveStrength_Response
|
|
2 |
err |
zx/Status
|
Gpio_GetInterrupt_Result strict resource
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_GetInterrupt_Response
|
|
2 |
err |
zx/Status
|
Gpio_GetName_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_GetName_Response
|
|
2 |
err |
zx/Status
|
Gpio_GetPin_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_GetPin_Response
|
|
2 |
err |
zx/Status
|
Gpio_Read_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_Read_Response
|
|
2 |
err |
zx/Status
|
Gpio_ReleaseInterrupt_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_ReleaseInterrupt_Response
|
|
2 |
err |
zx/Status
|
Gpio_SetAltFunction_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_SetAltFunction_Response
|
|
2 |
err |
zx/Status
|
Gpio_SetDriveStrength_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_SetDriveStrength_Response
|
|
2 |
err |
zx/Status
|
Gpio_Write_Result strict
Defined in fuchsia.hardware.gpio/gpio.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Gpio_Write_Response
|
|
2 |
err |
zx/Status
|
BITS
InterruptOptions flexible
Type: uint32
Defined in fuchsia.hardware.gpio/gpio.fidl
Name | Value | Description |
---|
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
MAX_GPIO_NAME_LEN |
256
|
uint32 |
Maximum length of the GPIO name. |
SERVICES
Service
Defined in fuchsia.hardware.gpio/gpio.fidl
Name | Type | Transport |
---|---|---|
device |
fuchsia.hardware.gpio/Gpio
|
Channel |