跳转到内容

std.os.uefi.protocol.edid

标准库Zig 0.17.1官方原文
源码std/os/uefi/protocol/edid.zig

第 1 行

std.os.uefi.protocol.edid.Active

容器

第 9 行

活动视频输出设备的 EDID 信息

字段

size_of_edid: u32
edid: ?[*]u8

std.os.uefi.protocol.edid.Active.guid

常量

第 13 行

std.os.uefi.protocol.edid.cc

别名

第 6 行

别名目标 std.os.uefi.cc

std.os.uefi.protocol.edid.Discovered

容器

第 24 行

视频输出设备的 EDID 信息

字段

size_of_edid: u32
edid: ?[*]u8

std.os.uefi.protocol.edid.Discovered.guid

常量

第 28 行

std.os.uefi.protocol.edid.Guid

别名

第 3 行

别名目标 std.os.uefi.Guid

std.os.uefi.protocol.edid.Handle

别名

第 4 行

别名目标 std.os.uefi.Handle

std.os.uefi.protocol.edid.Override

容器

第 39 行

覆盖 EDID 信息

字段

_get_edid: *const fn (*const Override, *const Handle, *Attributes, *usize, *?[*]u8) callconv(cc) Status

std.os.uefi.protocol.edid.Override.Attributes

容器

第 77 行

字段

dont_override: bool
enable_hot_plug: bool
_pad: u30 = 0

std.os.uefi.protocol.edid.Override.Edid

容器

第 72 行

字段

attributes: Attributes
edid: ?[]u8

std.os.uefi.protocol.edid.Override.getEdid

函数

第 47 行

返回指定视频输出设备的策略信息,以及可能的替代 EDID。

pub fn getEdid(self: *const Override, handle: Handle) GetEdidError!Edid

参数

self: *const Override
handle: Handle

错误

Unexpected UnexpectedError
Unsupported

std.os.uefi.protocol.edid.Override.GetEdidError

错误集合

第 42 行

错误

Unexpected UnexpectedError
Unsupported

std.os.uefi.protocol.edid.Override.guid

常量

第 63 行

std.os.uefi.protocol.edid.Status

别名

第 5 行

别名目标 std.os.uefi.Status

std.os.uefi.protocol.edid.std

别名

第 1 行

别名目标 std

std.os.uefi.protocol.edid.uefi

别名

第 2 行

别名目标 std.os.uefi

源码

std/os/uefi/protocol/edid.zig

const std = @import("../../../std.zig");
const uefi = std.os.uefi;
const Guid = uefi.Guid;
const Handle = uefi.Handle;
const Status = uefi.Status;
const cc = uefi.cc;

/// 活动视频输出设备的 EDID 信息
pub const Active = extern struct {
    size_of_edid: u32,
    edid: ?[*]u8,

    pub const guid align(8) = Guid{
        .time_low = 0xbd8c1056,
        .time_mid = 0x9f36,
        .time_high_and_version = 0x44ec,
        .clock_seq_high_and_reserved = 0x92,
        .clock_seq_low = 0xa8,
        .node = [_]u8{ 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 },
    };
};

/// 视频输出设备的 EDID 信息
pub const Discovered = extern struct {
    size_of_edid: u32,
    edid: ?[*]u8,

    pub const guid align(8) = Guid{
        .time_low = 0x1c0c34f6,
        .time_mid = 0xd380,
        .time_high_and_version = 0x41fa,
        .clock_seq_high_and_reserved = 0xa0,
        .clock_seq_low = 0x49,
        .node = [_]u8{ 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa },
    };
};

/// 覆盖 EDID 信息
pub const Override = extern struct {
    _get_edid: *const fn (*const Override, *const Handle, *Attributes, *usize, *?[*]u8) callconv(cc) Status,

    pub const GetEdidError = uefi.UnexpectedError || error{
        Unsupported,
    };

    /// 返回指定视频输出设备的策略信息,以及可能的替代 EDID。
    pub fn getEdid(self: *const Override, handle: Handle) GetEdidError!Edid {
        var size: usize = undefined;
        var ptr: ?[*]u8 = undefined;
        var attributes: Attributes = undefined;
        switch (self._get_edid(self, &handle, &attributes, &size, &ptr)) {
            .success => {},
            .unsupported => return error.Unsupported,
            else => |status| return uefi.unexpectedStatus(status),
        }

        return .{
            .attributes = attributes,
            .edid = if (ptr) |p| p[0..size] else null,
        };
    }

    pub const guid align(8) = Guid{
        .time_low = 0x48ecb431,
        .time_mid = 0xfb72,
        .time_high_and_version = 0x45c0,
        .clock_seq_high_and_reserved = 0xa9,
        .clock_seq_low = 0x22,
        .node = [_]u8{ 0xf4, 0x58, 0xfe, 0x04, 0x0b, 0xd5 },
    };

    pub const Edid = struct {
        attributes: Attributes,
        edid: ?[]u8,
    };

    pub const Attributes = packed struct(u32) {
        dont_override: bool,
        enable_hot_plug: bool,
        _pad: u30 = 0,
    };
};