blob: 292649af5443a13b2b9d97cf1452f6029192eb4c [file] [log] [blame]
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
use anyhow::Result;
/// A trait which represents a GPIO interface.
pub trait Gpio {
/// Reads the value of the the GPIO pin `id`.
fn read(&self, id: u32) -> Result<bool>;
/// Sets the value of the GPIO pin `id` to `value`.
fn write(&self, id: u32, value: bool) -> Result<()>;
}