blob: 50602c593c95ac8be11c50b260b7169f4f543892 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.spi;
using zx;
[Transport = "Banjo", BanjoLayout = "ddk-protocol"]
protocol Spi {
// TODO(67570): Remove these once all drivers have switched over to the FIDL protocol.
/// Half-duplex transmit data to a SPI device; always transmits the entire buffer on success.
Transmit(vector<uint8>:MAX txdata) -> (zx.status status);
/// Half-duplex receive data from a SPI device; always reads the full size requested.
Receive(uint32 size) -> (zx.status status, vector<uint8>:MAX rxdata);
/// Full-duplex SPI transaction. Received data will exactly equal the length of the transmit
/// buffer.
Exchange(vector<uint8>:MAX txdata) -> (zx.status status, vector<uint8>:MAX rxdata);
/// Tells the SPI driver to start listening for fuchsia.hardware.spi messages on server.
/// See sdk/fidl/fuchsia.hardware.spi/spi.fidl.
ConnectServer(zx.handle:CHANNEL server) -> ();