embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Config

Struct Config 

Source
pub struct Config<'d> {
    pub formats: &'d [Format<'d>],
    pub max_packet_size: u16,
    pub transport: StreamTransport,
    pub processing_controls: ProcessingControls,
    pub camera_controls: CameraControls,
    pub still: Option<StillConfig<'d>>,
}
Expand description

Everything the camera advertises to the host.

Fields§

§formats: &'d [Format<'d>]

The formats the camera streams, at least one and at most 16. The host numbers them from one, in this order. The first is the default.

§max_packet_size: u16

Packet size of the VideoStreaming endpoint in bytes, including the payload header.

§transport: StreamTransport

VideoStreaming transport (Isochronous by default).

§processing_controls: ProcessingControls

Optional Processing Unit (VC_PROCESSING_UNIT) controls.

§camera_controls: CameraControls

Optional Camera Terminal (ITT_CAMERA) controls.

§still: Option<StillConfig<'d>>

Optional Method 2 still image capture configuration.

Implementations§

Source§

impl<'d> Config<'d>

Source

pub const fn new(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self

Creates an isochronous UVC 1.5 camera configuration with the largest packet size for speed.

Source

pub const fn bulk(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self

Creates a bulk UVC 1.5 camera configuration with the largest bulk packet size for speed.

Source

pub const fn with_transport( formats: &'d [Format<'d>], transport: StreamTransport, speed: UsbDeviceSpeed, ) -> Self

Creates a UVC 1.5 camera configuration for the given transport and speed.

Source

pub const fn with_processing_controls( self, controls: ProcessingControls, ) -> Self

Configures Processing Unit (VC_PROCESSING_UNIT) controls.

Source

pub const fn with_camera_controls(self, controls: CameraControls) -> Self

Configures Camera Terminal (ITT_CAMERA) controls.

Source

pub const fn with_still(self, still: StillConfig<'d>) -> Self

Enables Method 2 still image capture.

Trait Implementations§

Source§

impl<'d> Clone for Config<'d>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'d> Forget for Config<'d>

§

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

§

impl<'d> Move for Config<'d>

§

impl<'d> RefUnwindSafe 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>

§

impl<'d> UnwindSafe 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, !>

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.