blob: f3752ff26b944dc2f387c37a7ac2cf9bc93c22b4 [file] [log] [blame]
// Copyright 2019 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.dotmatrixdisplay;
using zx;
/// This describes the format for each pixel in the screen.
type PixelFormat = strict enum : uint32 {
/// Pixels have on or off value (0 or 1). There is one bit per pixel.
MONOCHROME = 0;
};
/// Describes the layout of the pixels within the screen vector.
type ScreenLayout = strict enum : uint32 {
/// The vector is laid out with columns top-to-bottom. The columns
/// are organized into rows that go left-to-right.
COLUMN_TB_ROW_LR = 0;
/// The vector is laid out with rows left-to-right. The rows
/// are organized into columns that go top-to-bottom.
ROW_LR_COLUMN_TB = 1;
};
type DotmatrixDisplayConfig = struct {
/// The screen's width in pixels.
width uint32;
/// The screen's height in pixels.
height uint32;
format PixelFormat;
layout ScreenLayout;
};
/// Protocol for Dotmatrix display drivers. A Dotmatrix display is any
/// externally connected display that is written to pixel by pixel. These are
/// typically connected to over USB, I2C, or SPI, and they have a small number
/// of pixels. The display could be monochromatic or have RGB values. This
/// protocol is NOT for a display with lots of pixels or extra hardware like an
/// HDMI or DP display.
@transport("Banjo")
@banjo_layout("ddk-protocol")
protocol DotmatrixDisplay {
/// Get the configuration to display the screen.
GetConfig() -> (struct {
config DotmatrixDisplayConfig;
});
/// Set the screen memory. Calling this function will update the display.
SetScreen(struct {
screen_buffer vector<uint8>:MAX;
}) -> (struct {
s zx.status;
});
};