PROTOCOLS
GpioImpl
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
ConfigIn
Configures a GPIO for input.
Request
Name | Type |
---|---|
index |
uint32
|
flags |
fuchsia.hardware.gpio/GpioFlags
|
Response
Name | Type |
---|---|
payload |
GpioImpl_ConfigIn_Result
|
ConfigOut
Configures a GPIO for output.
Request
Name | Type |
---|---|
index |
uint32
|
initial_value |
uint8
|
Response
Name | Type |
---|---|
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
Name | Type |
---|---|
controller_id |
uint32
|
GetDriveStrength
Gets the configured drive strength of the GPIO in microamps (ua).
Request
Name | Type |
---|---|
index |
uint32
|
Response
Name | Type |
---|---|
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
Name | Type |
---|---|
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
Name | Type |
---|---|
index |
uint32
|
flags |
uint32
|
Response
Name | Type |
---|---|
payload |
GpioImpl_GetInterrupt_Result
|
GetPins
Returns a vector of pins on this controller to be exposed by the GPIO core driver.
Request
<EMPTY>
Response
Name | Type |
---|---|
pins |
vector<Pin>
|
Read
Reads the current value of a GPIO (0 or 1).
Request
Name | Type |
---|---|
index |
uint32
|
Response
Name | Type |
---|---|
payload |
GpioImpl_Read_Result
|
ReleaseInterrupt
Release the interrupt.
Request
Name | Type |
---|---|
index |
uint32
|
Response
Name | Type |
---|---|
payload |
GpioImpl_ReleaseInterrupt_Result
|
SetAltFunction
Configures the GPIO pin for an alternate function (I2C, SPI, etc) the interpretation of "function" is platform dependent.
Request
Name | Type |
---|---|
index |
uint32
|
function |
uint64
|
Response
Name | Type |
---|---|
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
Name | Type |
---|---|
index |
uint32
|
ds_ua |
uint64
|
Response
Name | Type |
---|---|
payload |
GpioImpl_SetDriveStrength_Result
|
SetPolarity
Set GPIO polarity.
Request
Name | Type |
---|---|
index |
uint32
|
polarity |
fuchsia.hardware.gpio/GpioPolarity
|
Response
Name | Type |
---|---|
payload |
GpioImpl_SetPolarity_Result
|
Write
Sets the current value of the GPIO (any non-zero value maps to 1).
Request
Name | Type |
---|---|
index |
uint32
|
value |
uint8
|
Response
Name | Type |
---|---|
payload |
GpioImpl_Write_Result
|
STRUCTS
ControllerMetadata
Defined in fuchsia.hardware.gpioimpl/metadata.fidl
Information passed to the GPIO core driver through GpioImpl protocol methods.
Field | Type | Description | Default |
---|---|---|---|
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
Field | Type | Description | Default |
---|---|---|---|
result_ua |
uint64
|
No default |
GpioImpl_GetInterrupt_Response resource
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Field | Type | Description | Default |
---|---|---|---|
irq |
handle<interrupt>
|
No default |
GpioImpl_Read_Response
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Field | Type | Description | Default |
---|---|---|---|
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
Field | Type | Description | Default |
---|---|---|---|
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.
Field | Type | Description | Default |
---|---|---|---|
steps |
vector<InitStep>
|
No default |
Pin
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Field | Type | Description | Default |
---|---|---|---|
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 |
TABLES
InitStep
Defined in fuchsia.hardware.gpioimpl/metadata.fidl
A single init step to be performed by the GPIO core driver.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
index |
uint32
|
The platform-specific GPIO index that this step operates on.
This must be unset if |
2 |
call |
InitCall
|
A call to make on this GPIO. This must be set. |
UNIONS
GpioImpl_ConfigIn_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_ConfigIn_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_ConfigOut_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_ConfigOut_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_GetDriveStrength_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_GetDriveStrength_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_GetInterrupt_Result strict resource
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_GetInterrupt_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_Read_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_Read_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_ReleaseInterrupt_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_ReleaseInterrupt_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_SetAltFunction_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_SetAltFunction_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_SetDriveStrength_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_SetDriveStrength_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_SetPolarity_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_SetPolarity_Response
|
|
2 |
err |
zx/Status
|
GpioImpl_Write_Result strict
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
GpioImpl_Write_Response
|
|
2 |
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
.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
input_flags |
fuchsia.hardware.gpio/GpioFlags
|
If set, the GPIO core driver will call |
2 |
output_value |
uint8
|
If set, the GPIO core driver will call |
3 |
alt_function |
uint64
|
If set, the GPIO core driver will call |
4 |
drive_strength_ua |
uint64
|
If set, the GPIO core driver will call |
5 |
delay |
zx/Duration
|
If set, the GPIO core driver will delay for this long before processing the next step. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
MAX_GPIO_NAME_LEN |
64
|
uint32 |
SERVICES
Service
Defined in fuchsia.hardware.gpioimpl/gpio-impl.fidl
Name | Type | Transport |
---|---|---|
device |
fuchsia.hardware.gpioimpl/GpioImpl
|
Driver |