stm32-metapac

Crates

git

Versions

stm32h562zi

Flavors

Struct stm32_metapac::ucpd::regs::Cr

#[repr(transparent)]
pub struct Cr(pub u32);
Expand description

control register

Tuple Fields§

§0: u32

Implementations§

§

impl Cr

pub const fn txmode(&self) -> Txmode

Type of Tx packet Writing the bitfield triggers the action as follows, depending on the value: Others: invalid From V1.1 of the USB PD specification, there is a counter defined for the duration of the BIST Carrier Mode 2. To quit this mode correctly (after the “tBISTContMode” delay), disable the peripheral (UCPDEN = 0).

pub fn set_txmode(&mut self, val: Txmode)

Type of Tx packet Writing the bitfield triggers the action as follows, depending on the value: Others: invalid From V1.1 of the USB PD specification, there is a counter defined for the duration of the BIST Carrier Mode 2. To quit this mode correctly (after the “tBISTContMode” delay), disable the peripheral (UCPDEN = 0).

pub const fn txsend(&self) -> bool

Command to send a Tx packet The bit is cleared by hardware as soon as the packet transmission begins or is discarded.

pub fn set_txsend(&mut self, val: bool)

Command to send a Tx packet The bit is cleared by hardware as soon as the packet transmission begins or is discarded.

pub const fn txhrst(&self) -> bool

Command to send a Tx Hard Reset The bit is cleared by hardware as soon as the message transmission begins or is discarded.

pub fn set_txhrst(&mut self, val: bool)

Command to send a Tx Hard Reset The bit is cleared by hardware as soon as the message transmission begins or is discarded.

pub const fn rxmode(&self) -> bool

Receiver mode Determines the mode of the receiver. When the bit is set, RXORDSET behaves normally, RXDR no longer receives bytes yet the CRC checking still proceeds as for a normal message.

pub fn set_rxmode(&mut self, val: bool)

Receiver mode Determines the mode of the receiver. When the bit is set, RXORDSET behaves normally, RXDR no longer receives bytes yet the CRC checking still proceeds as for a normal message.

pub const fn phyrxen(&self) -> bool

USB Power Delivery receiver enable Both CC1 and CC2 receivers are disabled when the bit is cleared. Only the CC receiver selected via the PHYCCSEL bit is enabled when the bit is set.

pub fn set_phyrxen(&mut self, val: bool)

USB Power Delivery receiver enable Both CC1 and CC2 receivers are disabled when the bit is cleared. Only the CC receiver selected via the PHYCCSEL bit is enabled when the bit is set.

pub const fn phyccsel(&self) -> Phyccsel

CC1/CC2 line selector for USB Power Delivery signaling The selection depends on the cable orientation as discovered at attach.

pub fn set_phyccsel(&mut self, val: Phyccsel)

CC1/CC2 line selector for USB Power Delivery signaling The selection depends on the cable orientation as discovered at attach.

pub const fn anasubmode(&self) -> u8

Analog PHY sub-mode Refer to TYPEC_VSTATE_CCx for the effect of this bitfield.

pub fn set_anasubmode(&mut self, val: u8)

Analog PHY sub-mode Refer to TYPEC_VSTATE_CCx for the effect of this bitfield.

pub const fn anamode(&self) -> Anamode

Analog PHY operating mode The use of CC1 and CC2 depends on CCENABLE. Refer to ANAMODE, ANASUBMODE and link with TYPEC_VSTATE_CCx for the effect of this bitfield in conjunction with ANASUBMODE[1:0].

pub fn set_anamode(&mut self, val: Anamode)

Analog PHY operating mode The use of CC1 and CC2 depends on CCENABLE. Refer to ANAMODE, ANASUBMODE and link with TYPEC_VSTATE_CCx for the effect of this bitfield in conjunction with ANASUBMODE[1:0].

pub const fn ccenable(&self) -> Ccenable

