Struct lpc55_hal::drivers::usbd::UsbBus [−][src]
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
impl<USB> UsbBus<USB> where
USB: Usb<Enabled> + Send,
[src]
USB: Usb<Enabled> + Send,
pub fn new<PIN>(
usb_device: USB,
_usb0_vbus_pin: PIN
) -> UsbBusAllocator<UsbBus<USB>> where
PIN: Usb0VbusPin + Sync,
[src]
usb_device: USB,
_usb0_vbus_pin: PIN
) -> UsbBusAllocator<UsbBus<USB>> where
PIN: Usb0VbusPin + Sync,
Constructs a new USB peripheral driver.
pub fn clear_interrupt(&mut self)
[src]
Trait Implementations
impl<USB> UsbBus for UsbBus<USB> where
USB: Usb<Enabled> + Send,
[src]
USB: Usb<Enabled> + Send,
const QUIRK_SET_ADDRESS_BEFORE_STATUS: bool
[src]
fn alloc_ep(
&mut self,
ep_dir: UsbDirection,
ep_addr: Option<EndpointAddress>,
ep_type: EndpointType,
max_packet_size: u16,
_interval: u8
) -> Result<EndpointAddress>
[src]
&mut self,
ep_dir: UsbDirection,
ep_addr: Option<EndpointAddress>,
ep_type: EndpointType,
max_packet_size: u16,
_interval: u8
) -> Result<EndpointAddress>
fn enable(&mut self)
[src]
fn reset(&self)
[src]
fn set_device_address(&self, addr: u8)
[src]
fn poll(&self) -> PollResult
[src]
fn read(&self, ep_addr: EndpointAddress, buf: &mut [u8]) -> Result<usize>
[src]
fn write(&self, ep_addr: EndpointAddress, buf: &[u8]) -> Result<usize>
[src]
fn set_stalled(&self, ep_addr: EndpointAddress, stalled: bool)
[src]
fn is_stalled(&self, ep_addr: EndpointAddress) -> bool
[src]
fn suspend(&self)
[src]
fn resume(&self)
[src]
pub fn force_reset(&self) -> Result<(), UsbError>
[src]
Auto Trait Implementations
impl<USB> Send for UsbBus<USB>
impl<USB> Sync for UsbBus<USB>
impl<USB> Unpin for UsbBus<USB> where
USB: Unpin,
USB: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,