use display_types::cea861::hdmi_forum::HdmiForumFrl;
use crate::types::{FfeLevels, LtpRequests, SourceTestConfig};
#[cfg(feature = "alloc")]
use crate::training::TrainingConfig;
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TrainingEvent {
#[non_exhaustive]
SourceTestConfigRead {
config: SourceTestConfig,
},
#[non_exhaustive]
FltReady {
after_polls: u32,
},
#[non_exhaustive]
FltReadyTimeout {
polls: u32,
},
#[non_exhaustive]
RateConfigured {
rate: HdmiForumFrl,
ffe_levels: FfeLevels,
},
#[non_exhaustive]
LtpRequested {
requests: LtpRequests,
},
#[non_exhaustive]
FfeRaised {
lane: u8,
level: u8,
},
#[non_exhaustive]
UndefinedLtpRequest {
lane: u8,
value: u8,
in_use: bool,
},
#[non_exhaustive]
TrainingPassed {
after_polls: u32,
},
#[non_exhaustive]
RateLowered {
from: HdmiForumFrl,
to: HdmiForumFrl,
},
RatesExhausted,
#[non_exhaustive]
TrainingTimeout {
polls: u32,
},
FrlStartWithRetrain,
RetrainRequested,
#[non_exhaustive]
RetrainsExhausted {
retrains: u32,
},
#[non_exhaustive]
FrlStart {
after_polls: u32,
},
#[non_exhaustive]
FrlStartTimeout {
polls: u32,
},
#[non_exhaustive]
NoTimeoutCapReached {
polls: u32,
},
ExitedToTmds,
#[non_exhaustive]
ExitToTmdsFailed {
scdc: bool,
phy: bool,
},
}
#[cfg(feature = "alloc")]
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TrainingTrace {
pub rates: Vec<HdmiForumFrl>,
pub config: TrainingConfig,
pub events: Vec<TrainingEvent>,
}
#[cfg(feature = "alloc")]
impl TrainingTrace {
pub fn new(
rates: Vec<HdmiForumFrl>,
config: TrainingConfig,
events: Vec<TrainingEvent>,
) -> Self {
Self {
rates,
config,
events,
}
}
}