nxp-pac

Crates

git

Versions

mcxa557

Flavors

Espi

Struct Espi 

Source
pub struct Espi { /* private fields */ }
Expand description

eSPI0 target peripheral at 0x4001F000, with five ports and two external DMA request channels. Mode-dependent register aliases are intentional; choose the view matching PCFG.TYPE.

Implementations§

Source§

impl Espi

Source

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

Source

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

Source

pub const fn mctrl(self) -> Reg<Mctrl, RW>

Master Control. ENABLE may transition only 0->1/2 or 1/2->0; never directly between active modes or to 3. PENA is a five-port independent enable mask, valid only after port TYPE/configuration is set.

Source

pub const fn mstat(self) -> Reg<Mstat, RW>

Master Status. Mixed read-only status and write-one-to-clear sticky causes. PORTINT causes must be handled in PnSTAT. Read, handle data, then clear intended causes; wait at least 50 PCLK cycles before clearing to avoid reassertion (52.8.1.3). Avoid read-modify-write.

Source

pub const fn intenset(self) -> Reg<Intenset, RW>

Interrupt Enable Set. Write-one-to-set interrupt enable bits; port masks are independent bit masks, not one-bit enumerations. Port-local interrupt rules must also be enabled.

Source

pub const fn intenclr(self) -> Reg<Intenclr, RW>

Interrupt Clear. Alias for clearing the interrupt enables: write one to disable only the intended enables. It does not clear pending event causes.

Source

pub const fn intstat(self) -> Reg<Intstat, RW>

Masked Interrupt Status. Masked interrupt status is MSTAT AND interrupt enables. The memory map and XML mark RW although the function describes a computed status; no undocumented clear-on-write or read side effect is assumed.

Source

pub const fn dmactrl(self) -> Reg<Dmactrl, RW>

DMA Control. Two external DMA request channels, with ports 0-4 or Port80. Software primes the first block; DMA enable refills. The function says “up to 3 ports” but 52.3.1.9 and the register expose two DMA requests. The DMA1EN/DMA0EN tables mention action 3 for mailbox while their encoding lists reserve 3; no variant 3 is provided.

Source

pub const fn rambase(self) -> Reg<Rambase, RW>

RAM Base. RAM base, at least 4 KiB aligned. Bits 11:0 are always zero and omitted. Map reset is 0x20000000; the function says the system selects the initial base. A generated default is not an observation of allocated memory.

Source

pub const fn mapbase(self) -> Reg<Mapbase, RW>

Mapped Base

Source

pub const fn irqpush(self) -> Reg<Irqpush, RW>

IRQ Push. Push an IRQ only after clearing the previous MSTAT.IRQUPD (must be zero). DONE reports completion.

Source

pub const fn wirewo(self) -> Reg<Wirewo, RW>

Virtual Wire MCU-to-host. Wait for DONE=1 before writing new wire values. A write clears DONE, hardware sets it after transmission; DONE does not generate an interrupt and must be polled. BOOT_DONE and BOOT_ERRN should be set after power-on. LPC START/FORCE prose does not match all field names; no additional alias fields are invented.

Source

pub const fn wirero(self) -> Reg<Wirero, R>

Virtual Wire Host-to-MCU

Source

pub const fn p80stat(self) -> Reg<P80stat, RW>

Port 80 Status

Source

pub const fn stataddr(self) -> Reg<Stataddr, RW>

Status Block Address. Eight-byte status block, aligned to eight bytes. BASE=1/2 is called Base1/Base2 here, whereas MAPBASE and PnADDR use BASE0/BASE1; retain raw numeric BASE because naming conflicts.

Source

pub const fn espicap(self) -> Reg<Espicap, RW>

eSPI Capabilities. Advertised capabilities and limits; host still chooses configuration. SAFERA defines only encodings 0-3 in a four-bit field; other values are unspecified, not inferred. MAXSPD=5-7 is unspecified.

Source

pub const fn espicfg(self) -> Reg<Espicfg, R>

eSPI Configuration

Source

pub const fn espimisc(self) -> Reg<Espimisc, RW>

eSPI Miscellaneous. GPIO_IN is input status; GPIO output controls depend on whether Alert is dedicated. PWRSAV only affects eSPI clock gating, not LPC; may delay writes by less than 200 ns.

Source

pub const fn rpmc_support1(self) -> Reg<RpmcSupport1, RW>

RPMC Support 1. Configure before eSPI starts; do not change while eSPI works. TARGET_RPMC_SUPPORTED is a numeric count: prose says 1-based total up to 63, but the encoding list labels 3 as “up to 63”; no four-entry enum is used.

Source

pub const fn rpmc_support2(self) -> Reg<RpmcSupport2, RW>

RPMC Support 2. Configure before eSPI starts; do not change while eSPI works.

Source

