Struct lpc55_hal::drivers::usbd::UsbBus[][src]

pub struct UsbBus<USB> where
    USB: Usb<Enabled> + Send
{ /* fields omitted */ }
Expand description

Implements the usb_device::bus::UsbBus trait.

From that documentation:

The UsbBus is shared by reference between the global UsbDevice as well as UsbClasses, and therefore any required mutability must be implemented using interior mutability. Most operations that may mutate the bus object itself take place before enable is called. After the bus is enabled, in practice most access won’t mutate the object itself but only endpoint-specific registers and buffers, the access to which is mostly arbitrated by endpoint handles.

Warning: Currently, UsbBus uses the same USB1_SRAM memory region for both FS and HS peripherals, so it’s not possible to use both peripherals at the same time with this driver.

Implementations

Constructs a new USB peripheral driver.

Trait Implementations

Indicates that set_device_address must be called before accepting the corresponding control transfer, not after. Read more

Allocates an endpoint and specified endpoint parameters. This method is called by the device and class implementations to allocate endpoints, and can only be called before enable is called. Read more

Enables and initializes the USB peripheral. Soon after enabling the device will be reset, so there is no need to perform a USB reset in this method. Read more

Called when the host resets the device. This will be soon called after poll returns PollResult::Reset. This method should reset the state of all endpoints and peripheral flags back to a state suitable for enumeration, as well as ensure that all endpoints previously allocated with alloc_ep are initialized as specified. Read more

Sets the device USB address to addr.

Gets information about events and incoming data. Usually called in a loop or from an interrupt handler. See the PollResult struct for more information. Read more

Reads a single packet of data from the specified endpoint and returns the actual length of the packet. Read more

Writes a single packet of data to the specified endpoint and returns number of bytes actually written. Read more

Sets or clears the STALL condition for an endpoint. If the endpoint is an OUT endpoint, it should be prepared to receive data again. Read more

Gets whether the STALL condition is set for an endpoint.

Causes the USB peripheral to enter USB suspend mode, lowering power consumption and preparing to detect a USB wakeup event. This will be called after poll returns PollResult::Suspend. The device will continue be polled, and it shall return a value other than Suspend from poll when it no longer detects the suspend condition. Read more

Resumes from suspend mode. This may only be called after the peripheral has been previously suspended. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.