pub struct Usb { /* private fields */ }
Expand description
USB FS/LS controller device registers
Implementations§
source§impl Usb
impl Usb
pub const unsafe fn from_ptr(ptr: *mut ()) -> Self
pub const fn as_ptr(&self) -> *mut ()
sourcepub const fn addr_endp_x(self, n: usize) -> Reg<AddrEndpX, RW>
pub const fn addr_endp_x(self, n: usize) -> Reg<AddrEndpX, RW>
Interrupt endpoint 1. Only valid for HOST mode.
sourcepub const fn sof_wr(self) -> Reg<SofWr, RW>
pub const fn sof_wr(self) -> Reg<SofWr, RW>
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.
sourcepub const fn sof_rd(self) -> Reg<SofRd, RW>
pub const fn sof_rd(self) -> Reg<SofRd, RW>
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.
sourcepub const fn sie_status(self) -> Reg<SieStatus, RW>
pub const fn sie_status(self) -> Reg<SieStatus, RW>
SIE status register
sourcepub const fn int_ep_ctrl(self) -> Reg<IntEpCtrl, RW>
pub const fn int_ep_ctrl(self) -> Reg<IntEpCtrl, RW>
interrupt endpoint control register
sourcepub const fn buff_status(self) -> Reg<BuffStatus, RW>
pub const fn buff_status(self) -> Reg<BuffStatus, RW>
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.
sourcepub const fn buff_cpu_should_handle(self) -> Reg<BuffCpuShouldHandle, RW>
pub const fn buff_cpu_should_handle(self) -> Reg<BuffCpuShouldHandle, RW>
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.
sourcepub const fn ep_abort(self) -> Reg<EpAbort, RW>
pub const fn ep_abort(self) -> Reg<EpAbort, RW>
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.
sourcepub const fn ep_abort_done(self) -> Reg<EpAbortDone, RW>
pub const fn ep_abort_done(self) -> Reg<EpAbortDone, RW>
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.
sourcepub const fn ep_stall_arm(self) -> Reg<EpStallArm, RW>
pub const fn ep_stall_arm(self) -> Reg<EpStallArm, RW>
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.
sourcepub const fn nak_poll(self) -> Reg<NakPoll, RW>
pub const fn nak_poll(self) -> Reg<NakPoll, RW>
Used by the host controller. Sets the wait time in microseconds before trying again if the device replies with a NAK.
sourcepub const fn ep_status_stall_nak(self) -> Reg<EpStatusStallNak, RW>
pub const fn ep_status_stall_nak(self) -> Reg<EpStatusStallNak, RW>
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.
sourcepub const fn usb_muxing(self) -> Reg<UsbMuxing, RW>
pub const fn usb_muxing(self) -> Reg<UsbMuxing, RW>
Where to connect the USB controller. Should be to_phy by default.
sourcepub const fn usb_pwr(self) -> Reg<UsbPwr, RW>
pub const fn usb_pwr(self) -> Reg<UsbPwr, RW>
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 so switch over to the override value.
sourcepub const fn usbphy_direct(self) -> Reg<UsbphyDirect, RW>
pub const fn usbphy_direct(self) -> Reg<UsbphyDirect, RW>
Note that most functions are driven directly from usb_fsls controller. This register allows more detailed control/status from the USB PHY. Useful for debug but not expected to be used in normal operation Use in conjunction with usbphy_direct_override register
pub const fn usbphy_direct_override(self) -> Reg<UsbphyDirectOverride, RW>
sourcepub const fn usbphy_trim(self) -> Reg<UsbphyTrim, RW>
pub const fn usbphy_trim(self) -> Reg<UsbphyTrim, RW>
Note that most functions are driven directly from usb_fsls controller. This register allows more detailed control/status from the USB PHY. Useful for debug but not expected to be used in normal operation
Trait Implementations§
impl Copy for Usb
impl Eq for Usb
impl Send for Usb
impl StructuralPartialEq for Usb
impl Sync for Usb
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)