blob: 3d645aad465a738aa47dad3a6d63f0a0e5c8144a [file] [log] [blame]
// Copyright 2018 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.rtc;
using zx;
type Time = struct {
seconds uint8;
minutes uint8;
hours uint8;
day uint8;
month uint8;
year uint16;
};
protocol Device {
/// Get the current RTC time.
/// If the driver detects that it does not have a valid time to report, then it will return an
/// `ZX_ERR_INTERNAL` error.
Get() -> (struct {
rtc Time;
}) error zx.Status;
/// Set the RTC time.
/// If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.
Set(struct {
rtc Time;
}) -> (struct {
status zx.Status;
});
};