Tx

Struct Tx 

Source
pub struct Tx<SM, TxSize = Word>{ /* private fields */ }
Expand description

PIO TX FIFO handle.

Implementations§

Source§

impl<SM, TxSize> Tx<SM, TxSize>
where SM: ValidStateMachine, TxSize: TransferSize,

Source

pub fn fifo_address(&self) -> *const u32

Gets the FIFO’s address.

This is useful if you want to DMA to this peripheral.

NB: You are responsible for using the pointer correctly and not overflowing the buffer.

Source

pub fn dreq_value(&self) -> u8

Gets the FIFO’s DREQ value.

This is a value between 0 and 39. Each FIFO on each state machine on each PIO has a unique value.

Source

pub fn write(&mut self, value: u32) -> bool

Write a u32 value to TX FIFO.

Returns true if the value was written to FIFO, false otherwise.

Source

pub fn write_u8_replicated(&mut self, value: u8) -> bool

Write a replicated u8 value to TX FIFO.

Memory mapped register writes that are smaller than 32bits will trigger “Narrow IO Register Write” behaviour in rp235x - the value written will be replicated to the rest of the register as described in RP2350 Datasheet: 2.1.5. - Narrow IO Register Writes

This 8bit write will set all 4 bytes of the FIFO to value Eg: if you write 0xBA the value written to the the FIFO will be 0xBABABABA

If you wish to write an 8bit number without replication, use write(my_u8 as u32) instead.

Returns true if the value was written to FIFO, false otherwise.

Source

pub fn write_u16_replicated(&mut self, value: u16) -> bool

Write a replicated 16bit value to TX FIFO.

Memory mapped register writes that are smaller than 32bits will trigger “Narrow IO Register Write” behaviour in rp235x - the value written will be replicated to the rest of the register as described in RP2350 Datasheet: 2.1.5. - Narrow IO Register Writes

This 16bit write will set both the upper and lower half of the FIFO entry to value.

For example, if you write 0xC0DA the value written to the FIFO will be 0xC0DAC0DA

If you wish to write a 16bit number without replication, use write(my_u16 as u32) instead.

Returns true if the value was written to FIFO, false otherwise.

Source

pub fn has_stalled(&self) -> bool

Checks if the state machine has stalled on empty TX FIFO during a blocking PULL, or an OUT with autopull enabled.

Note this is a sticky flag and may not reflect the current state of the machine.

Source

pub fn clear_stalled_flag(&self)

Clears the tx_stalled flag.

Source

pub fn is_empty(&self) -> bool

Indicate if the tx FIFO is empty

Source

pub fn is_full(&self) -> bool

Indicate if the tx FIFO is full

Source

pub fn enable_tx_not_full_interrupt(&self, id: PioIRQ)

Enable TX FIFO not full interrupt.

This interrupt is raised when the TX FIFO is not full, i.e. one could push more data to it.

Source

pub fn disable_tx_not_full_interrupt(&self, id: PioIRQ)

Disable TX FIFO not full interrupt.

Source

pub fn force_tx_not_full_interrupt(&self, id: PioIRQ)

Force TX FIFO not full interrupt.

Source

pub fn transfer_size<RSZ>(self, size: RSZ) -> Tx<SM, RSZ>
where RSZ: TransferSize,

Set the transfer size used in DMA transfers.

Trait Implementations§

Source§

impl<SM, TxSize> WriteTarget for Tx<SM, TxSize>
where SM: ValidStateMachine, TxSize: TransferSize,

Source§

type TransmittedWord = <TxSize as TransferSize>::Type

Type which is transferred in a single DMA transfer.
Source§

fn tx_treq() -> Option<u8>

Returns the DREQ number for this data sink (None for memory buffers).
Source§

fn tx_address_count(&mut self) -> (u32, u32)

Returns the address and the maximum number of words that can be transferred from this data source in a single DMA operation. Read more
Source§

fn tx_increment(&self) -> bool

Returns whether the address shall be incremented after each transfer.
Source§

impl<SM, TxSize> EndlessWriteTarget for Tx<SM, TxSize>
where SM: ValidStateMachine, TxSize: TransferSize,

Source§

impl<SM, TxSize> Send for Tx<SM, TxSize>
where SM: ValidStateMachine + Send,

Auto Trait Implementations§

§

impl<SM, TxSize> Freeze for Tx<SM, TxSize>

§

impl<SM, TxSize = Word> !RefUnwindSafe for Tx<SM, TxSize>

§

impl<SM, TxSize = Word> !Sync for Tx<SM, TxSize>

§

impl<SM, TxSize> Unpin for Tx<SM, TxSize>
where SM: Unpin, TxSize: Unpin,

§

impl<SM, TxSize = Word> !UnwindSafe for Tx<SM, TxSize>

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<Choices> CoproductSubsetter<CNil, HNil> for Choices

Source§

type Remainder = Choices

Source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

Source§

fn lift_into(self) -> U

Performs the indexed conversion.
Source§

impl<Source> Sculptor<HNil, HNil> for Source

Source§

type Remainder = Source

Source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
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.