fuchsia.hardware.gpioimpl

Added: HEAD

PROTOCOLS

GpioImpl

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

ConfigIn

Configures a GPIO for input.

Request

NameType
index uint32
flags fuchsia.hardware.gpio/GpioFlags

Response

NameType
payload GpioImpl_ConfigIn_Result

ConfigOut

Configures a GPIO for output.

Request

NameType
index uint32
initial_value uint8

Response

NameType
payload GpioImpl_ConfigOut_Result

GetControllerId

Returns a number that uniquely identifies this GPIO controller device. The GPIO core driver will use this to create bind properties for pin devices so that controllers can have overlapping pin numbers. Thus, every (controller, pin) combination will identify at most one pin device.

On platforms that will only ever have one GPIO controller device, or that will not have overlapping pin numbers across devices, this method can just return some hardcoded value. Otherwise, a value such as the controller's devicetree phandle could be returned.

Request

<EMPTY>

Response

NameType
controller_id uint32

GetDriveStrength

Gets the configured drive strength of the GPIO in microamps (ua).

Request

NameType
index uint32

Response

NameType
payload GpioImpl_GetDriveStrength_Result

GetInitSteps

Returns a vector of initialization steps to be performed by the GPIO core driver in its start hook. Steps are processed sequentially in the order that they appear in the vector. If no steps are provided, the core driver does not add an init device.

Request

<EMPTY>

Response

NameType
steps vector<InitStep>

GetInterrupt

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

Request

NameType
index uint32
flags uint32

Response

NameType
payload GpioImpl_GetInterrupt_Result

GetPins

Returns a vector of pins on this controller to be exposed by the GPIO core driver.

Request

<EMPTY>

Response

NameType
pins vector<Pin>

Read

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

Request

NameType
index uint32

Response

NameType
payload GpioImpl_Read_Result

ReleaseInterrupt

Release the interrupt.

Request

NameType
index uint32

Response

NameType
payload GpioImpl_ReleaseInterrupt_Result

SetAltFunction

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

Request

NameType
index uint32
function uint64

Response

NameType
payload GpioImpl_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

NameType
index uint32
ds_ua uint64

Response

NameType
payload GpioImpl_SetDriveStrength_Result

SetPolarity

Set GPIO polarity.

Request

NameType
index uint32
polarity fuchsia.hardware.gpio/GpioPolarity

Response

NameType
payload GpioImpl_SetPolarity_Result

Write

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

Request

NameType
index uint32
value uint8

Response

NameType
payload GpioImpl_Write_Result

STRUCTS

ControllerMetadata

Defined in fuchsia.hardware.gpioimpl/metadata.fidl

Information passed to the GPIO core driver through GpioImpl protocol methods.

FieldTypeDescriptionDefault
id uint32

ID for the controller which is unique among all gpio controllers. Passed through GetControllerId to the core driver.

No default

GpioImpl_ConfigIn_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

GpioImpl_ConfigOut_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

GpioImpl_GetDriveStrength_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

FieldTypeDescriptionDefault
result_ua uint64 No default

GpioImpl_GetInterrupt_Response resource

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

FieldTypeDescriptionDefault
irq handle<interrupt> No default

GpioImpl_Read_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

FieldTypeDescriptionDefault
value uint8 No default

GpioImpl_ReleaseInterrupt_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

GpioImpl_SetAltFunction_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

GpioImpl_SetDriveStrength_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

FieldTypeDescriptionDefault
actual_ds_ua uint64 No default

GpioImpl_SetPolarity_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

GpioImpl_Write_Response

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

<EMPTY>

InitMetadata

Defined in fuchsia.hardware.gpioimpl/metadata.fidl

Passed to the GPIO core driver in metadata as DEVICE_METADATA_GPIO_INIT. Steps are processed sequentially in the order that they appear in the vector. Processing occurs once during the GPIO core driver's bind hook.

FieldTypeDescriptionDefault
steps vector<InitStep> No default

InitStep

Defined in fuchsia.hardware.gpioimpl/metadata.fidl

A single init step to be performed by the GPIO core driver.

FieldTypeDescriptionDefault
index uint32

The platform-specific GPIO index that this step operates on.

No default
call InitCall

A call to make on this GPIO.

No default

Pin

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

FieldTypeDescriptionDefault
pin uint32

An identifying number for this pin, set by the GPIO core driver as the fuchsia.BIND_GPIO_PIN bind property. Must be unique for this GPIO controller.

No default
name string[64]?

A human-readable, informational name for this pin. Optional, but helpful for manual testing purposes.

No default

UNIONS

GpioImpl_ConfigIn_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_ConfigIn_Response
err zx/Status

GpioImpl_ConfigOut_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_ConfigOut_Response
err zx/Status

GpioImpl_GetDriveStrength_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_GetDriveStrength_Response
err zx/Status

GpioImpl_GetInterrupt_Result strict resource

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_GetInterrupt_Response
err zx/Status

GpioImpl_Read_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_Read_Response
err zx/Status

GpioImpl_ReleaseInterrupt_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_ReleaseInterrupt_Response
err zx/Status

GpioImpl_SetAltFunction_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_SetAltFunction_Response
err zx/Status

GpioImpl_SetDriveStrength_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_SetDriveStrength_Response
err zx/Status

GpioImpl_SetPolarity_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_SetPolarity_Response
err zx/Status

GpioImpl_Write_Result strict

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

OrdinalVariantTypeDescription
response GpioImpl_Write_Response
err zx/Status

InitCall flexible

Defined in fuchsia.hardware.gpioimpl/metadata.fidl

A fuchsia.hardware.gpio.Gpio call to make as part of an InitStep.

OrdinalVariantTypeDescription
input_flags fuchsia.hardware.gpio/GpioFlags

If set, the GPIO core driver will call ConfigIn with the given flags.

output_value uint8

If set, the GPIO core driver will call ConfigOut with the given output value.

alt_function uint64

If set, the GPIO core driver will call SetAltFunction with the given alt function value (specific to the GPIO implementation driver).

drive_strength_ua uint64

If set, the GPIO core driver will call SetDriveStrength with the given value in microamps.

delay zx/Duration

If set, the GPIO core driver will delay for this long before processing the next step.

CONSTANTS

NameValueTypeDescription
MAX_GPIO_NAME_LEN 64 uint32

SERVICES

Service

Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl

NameTypeTransport
device fuchsia.hardware.gpioimpl/GpioImpl Driver