通訊協定
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
|
這項呼叫運作時使用的平台專屬 PIN 碼。 |
無預設值 |
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>
|
新增:HEAD
|
固定
定義於 fuchsia.hardware.pinimpl/metadata.fidl
| 序數 | 欄位 | 類型 | 說明 |
|---|---|---|---|
1 |
pin |
uint32
|
|
2 |
name |
string:64
|
|
3 |
id |
uint32
|
新增:HEAD
|
UNIONS
彈性 InitCall
定義於 fuchsia.hardware.pinimpl/metadata.fidl
呼叫 fuchsia.hardware.pinimpl.PinImpl 的引數,做為 InitStep 的一部分。
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
pin_config |
fuchsia.hardware.pin/Configuration
|
如果設定,GPIO 核心驅動程式會使用指定的設定呼叫「Configure」。 |
2 |
buffer_mode |
fuchsia.hardware.gpio/BufferMode
|
如果設定,GPIO 核心驅動程式會以指定模式呼叫 |
彈性 InitStep
定義於 fuchsia.hardware.pinimpl/metadata.fidl
GPIO 核心驅動程式要執行的單一初始化步驟。
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
call |
Call
|
如果設定,GPIO 核心驅動程式會使用指定的接腳和引數呼叫 PinImpl 驅動程式庫。 |
2 |
delay |
zx/Duration
|
如果設定,GPIO 核心驅動程式會延遲這段時間,再處理下一個步驟。 |
PinImpl_ConfigureInterrupt_Result strict
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_ConfigureInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_Configure_Result strict
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_Configure_Response
|
|
2 |
err |
zx/Status
|
PinImpl_GetInterrupt_Result strict resource
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_GetInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_Read_Result strict
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_Read_Response
|
|
2 |
err |
zx/Status
|
PinImpl_ReleaseInterrupt_Result strict
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_ReleaseInterrupt_Response
|
|
2 |
err |
zx/Status
|
PinImpl_SetBufferMode_Result strict
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
PinImpl_SetBufferMode_Response
|
|
2 |
err |
zx/Status
|
常數
| 名稱 | 值 | 類型 | 說明 |
|---|---|---|---|
| MAX_DEVICE_NAME_LEN |
64
|
uint32 |
新增:HEAD
|
| METADATA_TYPE_NAME | fuchsia.hardware.pinimpl.Metadata |
String |
DEPRECATED - Unused |
服務
服務
定義於 fuchsia.hardware.pinimpl/pin-impl.fidl
| 名稱 | 類型 | 傳輸 |
|---|---|---|
| device |
fuchsia.hardware.pinimpl/PinImpl
|
駕駛 |