Struct DmaDescriptorFlags

Source
pub struct DmaDescriptorFlags(pub u32);
Available on crate feature unstable only.
Expand description

DMA descriptor flags.

Tuple Fields§

§0: u32

Implementations§

Source§

impl DmaDescriptorFlags

Source

pub fn size(&self) -> u16

Specifies the size of the buffer that this descriptor points to.

Source

pub fn length(&self) -> u16

Specifies the number of valid bytes in the buffer that this descriptor points to.

This field in a transmit descriptor is written by software and indicates how many bytes can be read from the buffer.

This field in a receive descriptor is written by hardware automatically and indicates how many valid bytes have been stored into the buffer.

Source

pub fn suc_eof(&self) -> bool

For receive descriptors, software needs to clear this bit to 0, and hardware will set it to 1 after receiving data containing the EOF flag. For transmit descriptors, software needs to set this bit to 1 as needed. If software configures this bit to 1 in a descriptor, the DMA will include the EOF flag in the data sent to the corresponding peripheral, indicating to the peripheral that this data segment marks the end of one transfer phase.

Source

pub fn owner(&self) -> bool

Specifies who is allowed to access the buffer that this descriptor points to.

  • 0: CPU can access the buffer;
  • 1: The GDMA controller can access the buffer.
Source

pub fn set_size(&mut self, value: u16)

Specifies the size of the buffer that this descriptor points to.

Source

pub fn set_length(&mut self, value: u16)

Specifies the number of valid bytes in the buffer that this descriptor points to.

This field in a transmit descriptor is written by software and indicates how many bytes can be read from the buffer.

This field in a receive descriptor is written by hardware automatically and indicates how many valid bytes have been stored into the buffer.

Source

pub fn set_suc_eof(&mut self, value: bool)

For receive descriptors, software needs to clear this bit to 0, and hardware will set it to 1 after receiving data containing the EOF flag. For transmit descriptors, software needs to set this bit to 1 as needed. If software configures this bit to 1 in a descriptor, the DMA will include the EOF flag in the data sent to the corresponding peripheral, indicating to the peripheral that this data segment marks the end of one transfer phase.

Source

pub fn set_owner(&mut self, value: bool)

Specifies who is allowed to access the buffer that this descriptor points to.

  • 0: CPU can access the buffer;
  • 1: The GDMA controller can access the buffer.

Trait Implementations§

Source§

impl<T> BitRange<T> for DmaDescriptorFlags
where u32: BitRange<T>,

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> T

Get a range of bits.
Source§

impl<T> BitRangeMut<T> for DmaDescriptorFlags
where u32: BitRangeMut<T>,

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: T)

Set a range of bits.
Source§

impl Clone for DmaDescriptorFlags

Source§

fn clone(&self) -> DmaDescriptorFlags

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DmaDescriptorFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Format for DmaDescriptorFlags

Source§

fn format(&self, fmt: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl PartialEq for DmaDescriptorFlags

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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 DmaDescriptorFlags

Source§

impl Eq for DmaDescriptorFlags

Source§

impl StructuralPartialEq for DmaDescriptorFlags

Auto Trait Implementations§

§

impl Freeze for DmaDescriptorFlags

§

impl RefUnwindSafe for DmaDescriptorFlags

§

impl Send for DmaDescriptorFlags

§

impl Sync for DmaDescriptorFlags

§

impl Unpin for DmaDescriptorFlags

§

impl UnwindSafe for DmaDescriptorFlags

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Bit for T
where T: BitRange<u8>,

Source§

fn bit(&self, bit: usize) -> bool

Get a single bit.
Source§

impl<T> BitMut for T
where T: BitRangeMut<u8>,

Source§

fn set_bit(&mut self, bit: usize, value: bool)

Set a single bit.
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.