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
impl Espi
pub const unsafe fn from_ptr(ptr: *mut ()) -> Self
pub const fn as_ptr(&self) -> *mut ()
Sourcepub const fn mctrl(self) -> Reg<Mctrl, RW>
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.
Sourcepub const fn mstat(self) -> Reg<Mstat, RW>
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.
Sourcepub const fn intenset(self) -> Reg<Intenset, RW>
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.
Sourcepub const fn intenclr(self) -> Reg<Intenclr, RW>
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.
Sourcepub const fn intstat(self) -> Reg<Intstat, RW>
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.
Sourcepub const fn dmactrl(self) -> Reg<Dmactrl, RW>
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.
Sourcepub const fn rambase(self) -> Reg<Rambase, RW>
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.
Sourcepub const fn irqpush(self) -> Reg<Irqpush, RW>
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.
Sourcepub const fn wirewo(self) -> Reg<Wirewo, RW>
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.
Sourcepub const fn stataddr(self) -> Reg<Stataddr, RW>
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.
Sourcepub const fn espicap(self) -> Reg<Espicap, RW>
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.
Sourcepub const fn espimisc(self) -> Reg<Espimisc, RW>
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.
Sourcepub const fn rpmc_support1(self) -> Reg<RpmcSupport1, RW>
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.
Sourcepub const fn rpmc_support2(self) -> Reg<RpmcSupport2, RW>
pub const fn rpmc_support2(self) -> Reg<RpmcSupport2, RW>
RPMC Support 2. Configure before eSPI starts; do not change while eSPI works.
Sourcepub const fn wirein_gpio(self) -> Reg<WireinGpio, R>
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.
Sourcepub const fn wireout_gpio(self) -> Reg<WireoutGpio, R>
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.
Sourcepub const fn pcfg(self, n: usize) -> Reg<Pcfg, RW>
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.
Sourcepub const fn pstat(self, n: usize) -> Reg<Pstat, RW>
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.
Sourcepub const fn pirulestat(self, n: usize) -> Reg<Pirulestat, RW>
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.
Sourcepub const fn paddr(self, n: usize) -> Reg<Paddr, RW>
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.
Sourcepub const fn pomflen(self, n: usize) -> Reg<Pomflen, RW>
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.
Sourcepub const fn pdatain(self, n: usize) -> Reg<Pdatain, R>
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.
Sourcepub const fn pdataout(self, n: usize) -> Reg<Pdataout, RW>
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.