rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::otp_data_raw::OtpDataRaw

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

Predefined OTP data layout for RP2350

Implementations§

source§

impl OtpDataRaw

source

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

source

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

source

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

Bits 15:0 of public device ID. (ECC) The CHIPID0..3 rows contain a 64-bit random identifier for this chip, which can be read from the USB bootloader PICOBOOT interface or from the get_sys_info ROM API. The number of random bits makes the occurrence of twins exceedingly unlikely: for example, a fleet of a hundred million devices has a 99.97% probability of no twinned IDs. This is estimated to be lower than the occurrence of process errors in the assignment of sequential random IDs, and for practical purposes CHIPID may be treated as unique.

source

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

Bits 31:16 of public device ID (ECC)

source

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

Bits 47:32 of public device ID (ECC)

source

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

Bits 63:48 of public device ID (ECC)

source

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

Bits 15:0 of private per-device random number (ECC) The RANDID0..7 rows form a 128-bit random number generated during device test. This ID is not exposed through the USB PICOBOOT GET_INFO command or the ROM get_sys_info() API. However note that the USB PICOBOOT OTP access point can read the entirety of page 0, so this value is not meaningfully private unless the USB PICOBOOT interface is disabled via the DISABLE_BOOTSEL_USB_PICOBOOT_IFC flag in BOOT_FLAGS0.

source

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

Bits 31:16 of private per-device random number (ECC)

source

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

Bits 47:32 of private per-device random number (ECC)

source

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

Bits 63:48 of private per-device random number (ECC)

source

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

Bits 79:64 of private per-device random number (ECC)

source

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

Bits 95:80 of private per-device random number (ECC)

source

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

Bits 111:96 of private per-device random number (ECC)

source

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

Bits 127:112 of private per-device random number (ECC)

source

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

Ring oscillator frequency in kHz, measured during manufacturing (ECC) This is measured at 1.1 V, at room temperature, with the ROSC configuration registers in their reset state.

source

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

Low-power oscillator frequency in Hz, measured during manufacturing (ECC) This is measured at 1.1V, at room temperature, with the LPOSC trim register in its reset state.

source

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

The number of main user GPIOs (bank 0). Should read 48 in the QFN80 package, and 30 in the QFN60 package. (ECC)

source

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

Lower 16 bits of CRC32 of OTP addresses 0x00 through 0x6b (polynomial 0x4c11db7, input reflected, output reflected, seed all-ones, final XOR all-ones) (ECC)

source

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

Upper 16 bits of CRC32 of OTP addresses 0x00 through 0x6b (ECC)

source

pub const fn crit0(self) -> Reg<Crit0, RW>

Page 0 critical boot flags (RBIT-8)

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

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

Redundant copy of CRIT0

source

pub const fn crit1(self) -> Reg<Crit1, RW>

Page 1 critical boot flags (RBIT-8)

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

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

Redundant copy of CRIT1

source

pub const fn boot_flags0(self) -> Reg<BootFlags0, RW>

Disable/Enable boot paths/features in the RP2350 mask ROM. Disables always supersede enables. Enables are provided where there are other configurations in OTP that must be valid. (RBIT-3)

source

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

Redundant copy of BOOT_FLAGS0

source

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

Redundant copy of BOOT_FLAGS0

source

pub const fn boot_flags1(self) -> Reg<BootFlags1, RW>

Disable/Enable boot paths/features in the RP2350 mask ROM. Disables always supersede enables. Enables are provided where there are other configurations in OTP that must be valid. (RBIT-3)

source

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

Redundant copy of BOOT_FLAGS1

source

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

Redundant copy of BOOT_FLAGS1

source

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

Default boot version thermometer counter, bits 23:0 (RBIT-3)

source

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

Redundant copy of DEFAULT_BOOT_VERSION0

source

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

Redundant copy of DEFAULT_BOOT_VERSION0

source

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

Default boot version thermometer counter, bits 47:24 (RBIT-3)

source

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

Redundant copy of DEFAULT_BOOT_VERSION1

source

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

Redundant copy of DEFAULT_BOOT_VERSION1

source

pub const fn flash_devinfo(self) -> Reg<FlashDevinfo, RW>

Stores information about external flash device(s). (ECC) Assumed to be valid if BOOT_FLAGS0_FLASH_DEVINFO_ENABLE is set.

source

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

Gap between partition table slot 0 and slot 1 at the start of flash (the default size is 4096 bytes) (ECC) Enabled by the OVERRIDE_FLASH_PARTITION_SLOT_SIZE bit in BOOT_FLAGS, the size is 4096 * (value + 1)

source

pub const fn bootsel_led_cfg(self) -> Reg<BootselLedCfg, RW>

Pin configuration for LED status, used by USB bootloader. (ECC) Must be valid if BOOT_FLAGS0_ENABLE_BOOTSEL_LED is set.

source

pub const fn bootsel_pll_cfg(self) -> Reg<BootselPllCfg, RW>

