Struct stm32_metapac::usb::regs::Bcdr
#[repr(transparent)]pub struct Bcdr(pub u32);
Expand description
Battery charging detector
Tuple Fields§
§0: u32
Implementations§
§impl Bcdr
impl Bcdr
pub const fn bcden(&self) -> bool
pub const fn bcden(&self) -> bool
Battery charging detector (BCD) enable Device mode This bit is set by the software to enable the BCD support within the USB device. When enabled, the USB PHY is fully controlled by BCD and cannot be used for normal communication. Once the BCD discovery is finished, the BCD should be placed in OFF mode by clearing this bit to ’0 in order to allow the normal USB operation.
pub fn set_bcden(&mut self, val: bool)
pub fn set_bcden(&mut self, val: bool)
Battery charging detector (BCD) enable Device mode This bit is set by the software to enable the BCD support within the USB device. When enabled, the USB PHY is fully controlled by BCD and cannot be used for normal communication. Once the BCD discovery is finished, the BCD should be placed in OFF mode by clearing this bit to ’0 in order to allow the normal USB operation.
pub const fn dcden(&self) -> bool
pub const fn dcden(&self) -> bool
Data contact detection (DCD) mode enable Device mode This bit is set by the software to put the BCD into DCD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub fn set_dcden(&mut self, val: bool)
pub fn set_dcden(&mut self, val: bool)
Data contact detection (DCD) mode enable Device mode This bit is set by the software to put the BCD into DCD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub const fn pden(&self) -> bool
pub const fn pden(&self) -> bool
Primary detection (PD) mode enable Device mode This bit is set by the software to put the BCD into PD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub fn set_pden(&mut self, val: bool)
pub fn set_pden(&mut self, val: bool)
Primary detection (PD) mode enable Device mode This bit is set by the software to put the BCD into PD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub const fn sden(&self) -> bool
pub const fn sden(&self) -> bool
Secondary detection (SD) mode enable Device mode This bit is set by the software to put the BCD into SD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub fn set_sden(&mut self, val: bool)
pub fn set_sden(&mut self, val: bool)
Secondary detection (SD) mode enable Device mode This bit is set by the software to put the BCD into SD mode. Only one detection mode (DCD, PD, SD or OFF) should be selected to work correctly.
pub const fn dcdet(&self) -> bool
pub const fn dcdet(&self) -> bool
Data contact detection (DCD) status Device mode This bit gives the result of DCD.
pub fn set_dcdet(&mut self, val: bool)
pub fn set_dcdet(&mut self, val: bool)
Data contact detection (DCD) status Device mode This bit gives the result of DCD.
pub const fn pdet(&self) -> bool
pub const fn pdet(&self) -> bool
Primary detection (PD) status Device mode This bit gives the result of PD.
pub fn set_pdet(&mut self, val: bool)
pub fn set_pdet(&mut self, val: bool)
Primary detection (PD) status Device mode This bit gives the result of PD.
pub const fn sdet(&self) -> Sdet
pub const fn sdet(&self) -> Sdet
Secondary detection (SD) status Device mode This bit gives the result of SD.
pub fn set_sdet(&mut self, val: Sdet)
pub fn set_sdet(&mut self, val: Sdet)
Secondary detection (SD) status Device mode This bit gives the result of SD.
pub const fn ps2det(&self) -> bool
pub const fn ps2det(&self) -> bool
DM pull-up detection status Device mode This bit is active only during PD and gives the result of comparison between DM voltage level and VLGC threshold. In normal situation, the DM level should be below this threshold. If it is above, it means that the DM is externally pulled high. This can be caused by connection to a PS2 port (which pulls-up both DP and DM lines) or to some proprietary charger not following the BCD specification.
pub fn set_ps2det(&mut self, val: bool)
pub fn set_ps2det(&mut self, val: bool)
DM pull-up detection status Device mode This bit is active only during PD and gives the result of comparison between DM voltage level and VLGC threshold. In normal situation, the DM level should be below this threshold. If it is above, it means that the DM is externally pulled high. This can be caused by connection to a PS2 port (which pulls-up both DP and DM lines) or to some proprietary charger not following the BCD specification.
pub const fn dppu(&self) -> bool
pub const fn dppu(&self) -> bool
DP pull-up / DPDM pull-down Device mode This bit is set by software to enable the embedded pull-up on DP line. Clearing it to ’0 can be used to signal disconnect to the host when needed by the user software. Host mode This bit is set by software to enable the embedded pull-down on DP and DM lines.
pub fn set_dppu(&mut self, val: bool)
pub fn set_dppu(&mut self, val: bool)
DP pull-up / DPDM pull-down Device mode This bit is set by software to enable the embedded pull-up on DP line. Clearing it to ’0 can be used to signal disconnect to the host when needed by the user software. Host mode This bit is set by software to enable the embedded pull-down on DP and DM lines.
Trait Implementations§
impl Copy for Bcdr
impl Eq for Bcdr
impl StructuralPartialEq for Bcdr
Auto Trait Implementations§
impl Freeze for Bcdr
impl RefUnwindSafe for Bcdr
impl Send for Bcdr
impl Sync for Bcdr
impl Unpin for Bcdr
impl UnwindSafe for Bcdr
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
)