pub const fn wirein_gpio(self) -> Reg<WireinGpio, R>

WIREIN_GPIO. LEVEL and VALID are four independent corresponding bits, not two-state 4-bit values. Captures controller virtual-wire writes; target software forwards them to GPIO.

Source

pub const fn wireout_gpio(self) -> Reg<WireoutGpio, R>

WIREOUT_GPIO. SOURCE CONFLICT: memory map/XML mark read-only, but 52.8.1.21 says the target CPU writes this register to transmit virtual wires. Conservatively retain Read access pending vendor clarification; no write accessor is proposed. LEVEL and VALID are independent bit masks.

Source

pub const fn pcfg(self, n: usize) -> Reg<Pcfg, RW>

Port Configuration. Configure type/address before enabling the port; TYPE must not change while enabled. Only one port may be OOB; if multiple ports are marked OOB, only the lowest-numbered port receives host writes. Only one port may be used for mastering and only one for flash; attempts to configure a second port are refused. Mastering, OOB and flash are not available with LPC. DIRECTION may change with caution. ERRORIGN polarity conflicts between its field and DIRECTION prose. STALLRD/STALLWR are documented here, but 52.4.2 says application stalling is no longer supported: raw fields do not guarantee this feature. TYPE=8 follows the register definition; 52.3.1.3.3 incorrectly calls Mailbox Shared 1010b.

Source

pub const fn pstat(self, n: usize) -> Reg<Pstat, RW>

Port Status. RDSTAT/WRSTAT depend on port type; change them through PIRULESTAT, not ordinary writes. Interrupt cause bits 8-14 are sticky write-one-to-clear, even with interrupts masked. Clearing INTERR also clears ERR0-ERR3. RPMC_FLASH_DEVICE may toggle for non-RPMC commands and must then be ignored.

Source

pub const fn pirulestat(self, n: usize) -> Reg<Pirulestat, RW>

Set Interrupt Rules and User Status. Contains interrupt masks, user status, status commands and completion tags. SRST and SSTCL must not be written together; SRST takes precedence. SSTCL is mode-dependent command bits, not a global enable enum. Program CPU_TAG before completion commands.

Source

pub const fn paddr(self, n: usize) -> Reg<Paddr, RW>

Port Address. Normal-port address view; aliases POMFLEN at each port offset +0x0C. Address alignment must match the port range; split mailbox alignment includes both halves. Do not change address while enabled.

Source

pub const fn pomflen(self, n: usize) -> Reg<Pomflen, RW>

Port OOB, Mastering, and Flash Length. OOB/master/flash length view; aliases PADDR at +0x0C. LEN is zero-relative; obey host payload limit and maximum 124 bytes, or 120 for bus mastering. Flash erase uses its low three bits as sector encoding. TRANS semantics depend on port type; prepare before issuing SSTCL.

Source

pub const fn pdatain(self, n: usize) -> Reg<Pdatain, R>

Port Data Input. Host input byte for endpoint/index-and-data; otherwise zero-relative last message length, including the four address bytes for SAF. SOURCE CONFLICT: SAF examples (52.6.1 and 52.6.3) require incoming TAG[29:26] and length[11:0], but the register table (52.8.1.27) marks 31:26 reserved and defines DIR[8] with DATA_LEN[7:0]. This model retains the conservative table layout and has no incoming TAG accessor; it does not supply the incoming SAF tag/length view required by those examples. CPU_TAG in PIRULESTAT is an outgoing completion tag, not a replacement for the missing incoming tag. Status depends on data consumption and port type; the source does not completely specify per-read clearing semantics. Mailbox state is explicitly maintained through PIRULESTAT. Do not assume a universal clear-on-read rule.

Source

pub const fn pdataout(self, n: usize) -> Reg<Pdataout, RW>

Port Data Out. Output-byte view; aliases PRAMUSE at +0x14. Writing endpoint data makes it pending for the host. The function paragraph repeats input-register wording, but the field definition says data to send to host; the latter is used.

Source

pub const fn pramuse(self, n: usize) -> Reg<Pramuse, RW>

Port RAM Use. Mailbox/master RAM-allocation view; aliases PDATAOUT at +0x14. Per-direction length is 4<<LEN bytes (4..512); split mailboxes use twice that RAM. OFF must be aligned modulo the mailbox range.

Trait Implementations§

Source§

impl Clone for Espi

Source§

fn clone(&self) -> Espi

Returns a duplicate 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 Espi

Source§

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

Source§

impl Eq for Espi

Source§

impl Send for Espi

Source§

impl StructuralPartialEq for Espi

Source§

impl Sync for Espi

Auto Trait Implementations§

§

impl Freeze for Espi

§

impl RefUnwindSafe for Espi

§

impl Unpin for Espi

§

impl UnwindSafe for Espi

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.