plumbob_async/lib.rs
1//! Async FRL link training state machine for HDMI 2.1.
2//!
3//! `plumbob-async` is the async companion to [`plumbob`]. Its [`FrlTrainer`] runs
4//! plumbob's state machine, [`plumbob::lts::run`], over an async [`ScdcClient`] and an
5//! async `HdmiPhy`, so sync and async training are the same procedure. All shared
6//! protocol and training types are re-exported from `plumbob`.
7//!
8//! The futures of the plain traits are not required to be `Send`. To spawn training on a
9//! multi-threaded executor from code generic over the client and PHY, implement their
10//! `Send` twins, [`SendScdcClient`] and [`SendHdmiPhy`]; every twin is also an
11//! implementation of the plain trait.
12//!
13//! # Features
14//!
15//! - **`alloc`** — enables `TrainingTrace`, `FrlTrainer::train_traced` and
16//! `FrlTrainer::train_at_rate_traced`.
17//! - **`std`** — implies `alloc`; no additional API surface.
18
19#![no_std]
20#![forbid(unsafe_code)]
21#![deny(missing_docs)]
22#![allow(async_fn_in_trait)]
23
24#[cfg(feature = "alloc")]
25extern crate alloc;
26
27mod client;
28mod trainer;
29
30pub use client::{ScdcClient, SendScdcClient};
31pub use trainer::FrlTrainer;
32
33pub use plumbob::{
34 CedCount, CedCounters, ClearableUpdateFlags, ExitError, FallbackReason, FfeLevels, FrlConfig,
35 LtpReq, LtpRequests, MAX_WARNINGS, SourceTestConfig, TmdsExit, Trained, TrainingConfig,
36 TrainingError, TrainingEvent, TrainingOutcome, TrainingWarning, UpdateFlags,
37};
38
39#[cfg(feature = "alloc")]
40pub use plumbob::TrainingTrace;
41
42// The FRL rate and the async PHY interface `FrlTrainer` drives (and its `Send` twin),
43// re-exported from `hdmi-hal-async` so that callers and PHY implementations use the same
44// versions plumbob-async does without depending on that crate themselves. A plain comment:
45// a doc comment here would head the inlined documentation of every item re-exported.
46pub use hdmi_hal_async::phy::{HdmiPhy, SendHdmiPhy};
47pub use hdmi_hal_async::{
48 EqParams, FrlOutput, HdmiForumFrl, LaneEqParams, LanePatterns, LtpPattern, TxFfeLevel,
49 TxFfeRestrictions,
50};