Struct d1_pac::usb1::ohci_root_hub_partition::hc_rh_port_status::R

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

Register hc_rh_port_status reader

Implementations§

source§

impl R

source

pub fn r_current_connect_status_w_clear_port_enable( &self, ) -> R_CURRENT_CONNECT_STATUS_W_CLEAR_PORT_ENABLE_R

Bit 0 - (read) CurrentConnectStatus

This bit reflects the current state of the downstream port.

0 No device connected

1 Device connected

(write) ClearPortEnable

The HCD writes a ‘1’ to clear the PortEnableStatus bit. Writing ‘0’ to this bit has no effect. The CurrentConnectStatus is not affected by any write. Note: This bit is always read ‘1’ when the attached device is nonremovalble (DviceRemoveable[NumberDownstreamPort]).

source

pub fn r_port_enable_status_w_set_port_enable( &self, ) -> R_PORT_ENABLE_STATUS_W_SET_PORT_ENABLE_R

Bit 1 - (read)PortEnableStatus

This bit indicates whether the port is enabled or disabled. The Root Hub may clear this bit when an overcurrent condition, disconnect event, switched-off power, or operational bus error such as babble is detected. This change also causes PortEnabledStatusChange to be set. HCD sets this bit by writing SetPortEnable and clears it by writing ClearPortEnable. This bit cannot be set when CurrentConnectStatus is cleared. This bit is also set, if not already, at the completion of a port reset when ResetStatusChange is set or port suspend when SuspendStatusChange is set.

0 port is disabled

1 port is enabled

(write)SetPortEnable

The HCD sets PortEnableStatus by writing a ‘1’. Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared, this write does not set PortEnableStatus, but instead sets ConnectStatusChange. This informs the driver that it attempted to enable a disconnected Port.

source

pub fn r_port_suspend_status_w_set_port_suspend( &self, ) -> R_PORT_SUSPEND_STATUS_W_SET_PORT_SUSPEND_R

Bit 2 - (read) PortSuspendStatus

This bit indicates the port is suspended or in the resume sequence. It is set by a SetSuspendState write and cleared when PortSuspendStatusChange is set at the end of the resume interval. This bit cannot be set if CurrentConnectStatus is cleared. This bit is also cleared when PortResetStatusChange is set at the end of the port reset or when the HC is placed in the USBRESUME state. If an upstream resume is in progress, it should propagate to the HC.

0 port is not suspended

1 port is suspended

(write) SetPortSuspend

The HCD sets the PortSuspendStatus bit by writing a ‘1’ to this bit. Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared, this write does not set PortSuspendStatus ; instead it sets ConnectStatusChange. This informs the driver that it attempted to suspend a disconnected port.

source

pub fn r_port_over_current_indicator_w_clear_suspend_status( &self, ) -> R_PORT_OVER_CURRENT_INDICATOR_W_CLEAR_SUSPEND_STATUS_R

Bit 3 - (read) PortOverCurrentIndicator

This bit is only valid when the Root Hub is configured in such a way that overcurrent conditions are reported on a per-port basis. If per-port overcurrent reporting is not supported, this bit is set to 0. If cleared, all power operations are normal for this port. If set, an overcurrent condition exists on this port. This bit always reflects the overcurrent input signal. 0 no overcurrent condition. 1 overcurrent condition detected.

(write) ClearSuspendStatus

The HCD writes a ‘1’ to initiate a resume. Writing a ‘0’ has no effect. A resume is initiated only if PortSuspendStatus is set.

source

pub fn r_port_reset_status_w_set_port_reset( &self, ) -> R_PORT_RESET_STATUS_W_SET_PORT_RESET_R

Bit 4 - (read) PortResetStatus

When this bit is set by a write to SetPortReset , port reset signaling is asserted. When reset is completed, this bit is cleared when PortResetStatusChange is set. This bit cannot be set if CurrentConnectStatus is cleared.

0 port reset signal is not active

1 port reset signal is active

(write) SetPortReset

The HCD sets the port reset signaling by writing a ‘1’ to this bit. Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared, this write does not set PortResetStatus , but instead sets ConnectStatusChange. This informs the driver that it attempted to reset a disconnected port.

source

pub fn r_port_power_status_w_set_port_power( &self, ) -> R_PORT_POWER_STATUS_W_SET_PORT_POWER_R

