Expand description
Async TMDS link bring-up for HDMI sources.
spiritlevel-async is the async companion to spiritlevel. It has no procedures of its
own: TmdsLink runs spiritlevel’s — bring-up, tear-down, the reconnect check and the
quick restore — over an async TmdsScdc, hdmi-hal-async’s TmdsPhy and Delay,
a Clock and an optional Cancel flag, .awaiting each operation. Sync and async
bring-up are one procedure, so they take the same steps and record the same
TmdsEvents given the same I/O.
The settings, outcomes and events are spiritlevel’s, re-exported here with the hdmi-hal-async types the API uses, so a caller or an implementation has one import path.
§Stopping a procedure
A running procedure is stopped through its cancel flag (TmdsLink::with_cancel),
never by dropping its future: a dropped future stops at whichever .await it was
suspended on and cannot run its tear-down. Each procedure’s documentation says what to
do after one.
§Send futures
The plain traits promise nothing about their futures. Each has a Send twin —
SendTmdsScdc, SendTmdsPhy, SendDelay — and in code bounded by the twins
alone, with a clock and a flag that are Send (and, for the _with_events forms, a
Send callback), every procedure’s future is Send, so it
can be spawned on a multi-threaded executor.
§Features
display-types(default) — spiritlevel’sFromconversions from display-types’HdmiForumSinkCapinto the sink facts.culvert-async—TmdsScdcfor culvert-async’s clientScdc<T>and a borrow of it, with errors in spiritlevel’sCulvertError.
Structs§
- Bring
UpConfig - Bring-up and quick-restore settings.
- Config
Error - What
BringUpConfig::validatefound: every problem, at least one. - Culvert
Error culvert-async - culvert’s error, as
TmdsScdcforculvert::Scdc<T>returns it. - Failed
Read - A failed read of the check, and when it came.
- Hdmi
Forum Sink Cap display-types - The sink capabilities the sink facts convert from, re-exported from display-types.
Decoded HDMI Forum Sink Capability Data Block (HF-SCDB, extended tag
0x79). - LinkUp
- A link that is up: steps up to the output’s start completed. Whether the sink reports scrambling is the check’s, part of the outcome rather than a condition of it.
- NoCancel
- Never cancels.
- Restored
- A quick restore that ran to its end.
- Scdc
culvert-async - Async typed client for the HDMI 2.1 SCDC (Status and Control Data Channel) register map.
- Scrambling
Check - What the scrambling check found, and how.
- Scrambling
Off - Every condition that keeps a 1/10 link unscrambled.
- Scrambling
Status - What the sink reports in
Scrambling_Status(SCDC offset 0x21): whether it detects scrambled TMDS, and the byte that was read. - Sink
Tmds Config - The two fields of the sink’s
TMDS_Config(SCDC offset 0x20): what is written, and what a read decodes to. - Sink
Tmds Facts - What the sink declares about TMDS scrambling.
- Source
Tmds Facts - What the source’s PHY can do.
- Tear
Down Config - Tear-down settings.
- Tear
Down Error - A tear-down in which at least one PHY step failed. Every step was still attempted, so a failed scrambler call does not leave the output running; each field holds the first failure of its step.
- Timestamp
- A point in time: microseconds from an arbitrary monotonic epoch.
- Tmds
Config Reading - What a read of the sink’s
TMDS_Configreturned: the two fields the SCDC implementation decoded, and the byte as read, reserved bits included, so a sink that sets them stays visible to a diagnostic tool. - Tmds
Event - One step or decision of a procedure, stamped by the procedure from its own clock.
- Tmds
Link - The TMDS procedures over async parts: the sink’s SCDC, the PHY, a clock and a delay, and a
cancel flag (
NoCancelunlesswith_cancelgives one). - Tmds
Link Params - The chosen TMDS link: clock ratio, scrambling, and the sink’s
TMDS_Config. - Tmds
PhyCapabilities - The PHY value types, at the paths
hdmi-halgives them (hdmi_hal::phy::*). They are re-exported at the crate root as well. What a TMDS PHY can do, asTmdsPhy::capabilitiesreports it. - Tmds
PhyConfig - The PHY value types, at the paths
hdmi-halgives them (hdmi_hal::phy::*). They are re-exported at the crate root as well. WhatTmdsPhy::configuresets. - Tmds
Policy - The caller’s choices where HDMI sources differ.
- Tmds
Video - The PHY value types, at the paths
hdmi-halgives them (hdmi_hal::phy::*). They are re-exported at the crate root as well. The video a TMDS link carries, as far as a PHY may need it. - Torn
Down - A tear-down in which every PHY step succeeded: the output is stopped.
- Warnings
- The warnings a bring-up gathered, in the order they arose. Fixed storage, so no
alloc, and never full: each kind occurs at most once.
Enums§
- Bring
UpError - Why a bring-up stopped.
- Bring
UpOutcome - How a bring-up ended without an error.
- Bring
UpWarning - What went wrong without stopping a bring-up. Each kind occurs at most once per attempt.
- Cancel
Point - Where a bring-up saw the caller’s cancel flag.
- Check
Result - How the scrambling check ended.
- Cleanup
- What happened after a bring-up’s error or cancellation.
- Clear
Frl - Which sinks get the FRL clear (
Config_1andFLT_update) before a bring-up. - Clock
Ratio - The TMDS bit clock ratio, hdmi-hal’s
TmdsClockRatio: the TMDS clock runs at the bit rate divided by 10 or by 40. One type, so the link parameters pass straight toTmdsPhy::configure. The TMDS bit clock ratio, as the sink’sTMDS_Bit_Clock_Ratiobit selects it. - Color
BitDepth - The colour depth and format
phy::TmdsVideocarries; re-exported fromdisplay-typesso that implementations name the same types this crate does. Color bit depth per primary color channel, decoded from EDID base block byte0x14bits 6–4. - Color
Format - The colour depth and format
phy::TmdsVideocarries; re-exported fromdisplay-typesso that implementations name the same types this crate does. A single color encoding format, used to describe a specific negotiated or candidate configuration. - DdcError
Kind - The kind of a
DdcBusfailure. - FrlClear
Skip - Why the FRL clear before a bring-up was skipped.
- NoAcknowledge
Source - Which byte of a transaction was not acknowledged.
- OnTmds
Config Failure - What a failed
TMDS_Configwrite does to the bring-up. - Output
During Sink Write - Whether the output is stopped while the sink’s
TMDS_Configis written. - Output
State - Whether the output may be running. Exhaustive: it is stopped or it may not be.
- Params
Error - Why
TmdsLinkParams::chooserefused the inputs. - Protocol
Error culvert-async - What culvert refuses because it would violate the SCDC protocol.
- Reconnect
Check - What the reconnect check found.
- Restore
Error - A quick restore that stopped. Nothing is torn down: the link was running.
- Scdc
Error culvert-async - Errors returned by
Scdcregister operations. - Scrambler
Off - When the source’s scrambler is turned off in a tear-down, relative to the sink.
- Scrambling
Decision - Why the link is or is not scrambled.
- Scrambling
Threshold - Which TMDS character rate first requires scrambling and the 1/40 clock ratio.
- Sink
Clear - What became of the sink’s
TMDS_Configin a tear-down. - Sink
Clear Skip - Why a tear-down did not clear the sink’s
TMDS_Config. - Sink
Clear Timing - When the sink’s
TMDS_Configis cleared in a tear-down, relative to stopping the output. - Sink
Presence - Whether the sink is still there, as the caller knows from hotplug.
- Source
Version Skip - Why
Source_Versionwas not written. - Source
Version Write - When the source writes
Source_Versionbefore a bring-up. - Tmds
Config Gate - Which sinks get the
TMDS_Configwrite on a plain link. A scrambled link always writes it: the sink must be told. - Tmds
Config Skip - Why a bring-up did not write the sink’s
TMDS_Config. - Tmds
Config Write - How
TMDS_Configis written. - Tmds
Event Kind - What a procedure did, decided or saw.
- Tmds
Step - A step of a procedure, as an event or an error names it.
- Update
Error - The error of an SCDC operation made of a read and a write, saying which of them failed:
a read-modify-write of
TMDS_Config, or the clear ofFLT_update.
Constants§
- MAX_
BRING_ UP_ EVENTS - The most events one bring-up records: its start; two each for the FRL clear and
Source_Version; one for stopping the output; two for the sink’sTMDS_Config(the write and a plain link’s read-back); one for the PHY’s configuration; two for the scrambler (off, then on, when unscrambled output runs through the write); one each for the wait, the output’s start, the deadline, the scrambling check and a cancellation; the tear-down after an error or a cancellation (MAX_TEAR_DOWN_EVENTS); and its end. One more than any bring-up records: a plain link’s read-back and a scrambled link’s deadline and check never come together. - MAX_
QUICK_ RESTORE_ EVENTS - The most events one quick restore records: its start, one each for the sink’s write, the scrambler and the scrambling check, and its end.
- MAX_
RECONNECT_ CHECK_ EVENTS - The most events one reconnect check records: its start, the read (or its failure), and its end.
- MAX_
TEAR_ DOWN_ EVENTS - The most events one tear-down records: its start, one each for the sink, the scrambler and the output, and its end.
Traits§
- Cancel
- A flag the caller sets to ask a procedure to stop.
- Clock
- A monotonic clock.
- DdcError
- An error of a
DdcBus, classified. - Delay
- An async delay.
- Scdc
Transport culvert-async - The async transport
Scdc<T>is generic over, re-exported fromhdmi-hal-async. Async raw register access to the SCDC register map over DDC/I²C. - Send
Delay Delaywith aSendfuture, for procedures spawned on a multi-threaded executor.- Send
Scdc Transport culvert-async - The transport’s
Sendtwin, re-exported fromhdmi-hal-async: bound generic code by it to spawn work throughScdc<T>on a multi-threaded executor.ScdcTransportwithSendfutures, for code that spawns link training on a multi-threaded executor. - Send
Tmds Phy TmdsPhywithSendfutures, for code that spawns TMDS bring-up on a multi-threaded executor.- Send
Tmds Scdc TmdsScdcwithSendfutures, for code that spawns TMDS bring-up on a multi-threaded executor.- TmdsPhy
- Async TMDS control of an HDMI transmitter PHY.
- Tmds
Scdc - The sink’s SCDC registers, as the TMDS procedures use them, async.