rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::powman::Powman

source ·
pub struct Powman { /* private fields */ }
Expand description

Controls vreg, bor, lposc, chip resets & xosc startup, powman and provides scratch register for general use and for bootcode use

Implementations§

source§

impl Powman

source

pub const unsafe fn from_ptr(ptr: *mut ()) -> Self

source

pub const fn as_ptr(&self) -> *mut ()

source

pub const fn badpasswd(self) -> Reg<Badpasswd, RW>

Indicates a bad password has been used

source

pub const fn vreg_ctrl(self) -> Reg<VregCtrl, RW>

Voltage Regulator Control

source

pub const fn vreg_sts(self) -> Reg<VregSts, RW>

Voltage Regulator Status

source

pub const fn vreg(self) -> Reg<Vreg, RW>

Voltage Regulator Settings

source

pub const fn vreg_lp_entry(self) -> Reg<VregLpEntry, RW>

Voltage Regulator Low Power Entry Settings

source

pub const fn vreg_lp_exit(self) -> Reg<VregLpExit, RW>

Voltage Regulator Low Power Exit Settings

source

pub const fn bod_ctrl(self) -> Reg<BodCtrl, RW>

Brown-out Detection Control

source

pub const fn bod(self) -> Reg<Bod, RW>

Brown-out Detection Settings

source

pub const fn bod_lp_entry(self) -> Reg<BodLpEntry, RW>

Brown-out Detection Low Power Entry Settings

source

pub const fn bod_lp_exit(self) -> Reg<BodLpExit, RW>

Brown-out Detection Low Power Exit Settings

source

pub const fn lposc(self) -> Reg<Lposc, RW>

Low power oscillator control register.

source

pub const fn chip_reset(self) -> Reg<ChipReset, RW>

Chip reset control and status

source

pub const fn wdsel(self) -> Reg<Wdsel, RW>

Allows a watchdog reset to reset the internal state of powman in addition to the power-on state machine (PSM). Note that powman ignores watchdog resets that do not select at least the CLOCKS stage or earlier stages in the PSM. If using these bits, it’s recommended to set PSM_WDSEL to all-ones in addition to the desired bits in this register. Failing to select CLOCKS or earlier will result in the POWMAN_WDSEL register having no effect.

source

pub const fn seq_cfg(self) -> Reg<SeqCfg, RW>

For configuration of the power sequencer Writes are ignored while POWMAN_STATE_CHANGING=1

source

pub const fn state(self) -> Reg<State, RW>

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.

source

pub const fn pow_fastdiv(self) -> Reg<PowFastdiv, RW>

source

pub const fn pow_delay(self) -> Reg<PowDelay, RW>

power state machine delays

source

pub const fn ext_ctrl0(self) -> Reg<ExtCtrl, RW>

Configures a gpio as a power mode aware control output

source

pub const fn ext_ctrl1(self) -> Reg<ExtCtrl, RW>

Configures a gpio as a power mode aware control output

source

pub const fn ext_time_ref(self) -> Reg<ExtTimeRef, RW>

Select a GPIO to use as a time reference, the source can be used to drive the low power clock at 32kHz, or to provide a 1ms tick to the timer, or provide a 1Hz tick to the timer. The tick selection is controlled by the POWMAN_TIMER register.

source

pub const fn lposc_freq_khz_int(self) -> Reg<LposcFreqKhzInt, RW>

Informs the AON Timer of the integer component of the clock frequency when running off the LPOSC.

source

pub const fn lposc_freq_khz_frac(self) -> Reg<LposcFreqKhzFrac, RW>

Informs the AON Timer of the fractional component of the clock frequency when running off the LPOSC.

source

pub const fn xosc_freq_khz_int(self) -> Reg<XoscFreqKhzInt, RW>

Informs the AON Timer of the integer component of the clock frequency when running off the XOSC.

source

pub const fn xosc_freq_khz_frac(self) -> Reg<XoscFreqKhzFrac, RW>

Informs the AON Timer of the fractional component of the clock frequency when running off the XOSC.

source

pub const fn set_time_63to48(self) -> Reg<SetTime63to48, RW>

