Skip to main content

PanelSpec

Struct PanelSpec 

Source
pub struct PanelSpec {
    pub name: String,
    pub meta: Meta,
    pub module: Module,
    pub screen: Screen,
    pub chip: Chip,
    pub color: Color,
    pub current: Current,
    pub timing: Timing,
    pub mapping: Mapping,
    pub boot: Boot,
    pub record01_overrides: BTreeMap<usize, u8>,
}

Fields§

§name: String

Name used for output files.

§meta: Meta

Where the values came from and how far they are trusted.

§module: Module§screen: Screen§chip: Chip§color: Color§current: Current§timing: Timing§mapping: Mapping§boot: Boot§record01_overrides: BTreeMap<usize, u8>

Raw record 0x01 byte overrides ("0x043" = 0x20), applied last. The bench spec’s +0x02F = 1 lives here; nothing displays without it.

Implementations§

Source§

impl PanelSpec

Source

pub fn load(path: impl AsRef<Path>) -> Result<Self>

Read a spec from a TOML file.

§Errors

Fails on a missing or malformed file.

Source

pub fn parse(text: &str) -> Result<Self>

Read a spec from TOML text.

§Errors

Fails on malformed TOML or an unknown field.

Source

pub fn to_toml(&self) -> Result<String>

The spec as TOML, tables in the order config/panels/*.toml use; parse reads it back to the same values.

§Errors

Fails when a value cannot be written as TOML.

Source

pub fn chip_library(&self, load: Loader<'_>) -> Result<ChipLibrary>

The spec’s chip library, with load mapping [chip].library to TOML text.

§Errors

Fails when load does, or on a malformed library.

Source

pub fn validate(&self) -> Result<()>

Check the spec against what the record can express.

§Errors

Rejects geometry the record cannot hold.

Source

pub fn serial_clock(&self, chip: &ChipLibrary) -> u16

The serial clock (record +0x021): the spec’s, else the chip’s default.

Source

pub fn gray_bits(&self, chip: &ChipLibrary) -> Result<u8>

Grayscale depth: the spec’s override, else the vendor’s derivation from the chip registers.

§Errors

Fails if the library lacks the registers the derivation reads.

Source

pub fn screen_extent_in_line_dir(&self) -> u16

The screen extent along the data-line direction (vendor GetMaxInLineDir, before void adjustments).

Source

pub fn module_input_count(&self) -> u8

Vendor GetModuleInputCount: the 16-pixel grid unit over the module dimension along the line direction, at least 1.

Source

pub fn modules_in_line_dir(&self) -> u16

Modules chained along the data-line direction (vendor GetModuleCountInLineDir): screen extent / module extent on that axis.

Source

pub fn one_scan_len(&self) -> u16

Clocks in one scan line (vendor GetOneScanLen): W x stored H / scan.

Source

pub fn card_scan_len(&self) -> u16

Clocks in one card scan line (vendor GetCardScanLen): OneScanLen scaled by the modules along the line direction.

Trait Implementations§

Source§

impl Clone for PanelSpec

Source§

fn clone(&self) -> PanelSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PanelSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PanelSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PanelSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.