embassy-usb-synopsys-otg

Crates

git

Versions

default

Flavors

Skip to main content

Bus

Struct Bus 

Source
pub struct Bus<'d, M = CriticalSectionRawMutex, D: DmaMode = Pio>
where M: SharedRawMutex,
{ /* private fields */ }
Expand description

USB bus.

Implementations§

Source§

impl<'d, M, D> Bus<'d, M, D>
where M: SharedRawMutex, D: DmaMode,

Source

pub fn phy_type(&self) -> PhyType

Returns the PHY type.

Source

pub fn core_soft_reset(&mut self)

Applies a DWC2 core soft reset.

Source

pub fn configure_as_device(&mut self)

Configures the PHY as a device.

Source

pub fn config_v1(&mut self)

Applies configuration specific to Core ID 0x0000_1100 and 0x0000_1200

Source

pub fn config_v2v3(&mut self)

Applies configuration specific to Core ID 0x0000_2000, 0x0000_2100, 0x0000_2300, 0x0000_3000 and 0x0000_3100

Source

pub fn config_v5(&mut self)

Applies configuration specific to Core ID 0x0000_5000

Source

pub fn init_device(&mut self)

Initialize the device core once before polling for events.

Source

pub fn deinit_device(&mut self)

Deinitialize the device.

Trait Implementations§

Source§

impl<'d, M, D> Bus for Bus<'d, M, D>
where M: SharedRawMutex, D: DmaMode,

Source§

async fn poll(&mut self) -> Event

Wait for a bus-related event. Read more
Source§

fn control_max_packet_size(&self) -> usize

Maximum packet size for the control pipe.
Source§

async fn control_data_out( &mut self, buf: &mut [u8], ) -> Result<usize, EndpointError>

Read a DATA OUT transfer into buf in response to a control write request. Read more
Source§

async fn control_data_in( &mut self, data: &[u8], needs_zlp: bool, ) -> Result<(), EndpointDisabledError>

Send a DATA IN transfer with data in response to a control read request. Read more
Source§

async fn control_accept(&mut self)

Accept a control request. Read more
Source§

async fn control_reject(&mut self)

Reject a control request. Read more
Source§

async fn control_accept_set_address(&mut self, addr: u8)

Accept SET_ADDRESS control and change bus address. Read more
Source§

async fn endpoint_set_stalled( &mut self, ep_addr: EndpointAddress, stalled: bool, )

Set or clear the STALL condition for an endpoint. Read more
Source§

fn endpoint_is_stalled(&mut self, ep_addr: EndpointAddress) -> bool

Get whether the STALL condition is set for an endpoint.
Source§

async fn endpoint_set_enabled( &mut self, ep_addr: EndpointAddress, enabled: bool, )

Enable or disable an endpoint. Read more
Source§

fn endpoint_is_enabled(&mut self, ep_addr: EndpointAddress) -> bool

Get whether an endpoint is enabled.
Source§

async fn enable(&mut self)

Enable the USB peripheral.
Source§

async fn disable(&mut self)

Disable and powers down the USB peripheral.
Source§

async fn remote_wakeup(&mut self) -> Result<(), Unsupported>

Initiate a remote wakeup of the host by the device. Read more
Source§

async fn force_reset(&mut self) -> Result<(), Unsupported>

Simulate a disconnect from the USB bus, causing the host to reset and re-enumerate the device. Read more

Auto Trait Implementations§

§

impl<'d, M = CriticalSectionRawMutex, D = Pio> !RefUnwindSafe for Bus<'d, M, D>

§

impl<'d, M = CriticalSectionRawMutex, D = Pio> !UnwindSafe for Bus<'d, M, D>

§

impl<'d, M, D> Forget for Bus<'d, M, D>

§

impl<'d, M, D> Freeze for Bus<'d, M, D>
where OtgInstance<'d, M, D>: Freeze, ControlPipe<'d, M, D>: Freeze,

§

impl<'d, M, D> Move for Bus<'d, M, D>

§

impl<'d, M, D> Send for Bus<'d, M, D>
where OtgInstance<'d, M, D>: Send, ControlPipe<'d, M, D>: Send,

§

impl<'d, M, D> Sync for Bus<'d, M, D>
where OtgInstance<'d, M, D>: Sync, ControlPipe<'d, M, D>: Sync,

§

impl<'d, M, D> Unpin for Bus<'d, M, D>
where OtgInstance<'d, M, D>: Unpin, ControlPipe<'d, M, D>: Unpin,

§

impl<'d, M, D> UnsafeUnpin for Bus<'d, M, D>
where OtgInstance<'d, M, D>: UnsafeUnpin, ControlPipe<'d, M, D>: UnsafeUnpin,

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.