Skip to main content

Driver

Struct Driver 

Source
pub struct Driver<'d, T: Instance, const NR_EP: usize, const SIZE: usize> { /* private fields */ }

Implementations§

Source§

impl<'d, T, const NR_EP: usize, const SIZE: usize> Driver<'d, T, NR_EP, SIZE>
where T: Instance,

Source

pub fn new( _usb: Peri<'d, T>, dp: Peri<'d, impl Pin>, dm: Peri<'d, impl Pin>, ep_buffer: &'d mut [EndpointDataBuffer<SIZE>; NR_EP], ) -> Self

Source

pub fn new_with_config( _usb: Peri<'d, T>, dp: Peri<'d, impl Pin>, dm: Peri<'d, impl Pin>, ep_buffer: &'d mut [EndpointDataBuffer<SIZE>; NR_EP], config: Config, ) -> Self

Use this when board-level USB PHY or pull-up settings differ from the default 3.3 V setup.

Trait Implementations§

Source§

impl<'d, T: Instance, const NR_EP: usize, const SIZE: usize> Driver<'d> for Driver<'d, T, NR_EP, SIZE>

Source§

type EndpointOut = Endpoint<'d, T, Out, SIZE>

Type of the OUT endpoints for this driver.
Source§

type EndpointIn = Endpoint<'d, T, In, SIZE>

Type of the IN endpoints for this driver.
Source§

type ControlPipe = ControlPipe<'d, T, SIZE>

Type of the control pipe for this driver.
Source§

type Bus = Bus<'d, T>

Type for bus control for this driver.
Source§

fn alloc_endpoint_out( &mut self, config: &EndpointConfig, ) -> Result<Self::EndpointOut, EndpointAllocError>

Allocates an OUT endpoint. Read more
Source§

fn alloc_endpoint_in( &mut self, config: &EndpointConfig, ) -> Result<Self::EndpointIn, EndpointAllocError>

Allocates an IN endpoint. Read more
Source§

fn start(self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe)

Start operation of the USB device. Read more

Auto Trait Implementations§

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> !Send for Driver<'d, T, NR_EP, SIZE>

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> !Sync for Driver<'d, T, NR_EP, SIZE>

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> !UnwindSafe for Driver<'d, T, NR_EP, SIZE>

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> Freeze for Driver<'d, T, NR_EP, SIZE>

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> RefUnwindSafe for Driver<'d, T, NR_EP, SIZE>
where T: RefUnwindSafe,

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> Unpin for Driver<'d, T, NR_EP, SIZE>

§

impl<'d, T, const NR_EP: usize, const SIZE: usize> UnsafeUnpin for Driver<'d, T, NR_EP, SIZE>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.