Skip to main content

R

Struct R 

Source
pub struct R(/* private fields */);
Expand description

Register DEVCMDSTAT reader

Implementations§

Source§

impl R

Source

pub fn dev_addr(&self) -> DEV_ADDR_R

Bits 0:6 - USB device address. After bus reset, the address is reset to 0x00. If the enable bit is set, the device will respond on packets for function address DEV_ADDR. When receiving a SetAddress Control Request from the USB host, software must program the new address before completing the status phase of the SetAddress Control Request.

Source

pub fn dev_en(&self) -> DEV_EN_R

Bit 7 - USB device enable. If this bit is set, the HW will start responding on packets for function address DEV_ADDR.

Source

pub fn setup(&self) -> SETUP_R

Bit 8 - SETUP token received. If a SETUP token is received and acknowledged by the device, this bit is set. As long as this bit is set all received IN and OUT tokens will be NAKed by HW. SW must clear this bit by writing a one. If this bit is zero, HW will handle the tokens to the CTRL EP0 as indicated by the CTRL EP0 IN and OUT data information programmed by SW.

Source

pub fn force_needclk(&self) -> FORCE_NEEDCLK_R

Bit 9 - Forces the NEEDCLK output to always be on:

Source

pub fn lpm_sup(&self) -> LPM_SUP_R

Bit 11 - LPM Supported:

Source

pub fn intonnak_ao(&self) -> INTONNAK_AO_R

Bit 12 - Interrupt on NAK for interrupt and bulk OUT EP

Source

pub fn intonnak_ai(&self) -> INTONNAK_AI_R

Bit 13 - Interrupt on NAK for interrupt and bulk IN EP

Source

pub fn intonnak_co(&self) -> INTONNAK_CO_R

Bit 14 - Interrupt on NAK for control OUT EP

Source

pub fn intonnak_ci(&self) -> INTONNAK_CI_R

Bit 15 - Interrupt on NAK for control IN EP

Source

pub fn dcon(&self) -> DCON_R

Bit 16 - Device status - connect. The connect bit must be set by SW to indicate that the device must signal a connect. The pull-up resistor on USB_DP will be enabled when this bit is set and the VBUSDEBOUNCED bit is one.

Source

pub fn dsus(&self) -> DSUS_R

Bit 17 - Device status - suspend. The suspend bit indicates the current suspend state. It is set to 1 when the device hasn’t seen any activity on its upstream port for more than 3 milliseconds. It is reset to 0 on any activity. When the device is suspended (Suspend bit DSUS = 1) and the software writes a 0 to it, the device will generate a remote wake-up. This will only happen when the device is connected (Connect bit = 1). When the device is not connected or not suspended, a writing a 0 has no effect. Writing a 1 never has an effect.

Source

pub fn lpm_sus(&self) -> LPM_SUS_R

Bit 19 - Device status - LPM Suspend. This bit represents the current LPM suspend state. It is set to 1 by HW when the device has acknowledged the LPM request from the USB host and the Token Retry Time of 10 ms has elapsed. When the device is in the LPM suspended state (LPM suspend bit = 1) and the software writes a zero to this bit, the device will generate a remote walk-up. Software can only write a zero to this bit when the LPM_REWP bit is set to 1. HW resets this bit when it receives a host initiated resume. HW only updates the LPM_SUS bit when the LPM_SUPP bit is equal to one.

Source

pub fn lpm_rewp(&self) -> LPM_REWP_R

Bit 20 - LPM Remote Wake-up Enabled by USB host. HW sets this bit to one when the bRemoteWake bit in the LPM extended token is set to 1. HW will reset this bit to 0 when it receives the host initiated LPM resume, when a remote wake-up is sent by the device or when a USB bus reset is received. Software can use this bit to check if the remote wake-up feature is enabled by the host for the LPM transaction.

Source

pub fn dcon_c(&self) -> DCON_C_R

Bit 24 - Device status - connect change. The Connect Change bit is set when the device’s pull-up resistor is disconnected because VBus disappeared. The bit is reset by writing a one to it.

Source

pub fn dsus_c(&self) -> DSUS_C_R

Bit 25 - Device status - suspend change. The suspend change bit is set to 1 when the suspend bit toggles. The suspend bit can toggle because: - The device goes in the suspended state - The device is disconnected - The device receives resume signaling on its upstream port. The bit is reset by writing a one to it.

Source

pub fn dres_c(&self) -> DRES_C_R

Bit 26 - Device status - reset change. This bit is set when the device received a bus reset. On a bus reset the device will automatically go to the default state (unconfigured and responding to address 0). The bit is reset by writing a one to it.

Source

pub fn vbusdebounced(&self) -> VBUSDEBOUNCED_R

Bit 28 - This bit indicates if Vbus is detected or not. The bit raises immediately when Vbus becomes high. It drops to zero if Vbus is low for at least 3 ms. If this bit is high and the DCon bit is set, the HW will enable the pull-up resistor to signal a connect.

Trait Implementations§

Source§

impl Deref for R

Source§

type Target = R<DEVCMDSTAT_SPEC>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl Freeze for R

§

impl RefUnwindSafe for R

§

impl Send for R

§

impl Sync for R

§

impl Unpin for R

§

impl UnsafeUnpin for R

§

impl UnwindSafe for R

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.