blob: eea0541979582fb95ce6ce95790bf2c28c5d43c9 [file] [log] [blame]
// Copyright 2020 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.gpio;
using zx;
protocol Gpio {
/// Configures a GPIO for input.
ConfigIn(uint32 flags) -> () error zx.status;
/// Configures a GPIO for output.
ConfigOut(uint8 initial_value) -> () error zx.status;
/// Reads the current value of a GPIO (0 or 1).
Read() -> (uint8 value) error zx.status;
/// Sets the current value of the GPIO (any non-zero value maps to 1).
Write(uint8 value) -> () error zx.status;
};