#[repr(C)]pub struct Table<const ITEM_COUNT: usize> {
pub items: [LinearItem; ITEM_COUNT],
}
Expand description
A table of linked list items.
Fields§
§items: [LinearItem; ITEM_COUNT]
The items.
Implementations§
Source§impl<const ITEM_COUNT: usize> Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> Table<ITEM_COUNT>
Sourcepub fn new(items: [LinearItem; ITEM_COUNT]) -> Self
pub fn new(items: [LinearItem; ITEM_COUNT]) -> Self
Create a new table.
Sourcepub unsafe fn new_ping_pong<W: Word>(
request: Request,
peri_addr: *mut W,
buffer: &mut [W],
direction: Dir,
) -> Table<2>
pub unsafe fn new_ping_pong<W: Word>( request: Request, peri_addr: *mut W, buffer: &mut [W], direction: Dir, ) -> Table<2>
Create a ping-pong linked-list table.
This uses two linked-list items, one for each half of the buffer.
Sourcepub fn transfer_count(&self) -> usize
pub fn transfer_count(&self) -> usize
The total transfer count of the table in number of words.
Sourcepub fn link_indices(&mut self, first: usize, second: usize)
pub fn link_indices(&mut self, first: usize, second: usize)
Link items of given indices together: first -> second.
Sourcepub fn link_sequential(&mut self)
pub fn link_sequential(&mut self)
Link items sequentially.
Sourcepub fn link_repeat(&mut self)
pub fn link_repeat(&mut self)
Link last to first item.
Sourcepub fn base_address(&self) -> u16
pub fn base_address(&self) -> u16
Linked list base address (upper 16 address bits).
Sourcepub fn offset_address(&self, index: usize) -> u16
pub fn offset_address(&self, index: usize) -> u16
Linked list offset address (lower 16 address bits) at the selected index.
Auto Trait Implementations§
impl<const ITEM_COUNT: usize> Freeze for Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> RefUnwindSafe for Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> Send for Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> Sync for Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> Unpin for Table<ITEM_COUNT>
impl<const ITEM_COUNT: usize> UnwindSafe for Table<ITEM_COUNT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more