CC line enable This bitfield enables CC1 and CC2 line analog PHYs (pull-ups and pull-downs) according to ANAMODE and ANASUBMODE[1:0] setting. A single line PHY can be enabled when, for example, the other line is driven by VCONN via an external VCONN switch. Enabling both PHYs is the normal usage for sink/source.

pub fn set_ccenable(&mut self, val: Ccenable)

CC line enable This bitfield enables CC1 and CC2 line analog PHYs (pull-ups and pull-downs) according to ANAMODE and ANASUBMODE[1:0] setting. A single line PHY can be enabled when, for example, the other line is driven by VCONN via an external VCONN switch. Enabling both PHYs is the normal usage for sink/source.

pub const fn frsrxen(&self) -> bool

FRS event detection enable Setting the bit enables FRS Rx event (FRSEVT) detection on the CC line selected through the PHYCCSEL bit. 0: Disable Clear the bit when the device is attached to an FRS-incapable source/sink.

pub fn set_frsrxen(&mut self, val: bool)

FRS event detection enable Setting the bit enables FRS Rx event (FRSEVT) detection on the CC line selected through the PHYCCSEL bit. 0: Disable Clear the bit when the device is attached to an FRS-incapable source/sink.

pub const fn frstx(&self) -> bool

FRS Tx signaling enable. Setting the bit enables FRS Tx signaling. The bit is cleared by hardware after a delay respecting the USB Power Delivery specification Revision 3.0.

pub fn set_frstx(&mut self, val: bool)

FRS Tx signaling enable. Setting the bit enables FRS Tx signaling. The bit is cleared by hardware after a delay respecting the USB Power Delivery specification Revision 3.0.

pub const fn rdch(&self) -> bool

Rdch condition drive The bit drives Rdch condition on the CC line selected through the PHYCCSEL bit (thus associated with VCONN), by remaining set during the source-only UnattachedWait.SRC state, to respect the Type-C state. Refer to “USB Type-C ECN for Source VCONN Discharge”. The CCENABLE[1:0] bitfield must be set accordingly, too.

pub fn set_rdch(&mut self, val: bool)

Rdch condition drive The bit drives Rdch condition on the CC line selected through the PHYCCSEL bit (thus associated with VCONN), by remaining set during the source-only UnattachedWait.SRC state, to respect the Type-C state. Refer to “USB Type-C ECN for Source VCONN Discharge”. The CCENABLE[1:0] bitfield must be set accordingly, too.

pub const fn cc1tcdis(&self) -> bool

CC1 Type-C detector disable The bit disables the Type-C detector on the CC1 line. When enabled, the Type-C detector for CC1 is configured through ANAMODE and ANASUBMODE[1:0].

pub fn set_cc1tcdis(&mut self, val: bool)

CC1 Type-C detector disable The bit disables the Type-C detector on the CC1 line. When enabled, the Type-C detector for CC1 is configured through ANAMODE and ANASUBMODE[1:0].

pub const fn cc2tcdis(&self) -> bool

CC2 Type-C detector disable The bit disables the Type-C detector on the CC2 line. When enabled, the Type-C detector for CC2 is configured through ANAMODE and ANASUBMODE[1:0].

pub fn set_cc2tcdis(&mut self, val: bool)

CC2 Type-C detector disable The bit disables the Type-C detector on the CC2 line. When enabled, the Type-C detector for CC2 is configured through ANAMODE and ANASUBMODE[1:0].

Trait Implementations§

§

impl Clone for Cr

§

fn clone(&self) -> Cr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Default for Cr

§

fn default() -> Cr

Returns the “default value” for a type. Read more
§

impl PartialEq for Cr

§

fn eq(&self, other: &Cr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Copy for Cr

§

impl Eq for Cr

§

impl StructuralPartialEq for Cr

Auto Trait Implementations§

§

impl Freeze for Cr

§

impl RefUnwindSafe for Cr

§

impl Send for Cr

§

impl Sync for Cr

§

impl Unpin for Cr

§

impl UnwindSafe for Cr

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<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.