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
impl OtpDataRaw
pub const unsafe fn from_ptr(ptr: *mut ()) -> Self
pub const fn as_ptr(&self) -> *mut ()
sourcepub const fn chipid0(self) -> Reg<u32, RW>
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.
sourcepub const fn randid0(self) -> Reg<u32, RW>
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.
sourcepub const fn randid1(self) -> Reg<u32, RW>
pub const fn randid1(self) -> Reg<u32, RW>
Bits 31:16 of private per-device random number (ECC)
sourcepub const fn randid2(self) -> Reg<u32, RW>
pub const fn randid2(self) -> Reg<u32, RW>
Bits 47:32 of private per-device random number (ECC)
sourcepub const fn randid3(self) -> Reg<u32, RW>
pub const fn randid3(self) -> Reg<u32, RW>
Bits 63:48 of private per-device random number (ECC)
sourcepub const fn randid4(self) -> Reg<u32, RW>
pub const fn randid4(self) -> Reg<u32, RW>
Bits 79:64 of private per-device random number (ECC)
sourcepub const fn randid5(self) -> Reg<u32, RW>
pub const fn randid5(self) -> Reg<u32, RW>
Bits 95:80 of private per-device random number (ECC)
sourcepub const fn randid6(self) -> Reg<u32, RW>
pub const fn randid6(self) -> Reg<u32, RW>
Bits 111:96 of private per-device random number (ECC)
sourcepub const fn randid7(self) -> Reg<u32, RW>
pub const fn randid7(self) -> Reg<u32, RW>
Bits 127:112 of private per-device random number (ECC)
sourcepub const fn rosc_calib(self) -> Reg<u32, RW>
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.
sourcepub const fn lposc_calib(self) -> Reg<u32, RW>
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.
sourcepub const fn num_gpios(self) -> Reg<u32, RW>
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)
sourcepub const fn info_crc0(self) -> Reg<u32, RW>
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)
sourcepub const fn info_crc1(self) -> Reg<u32, RW>
pub const fn info_crc1(self) -> Reg<u32, RW>
Upper 16 bits of CRC32 of OTP addresses 0x00 through 0x6b (ECC)
sourcepub const fn boot_flags0(self) -> Reg<BootFlags0, RW>
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)
sourcepub const fn boot_flags0_r1(self) -> Reg<u32, RW>
pub const fn boot_flags0_r1(self) -> Reg<u32, RW>
Redundant copy of BOOT_FLAGS0
sourcepub const fn boot_flags0_r2(self) -> Reg<u32, RW>
pub const fn boot_flags0_r2(self) -> Reg<u32, RW>
Redundant copy of BOOT_FLAGS0
sourcepub const fn boot_flags1(self) -> Reg<BootFlags1, RW>
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)
sourcepub const fn boot_flags1_r1(self) -> Reg<u32, RW>
pub const fn boot_flags1_r1(self) -> Reg<u32, RW>
Redundant copy of BOOT_FLAGS1
sourcepub const fn boot_flags1_r2(self) -> Reg<u32, RW>
pub const fn boot_flags1_r2(self) -> Reg<u32, RW>
Redundant copy of BOOT_FLAGS1
sourcepub const fn default_boot_version0(self) -> Reg<u32, RW>
pub const fn default_boot_version0(self) -> Reg<u32, RW>
Default boot version thermometer counter, bits 23:0 (RBIT-3)
sourcepub const fn default_boot_version0_r1(self) -> Reg<u32, RW>
pub const fn default_boot_version0_r1(self) -> Reg<u32, RW>
Redundant copy of DEFAULT_BOOT_VERSION0
sourcepub const fn default_boot_version0_r2(self) -> Reg<u32, RW>
pub const fn default_boot_version0_r2(self) -> Reg<u32, RW>
Redundant copy of DEFAULT_BOOT_VERSION0
sourcepub const fn default_boot_version1(self) -> Reg<u32, RW>
pub const fn default_boot_version1(self) -> Reg<u32, RW>
Default boot version thermometer counter, bits 47:24 (RBIT-3)
sourcepub const fn default_boot_version1_r1(self) -> Reg<u32, RW>
pub const fn default_boot_version1_r1(self) -> Reg<u32, RW>
Redundant copy of DEFAULT_BOOT_VERSION1
sourcepub const fn default_boot_version1_r2(self) -> Reg<u32, RW>
pub const fn default_boot_version1_r2(self) -> Reg<u32, RW>
Redundant copy of DEFAULT_BOOT_VERSION1
sourcepub const fn flash_devinfo(self) -> Reg<FlashDevinfo, RW>
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.
sourcepub const fn flash_partition_slot_size(self) -> Reg<u32, RW>
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)
sourcepub const fn bootsel_led_cfg(self) -> Reg<BootselLedCfg, RW>
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.
sourcepub const fn bootsel_pll_cfg(self) -> Reg<BootselPllCfg, RW>
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.
sourcepub const fn bootsel_xosc_cfg(self) -> Reg<BootselXoscCfg, RW>
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.
sourcepub const fn usb_boot_flags(self) -> Reg<UsbBootFlags, RW>
pub const fn usb_boot_flags(self) -> Reg<UsbBootFlags, RW>
USB boot specific feature flags (RBIT-3)
sourcepub const fn usb_boot_flags_r1(self) -> Reg<u32, RW>
pub const fn usb_boot_flags_r1(self) -> Reg<u32, RW>
Redundant copy of USB_BOOT_FLAGS
sourcepub const fn usb_boot_flags_r2(self) -> Reg<u32, RW>
pub const fn usb_boot_flags_r2(self) -> Reg<u32, RW>
Redundant copy of USB_BOOT_FLAGS
sourcepub const fn usb_white_label_addr(self) -> Reg<UsbWhiteLabelAddr, RW>
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):
sourcepub const fn otpboot_src(self) -> Reg<u32, RW>
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.
sourcepub const fn otpboot_len(self) -> Reg<u32, RW>
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).
sourcepub const fn otpboot_dst0(self) -> Reg<u32, RW>
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.
sourcepub const fn otpboot_dst1(self) -> Reg<u32, RW>
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.
pub const fn bootkey(self, n: usize) -> BootKey
pub const fn key(self, n: usize) -> Key
sourcepub const fn key_valid(self, n: usize) -> Reg<KeyValid, RW>
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.
pub const fn page_lock(self, n: usize) -> PageLock
Trait Implementations§
source§impl Clone for OtpDataRaw
impl Clone for OtpDataRaw
source§fn clone(&self) -> OtpDataRaw
fn clone(&self) -> OtpDataRaw
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for OtpDataRaw
impl PartialEq for OtpDataRaw
impl Copy for OtpDataRaw
impl Eq for OtpDataRaw
impl Send for OtpDataRaw
impl StructuralPartialEq for OtpDataRaw
impl Sync for OtpDataRaw
Auto Trait Implementations§
impl Freeze for OtpDataRaw
impl RefUnwindSafe for OtpDataRaw
impl Unpin for OtpDataRaw
impl UnwindSafe for OtpDataRaw
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)