embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Ch34xDevice

Struct Ch34xDevice 

Source
pub struct Ch34xDevice<'d, A, M = NoopRawMutex>
where A: UsbHostAllocator<'d>, M: RawMutex,
{ /* private fields */ }
Expand description

CH34x device — owns the shared control pipe on endpoint 0.

Implementations§

Source§

impl<'d, A> Ch34xDevice<'d, A, NoopRawMutex>
where A: UsbHostAllocator<'d>,

Source

pub fn new(alloc: &A, enum_info: &EnumerationInfo) -> Result<Self, Ch34xError>

Allocate the device-level control pipe using a NoopRawMutex.

Source§

impl<'d, A, M> Ch34xDevice<'d, A, M>
where A: UsbHostAllocator<'d>, M: RawMutex,

Source

pub fn new_with_raw_mutex( alloc: &A, enum_info: &EnumerationInfo, ) -> Result<Self, Ch34xError>

Allocate the device-level control pipe using a caller-provided raw mutex.

Source

pub fn port<'dev>( &'dev self, config_desc: &[u8], interface_idx: u8, ) -> Result<Ch34xPort<'dev, 'd, A, M>, Ch34xError>

Open a UART port on the device.

Auto Trait Implementations§

§

impl<'d, A, M = NoopRawMutex> !Freeze for Ch34xDevice<'d, A, M>

§

impl<'d, A, M = NoopRawMutex> !RefUnwindSafe for Ch34xDevice<'d, A, M>

§

impl<'d, A, M> Forget for Ch34xDevice<'d, A, M>

§

impl<'d, A, M> Move for Ch34xDevice<'d, A, M>

§

impl<'d, A, M> Send for Ch34xDevice<'d, A, M>
where A: Send, Mutex<M, <A as UsbHostAllocator<'d>>::Pipe<Control, InOut>>: Send,

§

impl<'d, A, M> Sync for Ch34xDevice<'d, A, M>
where A: Sync, Mutex<M, <A as UsbHostAllocator<'d>>::Pipe<Control, InOut>>: Sync,

§

impl<'d, A, M> Unpin for Ch34xDevice<'d, A, M>
where A: Unpin, Mutex<M, <A as UsbHostAllocator<'d>>::Pipe<Control, InOut>>: Unpin,

§

impl<'d, A, M> UnsafeUnpin for Ch34xDevice<'d, A, M>

§

impl<'d, A, M> UnwindSafe for Ch34xDevice<'d, A, M>

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, !>

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.