Bit 8 - (read) PortPowerStatus

This bit reflects the port’s power status, regardless of the type of power switching implemented. This bit is cleared if an overcurrent condition is detected. HCD sets this bit by writing SetPortPower or SetGlobalPower. HCD clears this bit by writing ClearPortPower or ClearGlobalPower. Which power control switches are enabled is determined by PowerSwitchingMode and PortPortControlMask[NumberDownstreamPort]. In global switching mode(PowerSwitchingMode=0), Set/ClearGlobalPower controls this bit. In per-port power switching (PowerSwitchingMode=1), if the PortPowerControlMask[NDP] bit for the port is set, only Set/ClearPortPower commands are enabled. If the mask is not set, only Set/ClearGlobalPower commands are enabled. When port power is disabled, CurrentConnectStatus, PortEnableStatus, PortSuspendStatus, and PortResetStatus should be reset.

0 port power is off

1 port power is on

(write) SetPortPower

The HCD writes a ‘1’ to set the PortPowerStatus bit. Writing a ‘0’ has no effect.

Note: This bit is always reads ‘1b’ if power switching is not supported.

source

pub fn r_low_speed_device_attached_w_clear_port_power( &self, ) -> R_LOW_SPEED_DEVICE_ATTACHED_W_CLEAR_PORT_POWER_R

Bit 9 - (read) LowSpeedDeviceAttached

This bit indicates the speed of the device attached to this port. When set, a Low Speed device is attached to this port. When clear, a Full Speed device is attached to this port. This field is valid only when the CurrentConnectStatus is set.

0 full speed device attached

1 low speed device attached

(write) ClearPortPower

The HCD clears the PortPowerStatus bit by writing a ‘1’ to this bit. Writing a ‘0’ has no effect.

source

pub fn connect_status_change(&self) -> CONNECT_STATUS_CHANGE_R

Bit 16 - This bit is set whenever a connect or disconnect event occurs. The HCD writes a ‘1’ to clear this bit. Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared when a SetPortReset,SetPortEnable , or SetPortSuspend write occurs, this bit is set to force the driver to re-evaluate the connection status since these writes should not occur if the port is disconnected.

Note: If the DeviceRemovable[NDP] bit is set, this bit is set only after a Root Hub reset to inform the system that the device is attached.

source

pub fn port_enable_status_change(&self) -> PORT_ENABLE_STATUS_CHANGE_R

Bit 17 - This bit is set when hardware events cause the PortEnableStatus bit to be cleared. Changes from HCD writes do not set this bit. The HCD writes a ‘1’ to clear this bit. Writing a ‘0’ has no effect.

source

pub fn port_suspend_status_change(&self) -> PORT_SUSPEND_STATUS_CHANGE_R

Bit 18 - This bit is set when the full resume sequence has been completed. This sequence includes the 20-s resume pulse, LS EOP, and 3-ms resychronization delay. The HCD writes a ‘1’ to clear this bit. Writing a ‘0’ has no effect. This bit is also cleared when ResetStatusChange is set.

source

pub fn port_over_current_indicator_change( &self, ) -> PORT_OVER_CURRENT_INDICATOR_CHANGE_R

Bit 19 - This bit is valid only if overcurrent conditions are reported on a per-port basis. This bit is set when Root Hub changes the PortOverCurrentIndicator bit. The HCD writes a ‘1’ to clear this bit. Writing a ‘0’ has no effect.

source

pub fn port_reset_status_change(&self) -> PORT_RESET_STATUS_CHANGE_R

Bit 20 - This bit is set at the end of the 10ms port reset signal. The HCD writes a ‘1’ to clear this bit. Writing a ‘0’ has no effect.

Methods from Deref<Target = R<HC_RH_PORT_STATUS_SPEC>>§

source

pub fn bits(&self) -> REG::Ux

Reads raw bits from register.

Trait Implementations§

source§

impl Deref for R

§

type Target = R<HC_RH_PORT_STATUS_SPEC>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl From<R<HC_RH_PORT_STATUS_SPEC>> for R

source§

fn from(reader: R<HC_RH_PORT_STATUS_SPEC>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for R

§

impl RefUnwindSafe for R

§

impl Send for R

§

impl Sync for R

§

impl Unpin 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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.