协议
PinImpl
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
此协议结合了 fuchsia.hardware.gpio.Gpio 和 fuchsia.hardware.pin.Pin 的功能,接受一个数字来指示要操作的引脚。如需详细了解特定方法,请参阅这些协议定义。
PinImpl 服务器必须至少支持一个客户端连接。如果请求中断的客户端断开连接,服务器应释放 GetInterrupt() 返回的所有中断。
常见错误代码:
ZX_ERR_NOT_FOUND: 不存在编号为pin的引脚。ZX_ERR_NOT_SUPPORTED:此控制器不支持所请求的操作。ZX_ERR_WRONG_TYPE:如果引脚不支持 GPIO。
配置
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
config |
fuchsia.hardware.pin/Configuration
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_Configure_Result
|
ConfigureInterrupt
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
config |
fuchsia.hardware.gpio/InterruptConfiguration
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_ConfigureInterrupt_Result
|
GetInterrupt
PinImpl 服务器应为每次调用 GetInterrupt() 创建一个新的中断对象。
在返回给调用方之前,应取消屏蔽与 pin 对应的中断。
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
options |
fuchsia.hardware.gpio/InterruptOptions
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_GetInterrupt_Result
|
读取
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_Read_Result
|
ReleaseInterrupt
PinImpl 服务器应屏蔽与 pin 对应的中断。
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_ReleaseInterrupt_Result
|
SetBufferMode
请求
| 名称 | 类型 |
|---|---|
pin |
uint32
|
mode |
fuchsia.hardware.gpio/BufferMode
|
响应
| 名称 | 类型 |
|---|---|
payload |
PinImpl_SetBufferMode_Result
|
STRUCTS
致电
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
pin |
uint32
|
此调用操作的平台专用引脚编号。 |
无默认应用 |
call |
InitCall
|
要进行的调用以及要传递给它的参数。 |
无默认应用 |
DevicePinStates
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
name |
string:64
|
无默认应用 | |
states |
vector<PinState>
|
无默认应用 | |
id |
uint32
|
无默认应用 |
PinConfiguration
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
pin |
uint32
|
无默认应用 | |
call |
InitCall
|
无默认应用 |
PinImpl_ConfigureInterrupt_Response
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
<EMPTY>
PinImpl_Configure_Response
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
new_config |
fuchsia.hardware.pin/Configuration
|
无默认应用 |
PinImpl_GetInterrupt_Response 资源
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
interrupt |
handle<interrupt>
|
无默认应用 |
PinImpl_Read_Response
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
value |
bool
|
无默认应用 |
PinImpl_ReleaseInterrupt_Response
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
<EMPTY>
PinImpl_SetBufferMode_Response
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
<EMPTY>
PinState
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
name |
string:64
|
无默认应用 | |
pins |
vector<PinConfiguration>
|
无默认应用 |
TABLES
元数据
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
init_steps |
vector<InitStep>
|
初始化步骤会按照其在向量中出现的顺序依次处理。 在 GPIO 核心驱动程序的启动钩子期间,处理会发生一次。 |
2 |
controller_id |
uint32
|
|
3 |
pins |
vector<Pin>
|
|
4 |
device_pin_states |
vector<DevicePinStates>
|
Added: HEAD
|
固定
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
pin |
uint32
|
|
2 |
name |
string:64
|
|
3 |
id |
uint32
|
Added: HEAD
|
UNIONS
灵活的 InitCall
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
作为 InitStep 的一部分进行的 fuchsia.hardware.pinimpl.PinImpl 调用的参数。
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
pin_config |
fuchsia.hardware.pin/Configuration
|
如果设置了此字段,GPIO 核心驱动程序将使用给定的配置调用“Configure”。 |
2 |
buffer_mode |
fuchsia.hardware.gpio/BufferMode
|
如果设置了此属性,GPIO 核心驱动程序将使用给定模式调用 |
InitStep flexible
在 fuchsia.hardware.pinimpl/metadata.fidl 中定义
由 GPIO 核心驱动程序执行的单个初始化步骤。
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
call |
Call
|
如果设置了此属性,GPIO 核心驱动程序将使用给定的引脚和参数调用 PinImpl 驱动程序。 |
2 |
delay |
zx/Duration
|
如果设置了此属性,GPIO 核心驱动程序会延迟这么长时间,然后再处理下一步。 |
PinImpl_ConfigureInterrupt_Result strict
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_ConfigureInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_Configure_Result strict
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_Configure_Response
|
|
2 |
err |
zx/Status
|
PinImpl_GetInterrupt_Result strict resource
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_GetInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_Read_Result strict
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_Read_Response
|
|
2 |
err |
zx/Status
|
PinImpl_ReleaseInterrupt_Result strict
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_ReleaseInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_SetBufferMode_Result strict
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
PinImpl_SetBufferMode_Response
|
|
2 |
err |
zx/Status
|
常量
| 名称 | 值 | 类型 | 说明 |
|---|---|---|---|
| MAX_DEVICE_NAME_LEN |
64
|
uint32 |
Added: HEAD
|
| METADATA_TYPE_NAME | fuchsia.hardware.pinimpl.Metadata |
String |
已弃用 - 未使用 |
服务
服务
在 fuchsia.hardware.pinimpl/pin-impl.fidl 中定义
| 名称 | 类型 | 传输 |
|---|---|---|
| 设备 |
fuchsia.hardware.pinimpl/PinImpl
|
驱动程序 |