Skip to main content

RxDescriptor

Struct RxDescriptor 

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

RX DMA descriptor — enhanced 8-word layout (32 bytes).

See TxDescriptor for why we run the enhanced layout.

Implementations§

Source§

impl RxDescriptor

Source

pub const SIZE: usize = 32

Descriptor size in bytes (enhanced 8-word layout).

Source

pub const fn new() -> Self

Create a new zeroed RX descriptor. Call setup_chained before use.

Source

pub fn setup_chained( &self, buffer: *mut u8, buffer_size: usize, next_desc: *const RxDescriptor, )

Configure descriptor in chained mode and give to DMA.

Sets the buffer pointer, buffer size, next-descriptor pointer, the SECOND_ADDR_CHAINED flag, and the OWN bit.

Source

pub fn is_owned(&self) -> bool

Check if DMA owns this descriptor.

Source

pub fn set_owned(&self)

Give ownership to DMA.

Source

pub fn clear_owned(&self)

Take ownership from DMA.

Source

pub fn is_first(&self) -> bool

First descriptor of a frame.

Source

pub fn is_last(&self) -> bool

Last descriptor of a frame.

Source

pub fn is_complete_frame(&self) -> bool

Complete frame in a single descriptor (both first and last).

Source

pub fn has_error(&self) -> bool

Check if the error summary bit is set.

Source

pub fn error_flags(&self) -> u32

Raw error flags from RDES0.

Source

pub fn frame_length(&self) -> usize

Frame length including CRC (valid on last descriptor).

Source

pub fn payload_length(&self) -> usize

Frame length excluding the 4-byte CRC.

Source

pub fn buffer_addr(&self) -> u32

Buffer address (RDES2).

Source

pub fn next_desc_addr(&self) -> u32

Next descriptor address (RDES3, chained mode).

Source

pub fn buffer_size(&self) -> usize

Configured buffer size from RDES1.

Source

pub fn recycle(&self)

Clear status and return the descriptor to DMA for reuse.

Source

pub fn raw_rdes0(&self) -> u32

Raw RDES0 value (for debugging / tests).

Source

pub fn raw_rdes1(&self) -> u32

Raw RDES1 value (for debugging / tests).

Trait Implementations§

Source§

impl Default for RxDescriptor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Send for RxDescriptor

Source§

impl Sync for RxDescriptor

Auto Trait Implementations§

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> 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.