Skip to main content

Crate spiritlevel_async

Crate spiritlevel_async 

Source
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’s From conversions from display-types’ HdmiForumSinkCap into the sink facts.
  • culvert-async — TmdsScdc for culvert-async’s client Scdc<T> and a borrow of it, with errors in spiritlevel’s CulvertError.

Structs§

BringUpConfig
Bring-up and quick-restore settings.
ConfigError
What BringUpConfig::validate found: every problem, at least one.
CulvertErrorculvert-async
culvert’s error, as TmdsScdc for culvert::Scdc<T> returns it.
FailedRead
A failed read of the check, and when it came.
HdmiForumSinkCapdisplay-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.
Scdcculvert-async
Async typed client for the HDMI 2.1 SCDC (Status and Control Data Channel) register map.
ScramblingCheck
What the scrambling check found, and how.
ScramblingOff
Every condition that keeps a 1/10 link unscrambled.
ScramblingStatus
What the sink reports in Scrambling_Status (SCDC offset 0x21): whether it detects scrambled TMDS, and the byte that was read.
SinkTmdsConfig
The two fields of the sink’s TMDS_Config (SCDC offset 0x20): what is written, and what a read decodes to.
SinkTmdsFacts
What the sink declares about TMDS scrambling.
SourceTmdsFacts
What the source’s PHY can do.
TearDownConfig
Tear-down settings.
TearDownError
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.
TmdsConfigReading
What a read of the sink’s TMDS_Config returned: 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.
TmdsEvent
One step or decision of a procedure, stamped by the procedure from its own clock.
TmdsLink
The TMDS procedures over async parts: the sink’s SCDC, the PHY, a clock and a delay, and a cancel flag (NoCancel unless with_cancel gives one).
TmdsLinkParams
The chosen TMDS link: clock ratio, scrambling, and the sink’s TMDS_Config.
TmdsPhyCapabilities
The PHY value types, at the paths hdmi-hal gives them (hdmi_hal::phy::*). They are re-exported at the crate root as well. What a TMDS PHY can do, as TmdsPhy::capabilities reports it.
TmdsPhyConfig
The PHY value types, at the paths hdmi-hal gives them (hdmi_hal::phy::*). They are re-exported at the crate root as well. What TmdsPhy::configure sets.
TmdsPolicy
The caller’s choices where HDMI sources differ.
TmdsVideo
The PHY value types, at the paths hdmi-hal gives 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.
TornDown
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§

BringUpError
Why a bring-up stopped.
BringUpOutcome
How a bring-up ended without an error.
BringUpWarning
What went wrong without stopping a bring-up. Each kind occurs at most once per attempt.
CancelPoint
Where a bring-up saw the caller’s cancel flag.
CheckResult
How the scrambling check ended.
Cleanup
What happened after a bring-up’s error or cancellation.
ClearFrl
Which sinks get the FRL clear (Config_1 and FLT_update) before a bring-up.
ClockRatio
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 to TmdsPhy::configure. The TMDS bit clock ratio, as the sink’s TMDS_Bit_Clock_Ratio bit selects it.
ColorBitDepth
The colour depth and format phy::TmdsVideo carries; re-exported from display-types so that implementations name the same types this crate does. Color bit depth per primary color channel, decoded from EDID base block byte 0x14 bits 6–4.
ColorFormat
The colour depth and format phy::TmdsVideo carries; re-exported from display-types so that implementations name the same types this crate does. A single color encoding format, used to describe a specific negotiated or candidate configuration.
DdcErrorKind
The kind of a DdcBus failure.
FrlClearSkip
Why the FRL clear before a bring-up was skipped.
NoAcknowledgeSource
Which byte of a transaction was not acknowledged.
OnTmdsConfigFailure
What a failed TMDS_Config write does to the bring-up.
OutputDuringSinkWrite
Whether the output is stopped while the sink’s TMDS_Config is written.
OutputState
Whether the output may be running. Exhaustive: it is stopped or it may not be.
ParamsError
Why TmdsLinkParams::choose refused the inputs.
ProtocolErrorculvert-async
What culvert refuses because it would violate the SCDC protocol.
ReconnectCheck
What the reconnect check found.
RestoreError
A quick restore that stopped. Nothing is torn down: the link was running.
ScdcErrorculvert-async
Errors returned by Scdc register operations.
ScramblerOff
When the source’s scrambler is turned off in a tear-down, relative to the sink.
ScramblingDecision
Why the link is or is not scrambled.
ScramblingThreshold
Which TMDS character rate first requires scrambling and the 1/40 clock ratio.
SinkClear
What became of the sink’s TMDS_Config in a tear-down.
SinkClearSkip
Why a tear-down did not clear the sink’s TMDS_Config.
SinkClearTiming
When the sink’s TMDS_Config is cleared in a tear-down, relative to stopping the output.
SinkPresence
Whether the sink is still there, as the caller knows from hotplug.
SourceVersionSkip
Why Source_Version was not written.
SourceVersionWrite
When the source writes Source_Version before a bring-up.
TmdsConfigGate
Which sinks get the TMDS_Config write on a plain link. A scrambled link always writes it: the sink must be told.
TmdsConfigSkip
Why a bring-up did not write the sink’s TMDS_Config.
TmdsConfigWrite
How TMDS_Config is written.
TmdsEventKind
What a procedure did, decided or saw.
TmdsStep
A step of a procedure, as an event or an error names it.
UpdateError
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 of FLT_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’s TMDS_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.
ScdcTransportculvert-async
The async transport Scdc<T> is generic over, re-exported from hdmi-hal-async. Async raw register access to the SCDC register map over DDC/I²C.
SendDelay
Delay with a Send future, for procedures spawned on a multi-threaded executor.
SendScdcTransportculvert-async
The transport’s Send twin, re-exported from hdmi-hal-async: bound generic code by it to spawn work through Scdc<T> on a multi-threaded executor. ScdcTransport with Send futures, for code that spawns link training on a multi-threaded executor.
SendTmdsPhy
TmdsPhy with Send futures, for code that spawns TMDS bring-up on a multi-threaded executor.
SendTmdsScdc
TmdsScdc with Send futures, for code that spawns TMDS bring-up on a multi-threaded executor.
TmdsPhy
Async TMDS control of an HDMI transmitter PHY.
TmdsScdc
The sink’s SCDC registers, as the TMDS procedures use them, async.