generic<T> struct DmaChannel {
unsigned int id;
int busy;
fn int(?&T, unsigned long, unsigned long, unsigned long) start_fn;
fn int(?&T) poll_fn;
int has_poll;
?&T ctx;
}A DMA channel descriptor, generic over the driver context type T its callbacks take. One driver owns a channel for its whole lifetime, so the context can be pinned to one T per channel; it is '?&T' because a driver with no per-transfer state passes none.
Fields
A DMA channel descriptor, generic over the driver context type T its callbacks take. One driver owns a channel for its whole lifetime, so the context can be pinned to one T per channel; it is '?&T' because a driver with no per-transfer state passes none.
(ctx, src, dst, len) → 0 on success
(ctx) → 1 when complete, 0 while busy
0: wait() returns at once (synchronous engines)
Methods
Start a memory-to-memory DMA transfer.
Poll until the channel is idle. Returns 0 on success, -1 on timeout.
Is this channel currently busy?
static struct DmaChannel<T> new(
unsigned int id,
fn int(?&T, unsigned long, unsigned long, unsigned long) start_fn,
fn int(?&T) poll_fn,
?&T ctx,
)source · definitionA channel driven by start_fn/poll_fn on 'ctx' (T inferred from them).