Struct rp2040_pac2::usb::Usb[][src]

pub struct Usb(pub *mut u8);

USB FS/LS controller device registers

Implementations

impl Usb[src]

pub fn addr_endp(self) -> Reg<AddrEndp, RW>[src]

Device address and endpoint control

pub fn main_ctrl(self) -> Reg<MainCtrl, RW>[src]

Main control register

pub fn sof_wr(self) -> Reg<SofWr, RW>[src]

Set the SOF (Start of Frame) frame number in the host controller. The SOF packet is sent every 1ms and the host will increment the frame number by 1 each time.

pub fn sof_rd(self) -> Reg<SofRd, RW>[src]

Read the last SOF (Start of Frame) frame number seen. In device mode the last SOF received from the host. In host mode the last SOF sent by the host.

pub fn sie_ctrl(self) -> Reg<SieCtrl, RW>[src]

SIE control register

pub fn sie_status(self) -> Reg<SieStatus, RW>[src]

SIE status register

pub fn int_ep_ctrl(self) -> Reg<IntEpCtrl, RW>[src]

interrupt endpoint control register

pub fn buff_status(self) -> Reg<BuffStatus, RW>[src]

Buffer status register. A bit set here indicates that a buffer has completed on the endpoint (if the buffer interrupt is enabled). It is possible for 2 buffers to be completed, so clearing the buffer status bit may instantly re set it on the next clock cycle.

pub fn buff_cpu_should_handle(self) -> Reg<BuffCpuShouldHandle, RW>[src]

Which of the double buffers should be handled. Only valid if using an interrupt per buffer (i.e. not per 2 buffers). Not valid for host interrupt endpoint polling because they are only single buffered.

pub fn ep_abort(self) -> Reg<EpAbort, RW>[src]

Device only: Can be set to ignore the buffer control register for this endpoint in case you would like to revoke a buffer. A NAK will be sent for every access to the endpoint until this bit is cleared. A corresponding bit in EP_ABORT_DONE is set when it is safe to modify the buffer control register.

pub fn ep_abort_done(self) -> Reg<EpAbortDone, RW>[src]

Device only: Used in conjunction with EP_ABORT. Set once an endpoint is idle so the programmer knows it is safe to modify the buffer control register.

pub fn ep_stall_arm(self) -> Reg<EpStallArm, RW>[src]

Device: this bit must be set in conjunction with the STALL bit in the buffer control register to send a STALL on EP0. The device controller clears these bits when a SETUP packet is received because the USB spec requires that a STALL condition is cleared when a SETUP packet is received.

pub fn nak_poll(self) -> Reg<NakPoll, RW>[src]

Used by the host controller. Sets the wait time in microseconds before trying again if the device replies with a NAK.

pub fn ep_status_stall_nak(self) -> Reg<EpStatusStallNak, RW>[src]

Device: bits are set when the IRQ_ON_NAK or IRQ_ON_STALL bits are set. For EP0 this comes from SIE_CTRL. For all other endpoints it comes from the endpoint control register.

pub fn usb_muxing(self) -> Reg<UsbMuxing, RW>[src]

Where to connect the USB controller. Should be to_phy by default.

pub fn usb_pwr(self) -> Reg<UsbPwr, RW>[src]

Overrides for the power signals in the event that the VBUS signals are not hooked up to GPIO. Set the value of the override and then the override enable to switch over to the override value.

pub fn usbphy_direct(self) -> Reg<UsbphyDirect, RW>[src]

This register allows for direct control of the USB phy. Use in conjunction with usbphy_direct_override register to enable each override bit.

pub fn usbphy_direct_override(self) -> Reg<UsbphyDirectOverride, RW>[src]

Override enable for each control in usbphy_direct

pub fn usbphy_trim(self) -> Reg<UsbphyTrim, RW>[src]

Used to adjust trim values of USB phy pull down resistors.

pub fn intr(self) -> Reg<Int, RW>[src]

Raw Interrupts

pub fn inte(self) -> Reg<Int, RW>[src]

Interrupt Enable

pub fn intf(self) -> Reg<Int, RW>[src]

Interrupt Force

pub fn ints(self) -> Reg<Int, RW>[src]

Interrupt status after masking & forcing

pub fn addr_endp_x(self, n: usize) -> Reg<AddrEndpX, RW>[src]

Interrupt endpoint 1. Only valid for HOST mode.

Trait Implementations

impl Clone for Usb[src]

impl Copy for Usb[src]

impl Send for Usb[src]

impl Sync for Usb[src]

Auto Trait Implementations

impl Unpin for Usb

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.