libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
DMA (Color)

Macros

#define ws_gdma_set_source(src)
 Set the initial source address of a general DMA transfer.
#define ws_gdma_copy(dest, src, length)
 Copy words from a source pointer to a destination pointer using DMA.
#define ws_sdma_set_source(src)
 Set the initial source address of a sound DMA transfer.

Functions

static void ws_gdma_set_destination (void ws_iram *address)
 Set the destination of a general DMA transfer.
static void ws_gdma_set_length (uint16_t length)
 Set the length of a general DMA transfer.
void ws_gdma_maybe_copy (void ws_iram *dest, const void __far *src, uint16_t length)
 Copy words from a source pointer to a destination pointer, using DMA if present.
static void ws_sdma_set_length (uint32_t length)
 Set the length of a sound DMA transfer.

Detailed Description

Macro Definition Documentation

◆ ws_gdma_copy

#define ws_gdma_copy ( dest,
src,
length )
Value:
_Generic((src), \
int8_t: ws_gdma_copyi, \
int16_t: ws_gdma_copyi, \
int32_t: ws_gdma_copyi, \
uint8_t: ws_gdma_copyi, \
uint16_t: ws_gdma_copyi, \
uint32_t: ws_gdma_copyi, \
default: ws_gdma_copyp \
)(dest, src, length)

Copy words from a source pointer to a destination pointer using DMA.

Note that this only works if Color mode is enabled - see ws_system_is_color For a function which works always, see ws_gdma_maybe_copy

Parameters
destDestination pointer, in RAM.
srcSource linear (20-bit) address.
lengthLength, in bytes. Must be a multiple of 2.

Definition at line 105 of file dma.h.

◆ ws_gdma_set_source

#define ws_gdma_set_source ( src)
Value:
_Generic((src), \
int8_t: ws_gdma_set_sourcei, \
int16_t: ws_gdma_set_sourcei, \
int32_t: ws_gdma_set_sourcei, \
uint8_t: ws_gdma_set_sourcei, \
uint16_t: ws_gdma_set_sourcei, \
uint32_t: ws_gdma_set_sourcei, \
default: ws_gdma_set_sourcep \
)(src)

Set the initial source address of a general DMA transfer.

One can specify a pointer, such as MK_FP(0x2100, 0x1234), or an integer representing a linear CPU address, such as 0x22234.

Parameters
srcThe source address.

Definition at line 59 of file dma.h.

◆ ws_sdma_set_source

#define ws_sdma_set_source ( src)
Value:
_Generic((src), \
int8_t: ws_sdma_set_sourcei, \
int16_t: ws_sdma_set_sourcei, \
int32_t: ws_sdma_set_sourcei, \
uint8_t: ws_sdma_set_sourcei, \
uint16_t: ws_sdma_set_sourcei, \
uint32_t: ws_sdma_set_sourcei, \
default: ws_sdma_set_sourcep \
)(src)

Set the initial source address of a sound DMA transfer.

One can specify a pointer, such as MK_FP(0x2100, 0x1234), or an integer representing a linear CPU address, such as 0x22234.

Parameters
srcThe source address.

Definition at line 143 of file dma.h.

Function Documentation

◆ ws_gdma_maybe_copy()

void ws_gdma_maybe_copy ( void ws_iram * dest,
const void __far * src,
uint16_t length )

Copy words from a source pointer to a destination pointer, using DMA if present.

Parameters
destDestination pointer, in RAM.
srcSource pointer, in any location.
lengthLength, in bytes. Must be a multiple of 2.

◆ ws_gdma_set_destination()

void ws_gdma_set_destination ( void ws_iram * address)
inlinestatic

Set the destination of a general DMA transfer.

Parameters
addressThe destination address.

Definition at line 74 of file dma.h.

◆ ws_gdma_set_length()

void ws_gdma_set_length ( uint16_t length)
inlinestatic

Set the length of a general DMA transfer.

Parameters
lengthThe length, in bytes; must be rounded up to a multiple of 2.

Definition at line 83 of file dma.h.

◆ ws_sdma_set_length()

void ws_sdma_set_length ( uint32_t length)
inlinestatic

Set the length of a sound DMA transfer.

Definition at line 156 of file dma.h.