source

pub const fn set_time_47to32(self) -> Reg<SetTime47to32, RW>

source

pub const fn set_time_31to16(self) -> Reg<SetTime31to16, RW>

source

pub const fn set_time_15to0(self) -> Reg<SetTime15to0, RW>

source

pub const fn read_time_upper(self) -> Reg<u32, RW>

source

pub const fn read_time_lower(self) -> Reg<u32, RW>

source

pub const fn alarm_time_63to48(self) -> Reg<AlarmTime63to48, RW>

source

pub const fn alarm_time_47to32(self) -> Reg<AlarmTime47to32, RW>

source

pub const fn alarm_time_31to16(self) -> Reg<AlarmTime31to16, RW>

source

pub const fn alarm_time_15to0(self) -> Reg<AlarmTime15to0, RW>

source

pub const fn timer(self) -> Reg<Timer, RW>

source

pub const fn pwrup(self, n: usize) -> Reg<Pwrup, RW>

4 GPIO powerup events can be configured to wake the chip up from a low power state. The pwrups are level/edge sensitive and can be set to trigger on a high/rising or low/falling event The number of gpios available depends on the package option. An invalid selection will be ignored source = 0 selects gpio0 . . source = 47 selects gpio47 source = 48 selects qspi_ss source = 49 selects qspi_sd0 source = 50 selects qspi_sd1 source = 51 selects qspi_sd2 source = 52 selects qspi_sd3 source = 53 selects qspi_sclk level = 0 triggers the pwrup when the source is low level = 1 triggers the pwrup when the source is high

source

pub const fn current_pwrup_req(self) -> Reg<CurrentPwrupReq, RW>

Indicates current powerup request state pwrup events can be cleared by removing the enable from the pwrup register. The alarm pwrup req can be cleared by clearing timer.alarm_enab 0 = chip reset, for the source of the last reset see POWMAN_CHIP_RESET 1 = pwrup0 2 = pwrup1 3 = pwrup2 4 = pwrup3 5 = coresight_pwrup 6 = alarm_pwrup

source

pub const fn last_swcore_pwrup(self) -> Reg<LastSwcorePwrup, RW>

Indicates which pwrup source triggered the last switched-core power up 0 = chip reset, for the source of the last reset see POWMAN_CHIP_RESET 1 = pwrup0 2 = pwrup1 3 = pwrup2 4 = pwrup3 5 = coresight_pwrup 6 = alarm_pwrup

source

pub const fn dbg_pwrcfg(self) -> Reg<DbgPwrcfg, RW>

source

pub const fn bootdis(self) -> Reg<Bootdis, RW>

Tell the bootrom to ignore the BOOT0..3 registers following the next RSM reset (e.g. the next core power down/up). If an early boot stage has soft-locked some OTP pages in order to protect their contents from later stages, there is a risk that Secure code running at a later stage can unlock the pages by powering the core up and down. This register can be used to ensure that the bootloader runs as normal on the next power up, preventing Secure code at a later stage from accessing OTP in its unlocked state. Should be used in conjunction with the OTP BOOTDIS register.

source

pub const fn dbgconfig(self) -> Reg<Dbgconfig, RW>

source

pub const fn scratch(self, n: usize) -> Reg<u32, RW>

Scratch register. Information persists in low power mode

source

pub const fn boot(self, n: usize) -> Reg<u32, RW>

Scratch register. Information persists in low power mode

source

pub const fn intr(self) -> Reg<Int, RW>

Raw Interrupts

source

pub const fn inte(self) -> Reg<Int, RW>

Interrupt Enable

source

pub const fn intf(self) -> Reg<Int, RW>

Interrupt Force

source

pub const fn ints(self) -> Reg<Int, RW>

Interrupt status after masking & forcing

Trait Implementations§

source§

impl Clone for Powman

source§

fn clone(&self) -> Powman

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 PartialEq for Powman

source§

fn eq(&self, other: &Powman) -> 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 Powman

source§

impl Eq for Powman

source§

impl Send for Powman

source§

impl StructuralPartialEq for Powman

source§

impl Sync for Powman

Auto Trait Implementations§

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.