pub struct Scdc<T> { /* private fields */ }Expand description
Async typed client for the HDMI 2.1 SCDC (Status and Control Data Channel) register map.
Scdc<T> wraps an async ScdcTransport and exposes one typed async fn per register
group. It holds no protocol state; all sequencing logic belongs in the caller.
§Example
use culvert_async::Scdc;
use hdmi_hal_async::scdc::ScdcTransport;
struct StubTransport;
impl ScdcTransport for StubTransport {
type Error = core::convert::Infallible;
async fn read(&mut self, _reg: u8) -> Result<u8, Self::Error> { Ok(0) }
async fn write(&mut self, _reg: u8, _value: u8) -> Result<(), Self::Error> { Ok(()) }
}
let mut scdc = Scdc::new(StubTransport);
let sink_version = scdc.read_sink_version().await.unwrap();
scdc.write_source_version(1).await.unwrap();Implementations§
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Sourcepub async fn read_ced(&mut self) -> Result<CedCounters, ScdcError<T::Error>>
pub async fn read_ced(&mut self) -> Result<CedCounters, ScdcError<T::Error>>
Reads per-lane character error counts from ERR_DET registers (0x50–0x57).
Each lane’s counter is decoded from a low/high byte pair. The high byte’s
bit 7 is a validity flag; if it is not set the lane’s counter is None.
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Sourcepub async fn write_frl_config(
&mut self,
config: FrlConfig,
) -> Result<(), ScdcError<T::Error>>
pub async fn write_frl_config( &mut self, config: FrlConfig, ) -> Result<(), ScdcError<T::Error>>
Writes FRL training configuration to Config_0 (0x30).
Encodes FRL_Rate into bits[3:0], DSC_FRL_Max into bit[4], and
FFE_Levels into bits[7:5].
Sourcepub async fn read_status_flags(
&mut self,
) -> Result<StatusFlags, ScdcError<T::Error>>
pub async fn read_status_flags( &mut self, ) -> Result<StatusFlags, ScdcError<T::Error>>
Reads FRL status from Status_Flags_0 (0x40) and Status_Flags_1 (0x41).
Returns crate::ProtocolError::UnknownLtpReq if the sink reports an
LTP request value not defined by the HDMI 2.1 specification.
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Sourcepub async fn write_tmds_config(
&mut self,
config: TmdsConfig,
) -> Result<(), ScdcError<T::Error>>
pub async fn write_tmds_config( &mut self, config: TmdsConfig, ) -> Result<(), ScdcError<T::Error>>
Writes scrambling configuration to TMDS_Config (0x20).
Sets Scrambling_Enable (bit 0) and TMDS_Bit_Clock_Ratio (bit 1).
Sourcepub async fn read_scrambler_status(
&mut self,
) -> Result<ScramblerStatus, ScdcError<T::Error>>
pub async fn read_scrambler_status( &mut self, ) -> Result<ScramblerStatus, ScdcError<T::Error>>
Reads scrambler acknowledgement from Scrambler_Status (0x21).
Returns ScramblerStatus::scrambling_active set when the sink confirms
that TMDS scrambling is active (bit 0).
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Sourcepub async fn read_update_flags(
&mut self,
) -> Result<UpdateFlags, ScdcError<T::Error>>
pub async fn read_update_flags( &mut self, ) -> Result<UpdateFlags, ScdcError<T::Error>>
Reads update flags from Update_0 (0x10) and Update_1 (0x11).
Sourcepub async fn clear_update_flags(
&mut self,
flags: UpdateFlags,
) -> Result<(), ScdcError<T::Error>>
pub async fn clear_update_flags( &mut self, flags: UpdateFlags, ) -> Result<(), ScdcError<T::Error>>
Clears the specified update flags in Update_0 (0x10) and Update_1 (0x11).
Each flag set to true in flags is cleared (write-1-to-clear). Flags
set to false are left unchanged.
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Source§impl<T: ScdcTransport> Scdc<T>
impl<T: ScdcTransport> Scdc<T>
Sourcepub fn into_transport(self) -> T
pub fn into_transport(self) -> T
Consumes the client and returns the underlying transport.