fuchsia.hardware.gpio

添加时间:HEAD

PROTOCOLS

设备

fuchsia.hardware.gpio/gpio.fidl 中定义

OpenSession

在设备上打开新会话。

一次最多只能有一个会话;服务器端将是 如果会话已存在,则返回 ZX_ERR_ALREADY_BOUND

请求

名称类型
session server_end<Gpio>

GPIO

fuchsia.hardware.gpio/gpio.fidl 中定义

ConfigIn

配置用于输入的 GPIO。

请求

名称类型
flags GpioFlags

响应

名称类型
payload Gpio_ConfigIn_Result

ConfigOut

配置用于输出的 GPIO。

请求

名称类型
initial_value uint8

响应

名称类型
payload Gpio_ConfigOut_Result

ConfigureInterrupt

配置中断的极性,以及是边缘触发还是电平触发。只有 具有中断的客户端可以调用 ConfigureInterrupt(),除非所有客户端都没有 中断。

如果未设置任何字段,则返回 ZX_ERR_INVALID_ARGS;如果有其他字段,则返回 ZX_ERR_ACCESS_DENIED 出现中断。

请求

名称类型
config InterruptConfiguration

响应

名称类型
payload Gpio_ConfigureInterrupt_Result

GetDriveStrength

获取已配置的 GPIO 驱动强度,以微安 (ua) 为单位。

请求

<空>

响应

名称类型
payload Gpio_GetDriveStrength_Result

GetInterrupt

获取与特定 GPIO 引脚相关的中断对象。flags 会作为 options 参数传递, 创建中断

请求

名称类型
flags uint32

响应

名称类型
payload Gpio_GetInterrupt_Result

GetName

获取 GPIO 的名称。

请求

<空>

响应

名称类型
payload Gpio_GetName_Result

GetPin

获取 GPIO 的引脚

请求

<空>

响应

名称类型
payload Gpio_GetPin_Result

已读

读取 GPIO 的电流值,对于高电压,返回 true;对于高电压,返回 false 低压。

请求

<空>

响应

名称类型
payload Gpio_Read_Result

ReleaseInterrupt

释放中断。

请求

<空>

响应

名称类型
payload Gpio_ReleaseInterrupt_Result

SetAltFunction

配置替代功能(I2C、SPI 等)的 GPIO 引脚 对“函数”的解释取决于平台

请求

名称类型
function uint64

响应

名称类型
payload Gpio_SetAltFunction_Result

SetDriveStrength

设置 GPIO 的驱动强度。 actual_ds_ua 始终为 >= ds_ua。如果 ds_ua 大于最大值,则驱动器强度将设置为最大值。 如果无法设置驱动强度,则返回错误。在本示例中,未设置 actual_ds_ua。

请求

名称类型
ds_ua uint64

响应

名称类型
payload Gpio_SetDriveStrength_Result

写入

设置 GPIO 的当前值(任何非零值都映射到 1)。

请求

名称类型
value uint8

响应

名称类型
payload Gpio_Write_Result

结构体

Gpio_ConfigIn_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

Gpio_ConfigOut_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

Gpio_ConfigureInterrupt_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

Gpio_GetDriveStrength_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
result_ua uint64 无默认设置

Gpio_GetInterrupt_Response 资源

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
irq handle<interrupt> 无默认设置

Gpio_GetName_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
name string[256] 无默认设置

Gpio_GetPin_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
pin uint32 无默认设置

Gpio_Read_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
value bool 无默认设置

Gpio_ReleaseInterrupt_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

Gpio_SetAltFunction_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

Gpio_SetDriveStrength_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

字段类型说明默认
actual_ds_ua uint64 无默认设置

Gpio_Write_Response

fuchsia.hardware.gpio/gpio.fidl 中定义

<空>

精英

BufferMode 严格

类型:uint32

fuchsia.hardware.gpio/gpio.fidl 中定义

名称说明
0
1
2

GpioFlag 严格

类型:uint32

fuchsia.hardware.gpio/gpio.fidl 中定义

ConfigIn 的标志。

名称说明
0
1
2

GpioPolarity 严格

类型:uint32

fuchsia.hardware.gpio/gpio.fidl 中定义

SetPolarity 的值。

名称说明
0
1

InterruptMode 严格

类型:uint32

fuchsia.hardware.gpio/gpio.fidl 中定义

名称说明
0
1
2
3
4

InterruptConfiguration

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal字段类型说明
mode InterruptMode

联合体

Gpio_ConfigIn_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_ConfigIn_Response
err zx/Status

Gpio_ConfigOut_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_ConfigOut_Response
err zx/Status

Gpio_ConfigureInterrupt_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_ConfigureInterrupt_Response
err zx/Status

Gpio_GetDriveStrength_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_GetDriveStrength_Response
err zx/Status

Gpio_GetInterrupt_Result 严格 资源

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_GetInterrupt_Response
err zx/Status

Gpio_GetName_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_GetName_Response
err zx/Status

Gpio_GetPin_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_GetPin_Response
err zx/Status

Gpio_Read_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_Read_Response
err zx/Status

Gpio_ReleaseInterrupt_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_ReleaseInterrupt_Response
err zx/Status

Gpio_SetAltFunction_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_SetAltFunction_Response
err zx/Status

Gpio_SetDriveStrength_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_SetDriveStrength_Response
err zx/Status

Gpio_Write_Result 严格

fuchsia.hardware.gpio/gpio.fidl 中定义

Ordinal变体类型说明
response Gpio_Write_Response
err zx/Status

常量

名称类型说明
MAX_GPIO_NAME_LEN 256 uint32

GPIO 名称的最大长度。

服务

服务

fuchsia.hardware.gpio/gpio.fidl 中定义

名称类型传输
设备 fuchsia.hardware.gpio/Gpio 频道