Optional PLL configuration for BOOTSEL mode. (ECC) This should be configured to produce an exact 48 MHz based on the crystal oscillator frequency. User mode software may also use this value to calculate the expected crystal frequency based on an assumed 48 MHz PLL output. If no configuration is given, the crystal is assumed to be 12 MHz. The PLL frequency can be calculated as: PLL out = (XOSC frequency / (REFDIV+1)) x FBDIV / (POSTDIV1 x POSTDIV2) Conversely the crystal frequency can be calculated as: XOSC frequency = 48 MHz x (REFDIV+1) x (POSTDIV1 x POSTDIV2) / FBDIV (Note the +1 on REFDIV is because the value stored in this OTP location is the actual divisor value minus one.) Used if and only if ENABLE_BOOTSEL_NON_DEFAULT_PLL_XOSC_CFG is set in BOOT_FLAGS0. That bit should be set only after this row and BOOTSEL_XOSC_CFG are both correctly programmed.

source

pub const fn bootsel_xosc_cfg(self) -> Reg<BootselXoscCfg, RW>

Non-default crystal oscillator configuration for the USB bootloader. (ECC) These values may also be used by user code configuring the crystal oscillator. Used if and only if ENABLE_BOOTSEL_NON_DEFAULT_PLL_XOSC_CFG is set in BOOT_FLAGS0. That bit should be set only after this row and BOOTSEL_PLL_CFG are both correctly programmed.

source

pub const fn usb_boot_flags(self) -> Reg<UsbBootFlags, RW>

USB boot specific feature flags (RBIT-3)

source

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

Redundant copy of USB_BOOT_FLAGS

source

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

Redundant copy of USB_BOOT_FLAGS

source

pub const fn usb_white_label_addr(self) -> Reg<UsbWhiteLabelAddr, RW>

Row index of the USB_WHITE_LABEL structure within OTP (ECC) The table has 16 rows, each of which are also ECC and marked valid by the corresponding valid bit in USB_BOOT_FLAGS (ECC). The entries are either _VALUEs where the 16 bit value is used as is, or _STRDEFs which acts as a pointers to a string value. The value stored in a _STRDEF is two separate bytes: The low seven bits of the first (LSB) byte indicates the number of characters in the string, and the top bit of the first (LSB) byte if set to indicate that each character in the string is two bytes (Unicode) versus one byte if unset. The second (MSB) byte represents the location of the string data, and is encoded as the number of rows from this USB_WHITE_LABEL_ADDR; i.e. the row of the start of the string is USB_WHITE_LABEL_ADDR value + msb_byte. In each case, the corresponding valid bit enables replacing the default value for the corresponding item provided by the boot rom. Note that Unicode _STRDEFs are only supported for USB_DEVICE_PRODUCT_STRDEF, USB_DEVICE_SERIAL_NUMBER_STRDEF and USB_DEVICE_MANUFACTURER_STRDEF. Unicode values will be ignored if specified for other fields, and non-unicode values for these three items will be converted to Unicode characters by setting the upper 8 bits to zero. Note that if the USB_WHITE_LABEL structure or the corresponding strings are not readable by BOOTSEL mode based on OTP permissions, or if alignment requirements are not met, then the corresponding default values are used. The index values indicate where each field is located (row USB_WHITE_LABEL_ADDR value + index):

source

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

OTP start row for the OTP boot image. (ECC) If OTP boot is enabled, the bootrom will load from this location into SRAM and then directly enter the loaded image. Note that the image must be signed if SECURE_BOOT_ENABLE is set. The image itself is assumed to be ECC-protected. This must be an even number. Equivalently, the OTP boot image must start at a word-aligned location in the ECC read data address window.

source

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

Length in rows of the OTP boot image. (ECC) OTPBOOT_LEN must be even. The total image size must be a multiple of 4 bytes (32 bits).

source

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

Bits 15:0 of the OTP boot image load destination (and entry point). (ECC) This must be a location in main SRAM (main SRAM is addresses 0x20000000 through 0x20082000) and must be word-aligned.

source

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

Bits 31:16 of the OTP boot image load destination (and entry point). (ECC) This must be a location in main SRAM (main SRAM is addresses 0x20000000 through 0x20082000) and must be word-aligned.

source

pub const fn bootkey(self, n: usize) -> BootKey

source

pub const fn key(self, n: usize) -> Key

source

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

Valid flag for key 1. Once the valid flag is set, the key can no longer be read or written, and becomes a valid fixed key for protecting OTP pages.

source

pub const fn page_lock(self, n: usize) -> PageLock

Trait Implementations§

source§

impl Clone for OtpDataRaw

source§

fn clone(&self) -> OtpDataRaw

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 OtpDataRaw

source§

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

source§

impl Eq for OtpDataRaw

source§

impl Send for OtpDataRaw

source§

impl StructuralPartialEq for OtpDataRaw

source§

impl Sync for OtpDataRaw

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.