embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Config

Struct Config 

Source
pub struct Config<'d> {
    pub max_packet_size: u16,
    pub min_width: u32,
    pub max_width: u32,
    pub min_height: u32,
    pub max_height: u32,
    pub max_buffer_size: u32,
    pub formats: &'d [PixelFormat],
    pub supported_rotations: u8,
    pub connectors: &'d [GudConnector<'d>],
    pub validate_mode_blocking: fn(connector: u8, mode: &DisplayMode) -> bool,
}
Expand description

Static class driver configuration passed to GudClass::new.

This configuration is fixed when the class is created.

Fields§

§max_packet_size: u16

Maximum packet size for the bulk OUT endpoint: 8..=64 for full-speed, 512 for high-speed.

§min_width: u32

Minimum framebuffer width the device handles.

§max_width: u32

Maximum framebuffer width.

§min_height: u32

Minimum framebuffer height.

§max_height: u32

Maximum framebuffer height.

§max_buffer_size: u32

Maximum size in bytes of one damage rectangle. 0 means no cap. Does not have to fit in memory, it can be streamed chunk by chunk.

§formats: &'d [PixelFormat]

Supported pixel formats, 1..=GUD_FORMATS_MAX_NUM.

§supported_rotations: u8

ROTATION_* bitmask; 0 omits the rotation property entirely.

§connectors: &'d [GudConnector<'d>]

Connectors, 1..=GUD_CONNECTORS_MAX_NUM. Index order is the index the host uses in wValue and SET_STATE_CHECK.

§validate_mode_blocking: fn(connector: u8, mode: &DisplayMode) -> bool

Validate a mode for the given connector index during SET_STATE_CHECK.

Implementations§

Source§

impl Config<'_>

Source

pub fn control_buf_len(&self) -> usize

Minimum control buffer length for this configuration.

Takes the max over all control transfers.

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for Config<'d>

§

impl<'d> !UnwindSafe for Config<'d>

§

impl<'d> Freeze for Config<'d>

§

impl<'d> Send for Config<'d>

§

impl<'d> Sync for Config<'d>

§

impl<'d> Unpin for Config<'d>

§

impl<'d> UnsafeUnpin for Config<'d>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.