Skip to main content

System

Struct System 

Source
pub struct System<'d> {
    pub sys_ctl0: SysCtl0<'d>,
    pub glb_ctl_m: GlbCtlM<'d>,
    pub cldo_crg: CldoCrg<'d>,
}
Expand description

System control handle.

Holds the SYS_CTL0, GLB_CTL_M, and CLDO_CRG peripherals for clock and reset configuration.

Fields§

§sys_ctl0: SysCtl0<'d>§glb_ctl_m: GlbCtlM<'d>§cldo_crg: CldoCrg<'d>

Implementations§

Source§

impl<'d> System<'d>

Source

pub fn new( sys_ctl0: SysCtl0<'d>, glb_ctl_m: GlbCtlM<'d>, cldo_crg: CldoCrg<'d>, ) -> Self

Source§

impl System<'_>

Source

pub fn reset_reason(&self) -> ResetReason

Read (and clear) the last reset reason from SYS_RST_RECORD_0.

Decodes the WS63 reset-history record (reboot_port_get_rst_reason): watchdog takes precedence over software over power-on. The matched bit is cleared via SYS_DIAG_CLR_1 so the next boot reports its own cause. Reasons this SoC’s record does not distinguish (ExternalPin, BrownOut) are never returned here. An empty record reads back as ResetReason::Unknown.

Source

pub fn software_reset(&self) -> !

Trigger a full software reset of the chip and never return.

Sets the chip-reset enable bit (bit 2) of GLB_CTL_M + 0x110, the same register reboot_port_reboot_chip uses. The CPU is reset before the following spin loop completes.

Source

pub fn software_reset_cpu(&self) -> !

Trigger a software reset and never return.

WS63’s porting layer exposes only a whole-chip reset, so this is an alias of software_reset.

Auto Trait Implementations§

§

impl<'d> Freeze for System<'d>

§

impl<'d> RefUnwindSafe for System<'d>

§

impl<'d> Send for System<'d>

§

impl<'d> Sync for System<'d>

§

impl<'d> Unpin for System<'d>

§

impl<'d> UnsafeUnpin for System<'d>

§

impl<'d> UnwindSafe for System<'d>

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

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.