#[repr(transparent)]pub struct Devcmdstat(pub u32);Expand description
USB Device Command/Status register
Tuple Fields§
§0: u32Implementations§
Source§impl Devcmdstat
impl Devcmdstat
Sourcepub const fn dev_addr(&self) -> u8
pub const fn dev_addr(&self) -> u8
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.
Sourcepub const fn set_dev_addr(&mut self, val: u8)
pub const fn set_dev_addr(&mut self, val: u8)
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.
Sourcepub const fn dev_en(&self) -> bool
pub const fn dev_en(&self) -> bool
USB device enable. If this bit is set, the HW will start responding on packets for function address DEV_ADDR.
Sourcepub const fn set_dev_en(&mut self, val: bool)
pub const fn set_dev_en(&mut self, val: bool)
USB device enable. If this bit is set, the HW will start responding on packets for function address DEV_ADDR.
Sourcepub const fn setup(&self) -> bool
pub const fn setup(&self) -> bool
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.
Sourcepub const fn set_setup(&mut self, val: bool)
pub const fn set_setup(&mut self, val: bool)
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.
Sourcepub const fn force_needclk(&self) -> ForceNeedclk
pub const fn force_needclk(&self) -> ForceNeedclk
Forces the NEEDCLK output to always be on:
Sourcepub const fn set_force_needclk(&mut self, val: ForceNeedclk)
pub const fn set_force_needclk(&mut self, val: ForceNeedclk)
Forces the NEEDCLK output to always be on:
Sourcepub const fn set_lpm_sup(&mut self, val: bool)
pub const fn set_lpm_sup(&mut self, val: bool)
LPM Supported:
Sourcepub const fn intonnak_ao(&self) -> bool
pub const fn intonnak_ao(&self) -> bool
Interrupt on NAK for interrupt and bulk OUT EP
Sourcepub const fn set_intonnak_ao(&mut self, val: bool)
pub const fn set_intonnak_ao(&mut self, val: bool)
Interrupt on NAK for interrupt and bulk OUT EP
Sourcepub const fn intonnak_ai(&self) -> bool
pub const fn intonnak_ai(&self) -> bool
Interrupt on NAK for interrupt and bulk IN EP
Sourcepub const fn set_intonnak_ai(&mut self, val: bool)
pub const fn set_intonnak_ai(&mut self, val: bool)
Interrupt on NAK for interrupt and bulk IN EP
Sourcepub const fn intonnak_co(&self) -> bool
pub const fn intonnak_co(&self) -> bool
Interrupt on NAK for control OUT EP
Sourcepub const fn set_intonnak_co(&mut self, val: bool)
pub const fn set_intonnak_co(&mut self, val: bool)
Interrupt on NAK for control OUT EP
Sourcepub const fn intonnak_ci(&self) -> bool
pub const fn intonnak_ci(&self) -> bool
Interrupt on NAK for control IN EP
Sourcepub const fn set_intonnak_ci(&mut self, val: bool)
pub const fn set_intonnak_ci(&mut self, val: bool)
Interrupt on NAK for control IN EP
Sourcepub const fn dcon(&self) -> bool
pub const fn dcon(&self) -> bool
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.
Sourcepub const fn set_dcon(&mut self, val: bool)
pub const fn set_dcon(&mut self, val: bool)
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.
Sourcepub const fn dsus(&self) -> bool
pub const fn dsus(&self) -> bool
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.
Sourcepub const fn set_dsus(&mut self, val: bool)
pub const fn set_dsus(&mut self, val: bool)
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.
Sourcepub const fn lpm_sus(&self) -> bool
pub const fn lpm_sus(&self) -> bool
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.
Sourcepub const fn set_lpm_sus(&mut self, val: bool)
pub const fn set_lpm_sus(&mut self, val: bool)
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.
Sourcepub const fn lpm_rewp(&self) -> bool
pub const fn lpm_rewp(&self) -> bool
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.
Sourcepub const fn set_lpm_rewp(&mut self, val: bool)
pub const fn set_lpm_rewp(&mut self, val: bool)
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.
Sourcepub const fn dcon_c(&self) -> bool
pub const fn dcon_c(&self) -> bool
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.
Sourcepub const fn set_dcon_c(&mut self, val: bool)
pub const fn set_dcon_c(&mut self, val: bool)
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.
Sourcepub const fn dsus_c(&self) -> bool
pub const fn dsus_c(&self) -> bool
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.
Sourcepub const fn set_dsus_c(&mut self, val: bool)
pub const fn set_dsus_c(&mut self, val: bool)
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.
Sourcepub const fn dres_c(&self) -> bool
pub const fn dres_c(&self) -> bool
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.
Sourcepub const fn set_dres_c(&mut self, val: bool)
pub const fn set_dres_c(&mut self, val: bool)
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.
Sourcepub const fn vbusdebounced(&self) -> bool
pub const fn vbusdebounced(&self) -> bool
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.
Sourcepub const fn set_vbusdebounced(&mut self, val: bool)
pub const fn set_vbusdebounced(&mut self, val: bool)
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 Clone for Devcmdstat
impl Clone for Devcmdstat
Source§fn clone(&self) -> Devcmdstat
fn clone(&self) -> Devcmdstat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more