rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::powman::regs::State

source ·
#[repr(transparent)]
pub struct State(pub u32);
Expand description

This register controls the power state of the 4 power domains. The current power state is indicated in POWMAN_STATE_CURRENT which is read-only. To change the state, write to POWMAN_STATE_REQ. The coding of POWMAN_STATE_CURRENT & POWMAN_STATE_REQ corresponds to the power states defined in the datasheet: bit 3 = SWCORE bit 2 = XIP cache bit 1 = SRAM0 bit 0 = SRAM1 0 = powered up 1 = powered down When POWMAN_STATE_REQ is written, the POWMAN_STATE_WAITING flag is set while the Power Manager determines what is required. If an invalid transition is requested the Power Manager will still register the request in POWMAN_STATE_REQ but will also set the POWMAN_BAD_REQ flag. It will then implement the power-up requests and ignore the power down requests. To do nothing would risk entering an unrecoverable lock-up state. Invalid requests are: any combination of power up and power down requests any request that results in swcore boing powered and xip unpowered If the request is to power down the switched-core domain then POWMAN_STATE_WAITING stays active until the processors halt. During this time the POWMAN_STATE_REQ field can be re-written to change or cancel the request. When the power state transition begins the POWMAN_STATE_WAITING_flag is cleared, the POWMAN_STATE_CHANGING flag is set and POWMAN register writes are ignored until the transition completes.

Tuple Fields§

§0: u32

Implementations§

source§

impl State

source

pub const fn current(&self) -> u8

source

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

source

pub const fn req(&self) -> u8

source

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

source

pub const fn req_ignored(&self) -> bool

source

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

source

pub const fn pwrup_while_waiting(&self) -> bool

Request ignored because of a pending pwrup request. See current_pwrup_req. Note this blocks powering up AND powering down.

source

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

Request ignored because of a pending pwrup request. See current_pwrup_req. Note this blocks powering up AND powering down.

source

pub const fn bad_sw_req(&self) -> bool

Bad software initiated state request. No action taken.

source

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

Bad software initiated state request. No action taken.

source

pub const fn bad_hw_req(&self) -> bool

Bad hardware initiated state request. Went back to state 0 (i.e. everything powered up)

source

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

Bad hardware initiated state request. Went back to state 0 (i.e. everything powered up)

source

pub const fn waiting(&self) -> bool

source

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

source

pub const fn changing(&self) -> bool

source

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

Trait Implementations§

source§

impl Clone for State

source§

fn clone(&self) -> State

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
source§

impl Default for State

source§

fn default() -> State

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

impl PartialEq for State

source§

fn eq(&self, other: &State) -> 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.
source§

impl Copy for State

source§

impl Eq for State

source§

impl StructuralPartialEq for State

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

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.