fuchsia.hardware.spi

新增:HEAD

通訊協定

控場

定義於 fuchsia.hardware.spi/spi.fidl

OpenSession

在裝置上開啟新的工作階段。

一次最多只能有一個工作階段;如果已有工作階段,伺服器端會關閉並傳回 ZX_ERR_ALREADY_BOUND。

要求

名稱類型
session server_end:Device

裝置

定義於 fuchsia.hardware.spi/spi.fidl

AssertCs

為這部裝置宣告 CS。如果匯流排上有多個裝置,則傳回 ZX_ERR_NOT_SUPPORTED。

要求

<EMPTY>

回應

名稱類型
status zx/Result

CanAssertCs

如果裝置可以呼叫 |AssertCs()| 和 |DeassertCs()|,則傳回 true。

要求

<EMPTY>

回應

名稱類型
can bool

DeassertCs

取消宣告這部裝置的 CS。如果 CS 已取消,則傳回 ZX_ERR_BAD_STATE。如果匯流排上有多個裝置,則傳回 ZX_ERR_NOT_SUPPORTED。

要求

<EMPTY>

回應

名稱類型
status zx/Result

Exchange

可同時傳輸及接收資料。tx_buffer 和 rx_buffer 的大小欄位必須相同。

要求

名稱類型
tx_buffer fuchsia.hardware.sharedmemory/SharedVmoBuffer
rx_buffer fuchsia.hardware.sharedmemory/SharedVmoBuffer

回應

名稱類型
payload fuchsia.hardware.sharedmemory/SharedVmoIo_Exchange_Result

ExchangeVector

全雙工 SPI 交易。接收的資料長度會與傳輸緩衝區完全相同。

要求

名稱類型
txdata vector<uint8>:8196

回應

名稱類型
status zx/Result
rxdata vector<uint8>:8196

接收

接收裝置資料並存入緩衝區。

要求

名稱類型
buffer fuchsia.hardware.sharedmemory/SharedVmoBuffer

回應

名稱類型
payload fuchsia.hardware.sharedmemory/SharedVmoIo_Receive_Result

ReceiveVector

從 SPI 裝置接收半雙工資料;一律讀取要求的完整大小。

要求

名稱類型
size uint32

回應

名稱類型
status zx/Result
data vector<uint8>:8196

RegisterVmo

Registers a VMO and transfers ownership to the driver. vmo_id: The ID chosen by the client that will be used in operations on this VMO. vmo: The handle, offset, and size of this VMO. 這個 VMO 的 IO 作業會與此處指定的偏移量和大小相關。 rights:SharedVmoRight 值的位元欄位,指出這個 VMO 的使用方式。呼叫端應假設驅動程式庫會使用這些權限,對 VMO 進行對應和/或固定。

要求

名稱類型
vmo_id uint32
vmo fuchsia.mem/Range
rights fuchsia.hardware.sharedmemory/SharedVmoRight

回應

名稱類型
payload fuchsia.hardware.sharedmemory/SharedVmoRegister_RegisterVmo_Result

傳輸

將緩衝區中的資料傳送至裝置。

要求

名稱類型
buffer fuchsia.hardware.sharedmemory/SharedVmoBuffer

回應

名稱類型
payload fuchsia.hardware.sharedmemory/SharedVmoIo_Transmit_Result

TransmitVector

以半雙工模式將資料傳輸至 SPI 裝置;成功時一律傳輸整個緩衝區。

要求

名稱類型
data vector<uint8>:8196

回應

名稱類型
status zx/Result

UnregisterVmo

取消對應和/或取消固定 VMO,並將控制代碼傳回呼叫端。

要求

名稱類型
vmo_id uint32

回應

名稱類型
payload fuchsia.hardware.sharedmemory/SharedVmoRegister_UnregisterVmo_Result

測試

定義於 fuchsia.hardware.spi/spi.fidl

ConnectSpiLoopback

在回送模式下開啟與 SPI 裝置的連線,用於測試。

如果這個版本未啟用偵錯功能,則會傳回 ZX_ERR_NOT_SUPPORTED。

如果 SPI 實作驅動程式庫本身不支援回送模式,這項呼叫會成功,但對裝置的呼叫會失敗,並傳回 ZX_ERR_NOT_SUPPORTED。

要求

名稱類型
server server_end:Device

回應

名稱類型
payload Test_ConnectSpiLoopback_Result

取得

要求

<EMPTY>

回應

名稱類型
payload fuchsia.driver.token/NodeToken_Get_Result

STRUCTS

Test_ConnectSpiLoopback_Response

定義於 fuchsia.hardware.spi/spi.fidl

<EMPTY>

UNIONS

Test_ConnectSpiLoopback_Result strict

定義於 fuchsia.hardware.spi/spi.fidl

序數Variant類型說明
response Test_ConnectSpiLoopback_Response
err zx/Status

常數

名稱值類型說明
MAX_TRANSFER_SIZE 8196 uint32

服務

ControllerService

定義於 fuchsia.hardware.spi/spi.fidl

名稱類型傳輸
device fuchsia.hardware.spi/Controller 版本

服務

定義於 fuchsia.hardware.spi/spi.fidl

名稱類型傳輸
device fuchsia.hardware.spi/Device 版本

TestService

定義於 fuchsia.hardware.spi/spi.fidl

名稱類型傳輸
測試 fuchsia.hardware.spi/Test 版本