blob: 1691f0ecb1d719d131d6210472aa80bd12702ac7 [file] [log] [blame] [edit]
// Copyright 2025 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.google.nanohub;
using zx;
/// Represents the various modes the MCU display can be in.
type DisplayMode = flexible enum : uint8 {
/// The display is not in a known state.
NONE = 0;
/// The MCU stack is driving the display initializing.
INIT = 1;
/// The display is off.
OFF = 2;
/// The display is in an idle, low-power state.
IDLE = 3;
/// The display is on.
ON = 4;
/// The display is in a high-brightness mode.
HIGH_BRIGHTNESS = 5;
};
/// Represents the current state of the MCU display.
type DisplayState = table {
/// The current mode of the display.
1: mode DisplayMode;
};
/// Contains synchronization information for the MCU display.
type DisplaySyncInfo = table {
/// The current mode of the display.
1: display_mode DisplayMode;
/// The current panel mode.
2: panel_mode uint8;
/// The normal brightness mode brightness level.
3: normal_brightness uint16;
/// The always-on-display brightness level.
4: always_on_display_brightness uint16;
};
/// Selects which processor has ownership of the display.
type DisplaySelect = flexible enum : int64 {
/// The MCU (Microcontroller Unit) has control of the display. This
/// corresponds to a low signal on the display select GPIO pin.
LOW = 0;
/// The AP (Application Processor) has control of the display. This
/// corresponds to a high signal on the display select GPIO pin.
HIGH = 1;
};
/// Protocol for interacting with the Google-specific display hardware.
@discoverable
closed protocol DisplayDevice {
/// Gets the current state of the display.
strict GetDisplayState() -> (DisplayState) error zx.Status;
/// Gets synchronization information for the display. This can include
/// the display's mode, panel mode, and brightness levels.
strict GetDisplayInfo() -> (DisplaySyncInfo) error zx.Status;
/// Gets the current display owner, which is either the AP (Application
/// Processor) or the MCU (Microcontroller Unit).
strict GetDisplaySelect() -> (table {
1: display_select DisplaySelect;
}) error zx.Status;
/// Sets the display owner to be either the AP (Application Processor) or
/// the MCU (Microcontroller Unit).
strict SetDisplaySelect(table {
1: display_select DisplaySelect;
}) -> () error zx.Status;
};
/// The service that provides access to the display device.
service DisplayService {
/// The display device.
mcudisplay client_end:DisplayDevice;
};