Skip to main content

ScdcTransport

Trait ScdcTransport 

Source
pub trait ScdcTransport {
    type Error;

    // Required methods
    async fn read(&self, reg: u8) -> Result<u8, Self::Error>;
    async fn write(&mut self, reg: u8, value: u8) -> Result<(), Self::Error>;

    // Provided method
    async fn read_block(
        &self,
        reg: u8,
        buf: &mut [u8],
    ) -> Result<(), Self::Error> { ... }
}
Expand description

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.

This is the async counterpart to hdmi_hal::scdc::ScdcTransport. The trait contract is identical; only the method signatures gain async.

SCDC is a bidirectional channel used for FRL link training initiation, scrambling control, and CED (Character Error Detection) reporting. Any code that needs to touch the SCDC register map does so through this trait.

The trait operates at the raw register level: a one-byte address and a one-byte value. Typed register wrappers, named constants, and multi-register sequences belong in the protocol crate, not here.

Required Associated Types§

Source

type Error

Error type returned by transport operations.

Required Methods§

Source

async fn read(&self, reg: u8) -> Result<u8, Self::Error>

Read a single byte from the given SCDC register address.

Source

async fn write(&mut self, reg: u8, value: u8) -> Result<(), Self::Error>

Write a single byte to the given SCDC register address.

Provided Methods§

Source

async fn read_block(&self, reg: u8, buf: &mut [u8]) -> Result<(), Self::Error>

Read consecutive SCDC registers, starting at reg, into buf.

The default implementation calls read once per byte, stopping at the first error. Transports that can read several bytes in one DDC/I²C transaction should override it, so that related registers (such as the status flags or the character error counters) are read together rather than one at a time while the sink may be updating them. A read past register 0xFF is not meaningful; the default implementation wraps the address to 0x00.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§