blob: f41a53a3d543b2174d03a1500cf6fef82f313249 [file] [log] [blame]
// Copyright 2021 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.nvram;
using zx;
/// Maximum amount of data that can be transferred in a single transaction.
const NVRAM_MAX uint32 = 256;
/// A device that contains some small amount of non-volatile storage.
closed protocol Device {
/// Get the size of the NVRAM NVRAM.
strict GetSize() -> (struct {
size uint32;
});
/// Read |size| bytes of data starting at |offset|.
/// Returns ZX_ERR_OUT_OF_RANGE if the data extends past the end of the
/// nvram.
strict Read(struct {
offset uint32;
size uint32;
}) -> (struct {
data vector<uint8>:NVRAM_MAX;
}) error zx.Status;
/// Write |data| starting at |offset|.
/// Returns ZX_ERR_OUT_OF_RANGE if the data extends past the end of the
/// nvram.
strict Write(struct {
offset uint32;
data vector<uint8>:NVRAM_MAX;
}) -> () error zx.Status;
};