pub struct DMAFrame<const N: usize> { /* private fields */ }
Expand description

Data type for holding data frames for the Serial.

Internally used uninitialized storage, making this storage zero cost to create. It can also be used with, for example, heapless::pool to create a pool of serial frames.

Implementations

Creates a new node for the Serial DMA

Gives a &mut [u8] slice to write into with the maximum size, the commit method must then be used to set the actual number of bytes written.

Note that this function internally first zeros the uninitialized part of the node’s buffer.

Used to shrink the current size of the frame, used in conjunction with write.

Gives an uninitialized &mut [MaybeUninit<u8>] slice to write into, the set_len method must then be used to set the actual number of bytes written.

Used to set the current size of the frame, used in conjunction with write_uninit to have an interface for uninitialized memory. Use with care!

Safety

NOTE(unsafe): This must be set so that the final buffer is only referencing initialized memory.

Used to write data into the node, and returns how many bytes were written from buf.

If the node is already partially filled, this will continue filling the node.

Clear the node of all data making it empty

Returns a readable slice which maps to the buffers internal data

Returns a readable mutable slice which maps to the buffers internal data

Reads how many bytes are available

Reads how many bytes are free

Get the max length of the frame

Checks if the frame is empty

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Formats the value using the given formatter. Read more

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

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.