PROTOCOLS
Controller
Defined in fuchsia.hardware.spi/spi.fidl
OpenSession
Opens a new session on the device.
At most one session is permitted at one time; the server end will be
closed with ZX_ERR_ALREADY_BOUND if a session already exists.
Request
| Name | Type |
|---|---|
session |
server_end:Device
|
Device
Defined in fuchsia.hardware.spi/spi.fidl
AssertCs
Assert CS for this device. Returns ZX_ERR_NOT_SUPPORTED if there is more than one device on the bus.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
status |
zx/Status
|
CanAssertCs
Returns true if the device can call |AssertCs()| and |DeassertCs()|.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
can |
bool
|
DeassertCs
Deassert CS for this device. Returns ZX_ERR_BAD_STATE if CS is already deasserted. Returns ZX_ERR_NOT_SUPPORTED if there is more than one device on the bus.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
status |
zx/Status
|
Exchange
Simultaneously transmits and receives data. The size fields of tx_buffer and rx_buffer must be the same.
Request
| Name | Type |
|---|---|
tx_buffer |
fuchsia.hardware.sharedmemory/SharedVmoBuffer
|
rx_buffer |
fuchsia.hardware.sharedmemory/SharedVmoBuffer
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.sharedmemory/SharedVmoIo_Exchange_Result
|
ExchangeVector
Full-duplex SPI transaction. Received data will exactly equal the length of the transmit buffer.
Request
| Name | Type |
|---|---|
txdata |
vector<uint8>:8196
|
Response
| Name | Type |
|---|---|
status |
zx/Status
|
rxdata |
vector<uint8>:8196
|
Receive
Receives data from the device into buffer.
Request
| Name | Type |
|---|---|
buffer |
fuchsia.hardware.sharedmemory/SharedVmoBuffer
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.sharedmemory/SharedVmoIo_Receive_Result
|
ReceiveVector
Half-duplex receive data from a SPI device; always reads the full size requested.
Request
| Name | Type |
|---|---|
size |
uint32
|
Response
| Name | Type |
|---|---|
status |
zx/Status
|
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. IO operations on this VMO will be relative to the offset and size specified here. rights: A bit field of SharedVmoRight values indicating how this VMO may be used. Callers should assume that the driver will map and/or pin the VMO using these rights.
Request
| Name | Type |
|---|---|
vmo_id |
uint32
|
vmo |
fuchsia.mem/Range
|
rights |
fuchsia.hardware.sharedmemory/SharedVmoRight
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.sharedmemory/SharedVmoRegister_RegisterVmo_Result
|
Transmit
Sends the data in buffer to the device.
Request
| Name | Type |
|---|---|
buffer |
fuchsia.hardware.sharedmemory/SharedVmoBuffer
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.sharedmemory/SharedVmoIo_Transmit_Result
|
TransmitVector
Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.
Request
| Name | Type |
|---|---|
data |
vector<uint8>:8196
|
Response
| Name | Type |
|---|---|
status |
zx/Status
|
UnregisterVmo
Unmaps and/or unpins the VMO and returns the handle to the caller.
Request
| Name | Type |
|---|---|
vmo_id |
uint32
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.sharedmemory/SharedVmoRegister_UnregisterVmo_Result
|
Test
Defined in fuchsia.hardware.spi/spi.fidl
ConnectSpiLoopback
Opens a connection to a SPI device in loopback mode, to be used for testing.
Returns ZX_ERR_NOT_SUPPORTED if debugging is not enabled in this build.
If the SPI implementation driver itself does not support loopback mode, this call will succeed, but calls to the Device will fail with ZX_ERR_NOT_SUPPORTED instead.
Request
| Name | Type |
|---|---|
server |
server_end:Device
|
Response
| Name | Type |
|---|---|
payload |
Test_ConnectSpiLoopback_Result
|
STRUCTS
Test_ConnectSpiLoopback_Response
Defined in fuchsia.hardware.spi/spi.fidl
<EMPTY>
UNIONS
Test_ConnectSpiLoopback_Result strict
Defined in fuchsia.hardware.spi/spi.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Test_ConnectSpiLoopback_Response
|
|
2 |
err |
zx/Status
|
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| MAX_TRANSFER_SIZE |
8196
|
uint32 |
SERVICES
ControllerService
Defined in fuchsia.hardware.spi/spi.fidl
| Name | Type | Transport |
|---|---|---|
| device |
fuchsia.hardware.spi/Controller
|
Channel |
Service
Defined in fuchsia.hardware.spi/spi.fidl
| Name | Type | Transport |
|---|---|---|
| device |
fuchsia.hardware.spi/Device
|
Channel |
TestService
Defined in fuchsia.hardware.spi/spi.fidl
| Name | Type | Transport |
|---|---|---|
| test |
fuchsia.hardware.spi/Test
|
Channel |