display_types/displayid/mod.rs
1//! Types decoded from DisplayID 1.x extension blocks (EDID extension tag `0x70`).
2
3/// DisplayID 1.x data block tag constants.
4pub mod tag;
5
6/// DisplayID 1.x display product primary use case constants.
7pub mod product_type;
8
9/// Rich capabilities extracted from a DisplayID 1.x extension section.
10///
11/// Stored in `DisplayCapabilities` via `set_extension_data(0x70, ...)` by the dynamic
12/// pipeline; retrieve with `caps.get_extension_data::<DisplayIdCapabilities>(0x70)`.
13#[non_exhaustive]
14#[cfg(any(feature = "alloc", feature = "std"))]
15#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
16#[derive(Debug, Clone, PartialEq, Eq)]
17pub struct DisplayIdCapabilities {
18 /// DisplayID version byte (0x10–0x1F for v1.x, 0x20 for v2.x).
19 pub version: u8,
20 /// Display product primary use case (bits 2:0 of header byte 3).
21 pub product_type: u8,
22}
23
24#[cfg(any(feature = "alloc", feature = "std"))]
25impl DisplayIdCapabilities {
26 /// Constructs a `DisplayIdCapabilities`.
27 pub fn new(version: u8, product_type: u8) -> Self {
28 Self {
29 version,
30 product_type,
31 }
32 }
33}