blob: 378eb0caafc34a5727b56af1061483a6628a5312 [file] [log] [blame] [edit]
// 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;
};
closed 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.
strict 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.
strict Set(struct {
rtc Time;
}) -> (struct {
status zx.Status;
});
};