blob: 5cb8e8d59e9865ca6ef27ddbbf2704f7017bb52c [file] [log] [blame] [edit]
// 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")
@banjo_layout("ddk-protocol")
closed 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.
strict Transmit(struct {
txdata vector<uint8>:MAX;
}) -> (struct {
status zx.Status;
});
/// Half-duplex receive data from a SPI device; always reads the full size requested.
strict Receive(struct {
size uint32;
}) -> (struct {
status zx.Status;
rxdata vector<uint8>:MAX;
});
/// Full-duplex SPI transaction. Received data will exactly equal the length of the transmit
/// buffer.
strict Exchange(struct {
txdata vector<uint8>:MAX;
}) -> (struct {
status zx.Status;
rxdata vector<uint8>:MAX;
});
};