rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::otp::Otp

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

SNPS OTP control IF (SBPI and RPi wrapper control)

Implementations§

source§

impl Otp

source

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

source

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

source

pub const fn sw_lock(self, n: usize) -> Reg<SwLock, RW>

Software lock register for page 0. Locks are initialised from the OTP lock pages at reset. This register can be written to further advance the lock state of each page (until next reset), and read to check the current lock state of a page.

source

pub const fn sbpi_instr(self) -> Reg<SbpiInstr, RW>

Dispatch instructions to the SBPI interface, used for programming the OTP fuses.

source

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

SBPI write payload bytes 3..0

source

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

Read payload bytes 3..0. Once read, the data in the register will automatically clear to 0.

source

pub const fn sbpi_status(self) -> Reg<SbpiStatus, RW>

source

pub const fn usr(self) -> Reg<Usr, RW>

Controls for APB data read interface (USER interface)

source

pub const fn dbg(self) -> Reg<Dbg, RW>

Debug for OTP power-on state machine

source

pub const fn bist(self) -> Reg<Bist, RW>

During BIST, count address locations that have at least one leaky bit

source

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

Word 0 (bits 31..0) of the key. Write only, read returns 0x0

source

pub const fn critical(self) -> Reg<Critical, RW>

Quickly check values of critical flags read during boot up

source

pub const fn key_valid(self) -> Reg<KeyValid, RW>

Which keys were valid (enrolled) at boot time

source

pub const fn debugen(self) -> Reg<Debugen, RW>

Enable a debug feature that has been disabled. Debug features are disabled if one of the relevant critical boot flags is set in OTP (DEBUG_DISABLE or SECURE_DEBUG_DISABLE), OR if a debug key is marked valid in OTP, and the matching key value has not been supplied over SWD. Specifically: - The DEBUG_DISABLE flag disables all debug features. This can be fully overridden by setting all bits of this register. - The SECURE_DEBUG_DISABLE flag disables secure processor debug. This can be fully overridden by setting the PROC0_SECURE and PROC1_SECURE bits of this register. - If a single debug key has been registered, and no matching key value has been supplied over SWD, then all debug features are disabled. This can be fully overridden by setting all bits of this register. - If both debug keys have been registered, and the Non-secure key’s value (key 6) has been supplied over SWD, secure processor debug is disabled. This can be fully overridden by setting the PROC0_SECURE and PROC1_SECURE bits of this register. - If both debug keys have been registered, and the Secure key’s value (key 5) has been supplied over SWD, then no debug features are disabled by the key mechanism. However, note that in this case debug features may still be disabled by the critical boot flags.

source

pub const fn debugen_lock(self) -> Reg<DebugenLock, RW>

Write 1s to lock corresponding bits in DEBUGEN. This register is reset by the processor cold reset.

source

pub const fn archsel(self) -> Reg<Archsel, RW>

Architecture select (Arm/RISC-V). The default and allowable values of this register are constrained by the critical boot flags. This register is reset by the earliest reset in the switched core power domain (before a processor cold reset). Cores sample their architecture select signal on a warm reset. The source of the warm reset could be the system power-up state machine, the watchdog timer, Arm SYSRESETREQ or from RISC-V hartresetreq. Note that when an Arm core is deselected, its cold reset domain is also held in reset, since in particular the SYSRESETREQ bit becomes inaccessible once the core is deselected. Note also the RISC-V cores do not have a cold reset domain, since their corresponding controls are located in the Debug Module.

source

pub const fn archsel_status(self) -> Reg<ArchselStatus, RW>

Get the current architecture select state of each core. Cores sample the current value of the ARCHSEL register when their warm reset is released, at which point the corresponding bit in this register will also update.

source

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

Tell the bootrom to ignore scratch register boot vectors (both power manager and watchdog) on the next power 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 performing a watchdog reset that resets the OTP. 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 power manager BOOTDIS register.

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 Otp

source§

fn clone(&self) -> Otp

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 Otp

source§

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

source§

impl Eq for Otp

source§

impl Send for Otp

source§

impl StructuralPartialEq for Otp

source§

impl Sync for Otp

Auto Trait Implementations§

§

impl Freeze for Otp

§

impl RefUnwindSafe for Otp

§

impl Unpin for Otp

§

impl UnwindSafe for Otp

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.