Skip to main content

BusRead

Trait BusRead 

Source
pub trait BusRead: DisplayBus {
    // Provided method
    async fn read_data(
        &mut self,
        cmd: &[u8],
        params: &[u8],
        buffer: &mut [u8],
    ) -> Result<(), DisplayError<Self::Error>> { ... }
}
Expand description

An optional trait for buses that support reading data back from the display.

While most display interactions are write-only, reading is sometimes necessary for:

  • Verifying the connection by reading the display ID.
  • Checking status registers.
  • Reading back frame memory (e.g., for screenshots), though this is less common.

Not all physical interfaces support bi-directional communication (e.g., SPI TFT is often write-only).

Provided Methods§

Source

async fn read_data( &mut self, cmd: &[u8], params: &[u8], buffer: &mut [u8], ) -> Result<(), DisplayError<Self::Error>>

Reads data from the display.

§Arguments
  • cmd - The command to initiate the read operation.
  • params - Optional parameters required before the read transaction begins.
  • buffer - The destination buffer where the read data will be stored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§