pub struct FrlTrainer<C, P> { /* private fields */ }Expand description
The central async training type. Owns an async ScdcClient and an async HdmiPhy.
The async counterpart to plumbob::FrlTrainer: it runs plumbob’s state machine,
plumbob::lts::run, awaiting each SCDC and PHY operation, so it yields to the
executor wherever the I/O waits. Reusable across training attempts; use
into_parts to recover the SCDC client and PHY.
§Cancellation
train is not cancel-safe. Dropping its future — a select! against
a hot-unplug, a timeout — stops training wherever it is: the sink may be configured
for an FRL rate and the PHY driving training patterns, and no LTS:L runs, since a
future cannot await anything once dropped. Call exit_to_tmds
afterwards to return both ends to TMDS. Bounding training is better left to the poll
limits in TrainingConfig, which end every attempt in a defined state.
Implementations§
Source§impl<C: ScdcClient, P: HdmiPhy> FrlTrainer<C, P>
impl<C: ScdcClient, P: HdmiPhy> FrlTrainer<C, P>
Sourcepub fn new(scdc: C, phy: P) -> Self
pub fn new(scdc: C, phy: P) -> Self
Constructs a new FrlTrainer owning the given async SCDC client and PHY.
Sourcepub fn into_parts(self) -> (C, P)
pub fn into_parts(self) -> (C, P)
Consumes the trainer and returns the SCDC client and PHY.
Sourcepub fn phy_mut(&mut self) -> &mut P
pub fn phy_mut(&mut self) -> &mut P
The PHY, mutably: after Success, for example, to start video with
set_frl_output(FrlOutput::Active).
Sourcepub async fn exit_to_tmds(
&mut self,
) -> Result<(), ExitError<C::Error, P::Error>>
pub async fn exit_to_tmds( &mut self, ) -> Result<(), ExitError<C::Error, P::Error>>
LTS:L on demand: stops the training patterns, returns the PHY to TMDS, turns FRL
off in Config_1 and clears FLT_update if it is set.
The async counterpart to plumbob::FrlTrainer::exit_to_tmds: for taking an FRL
link down when the display is disabled or unplugged, before a mode change, after
an error that did not lead to LTS:L (TmdsExit::Skipped or HeldUnderTest), and
after a dropped
train future (see Cancellation). Safe to call
in any state, and again. Every step is attempted even when one fails.
Sourcepub async fn train_at_rate(
&mut self,
rate: HdmiForumFrl,
config: &TrainingConfig,
) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
pub async fn train_at_rate( &mut self, rate: HdmiForumFrl, config: &TrainingConfig, ) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
Trains at a single rate: train(&[rate], config).
Sourcepub async fn train(
&mut self,
rates: &[HdmiForumFrl],
config: &TrainingConfig,
) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
pub async fn train( &mut self, rates: &[HdmiForumFrl], config: &TrainingConfig, ) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
Trains over rates in order, stepping down when the sink requests it.
The async counterpart to plumbob::FrlTrainer::train, with the same outcomes and
errors. Not cancel-safe: see Cancellation.
Sourcepub async fn train_with_events<F: FnMut(TrainingEvent)>(
&mut self,
rates: &[HdmiForumFrl],
config: &TrainingConfig,
record: &mut F,
) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
pub async fn train_with_events<F: FnMut(TrainingEvent)>( &mut self, rates: &[HdmiForumFrl], config: &TrainingConfig, record: &mut F, ) -> Result<Trained, TrainingError<<C as ScdcClient>::Error, <P as HdmiPhy>::Error>>
Like train, calling record with each TrainingEvent as it
occurs: the events train_traced (with alloc) collects, without an
allocator. record is a plain callback; it is called between I/O operations, never
while one is awaited.