Embassy
rp-pac

Crates

git

Versions

default

Flavors

Struct rp_pac::pio::Pio

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

Programmable IO block

Implementations§

source§

impl Pio

source

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

source

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

source

pub const fn ctrl(self) -> Reg<Ctrl, RW>

PIO control register

source

pub const fn fstat(self) -> Reg<Fstat, RW>

FIFO status register

source

pub const fn fdebug(self) -> Reg<Fdebug, RW>

FIFO debug register

source

pub const fn flevel(self) -> Reg<Flevel, RW>

FIFO levels

source

pub const fn txf(self, n: usize) -> Reg<u32, W>

Direct write access to the TX FIFO for this state machine. Each write pushes one word to the FIFO. Attempting to write to a full FIFO has no effect on the FIFO state or contents, and sets the sticky FDEBUG_TXOVER error flag for this FIFO.

source

pub const fn rxf(self, n: usize) -> Reg<u32, R>

Direct read access to the RX FIFO for this state machine. Each read pops one word from the FIFO. Attempting to read from an empty FIFO has no effect on the FIFO state, and sets the sticky FDEBUG_RXUNDER error flag for this FIFO. The data returned to the system on a read from an empty FIFO is undefined.

source

pub const fn irq(self) -> Reg<Irq, RW>

State machine IRQ flags register. Write 1 to clear. There are 8 state machine IRQ flags, which can be set, cleared, and waited on by the state machines. There’s no fixed association between flags and state machines – any state machine can use any flag. Any of the 8 flags can be used for timing synchronisation between state machines, using IRQ and WAIT instructions. The lower four of these flags are also routed out to system-level interrupt requests, alongside FIFO status interrupts – see e.g. IRQ0_INTE.

source

pub const fn irq_force(self) -> Reg<IrqForce, RW>

Writing a 1 to each of these bits will forcibly assert the corresponding IRQ. Note this is different to the INTF register: writing here affects PIO internal state. INTF just asserts the processor-facing IRQ signal for testing ISRs, and is not visible to the state machines.

source

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

There is a 2-flipflop synchronizer on each GPIO input, which protects PIO logic from metastabilities. This increases input delay, and for fast synchronous IO (e.g. SPI) these synchronizers may need to be bypassed. Each bit in this register corresponds to one GPIO. 0 -> input is synchronized (default) 1 -> synchronizer is bypassed If in doubt, leave this register as all zeroes.

source

pub const fn dbg_padout(self) -> Reg<u32, R>

Read to sample the pad output values PIO is currently driving to the GPIOs. On RP2040 there are 30 GPIOs, so the two most significant bits are hardwired to 0.

source

pub const fn dbg_padoe(self) -> Reg<u32, R>

Read to sample the pad output enables (direction) PIO is currently driving to the GPIOs. On RP2040 there are 30 GPIOs, so the two most significant bits are hardwired to 0.

source

pub const fn dbg_cfginfo(self) -> Reg<DbgCfginfo, RW>

The PIO hardware has some free parameters that may vary between chip products. These should be provided in the chip datasheet, but are also exposed here.

source

pub const fn instr_mem(self, n: usize) -> Reg<InstrMem, RW>

Write-only access to instruction memory location 0

source

pub const fn sm(self, n: usize) -> StateMachine

source

pub const fn intr(self) -> Reg<Intr, RW>

Raw Interrupts

source

pub const fn irqs(self, n: usize) -> Irq

Trait Implementations§

source§

impl Clone for Pio

source§

fn clone(&self) -> Pio

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<Pio> for Pio

source§

fn eq(&self, other: &Pio) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Pio

source§

impl Eq for Pio

source§

impl Send for Pio

source§

impl StructuralEq for Pio

source§

impl StructuralPartialEq for Pio

source§

impl Sync for Pio

Auto Trait Implementations§

§

impl RefUnwindSafe for Pio

§

impl Unpin for Pio

§

impl UnwindSafe for Pio

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.