Defines

SCU_DMA_MODE_DIRECT

Transfer direct mode.

See

scu_dma_level_cfg::mode

SCU_DMA_MODE_INDIRECT

Transfer indirect mode.

See

scu_dma_level_cfg::mode

SCU_DMA_START_FACTOR_VBLANK_IN

Start the transfer on the start of VBLANK-IN.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_VBLANK_OUT

Start the transfer on the start of VBLANK-OUT.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_HBLANK_IN

Start the transfer on the start of HBLANK-IN.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_TIMER_0

Start the transfer on the start of SCU-Timer 0.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_TIMER_1

Start the transfer on the start of SCU-Timer 1.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_SOUND_REQ

Start the transfer on the start of…?

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_SPRITE_DRAW_END

Start the transfer on the start of VDP1 sprite draw end.

See

scu_dma_config_buffer, scu_dma_config_set

SCU_DMA_START_FACTOR_ENABLE

Start the transfer when explicitly started.

See

scu_dma_config_buffer, scu_dma_config_set, scu_dma_level0_fast_start, scu_dma_level1_fast_start, scu_dma_level2_fast_start scu_dma_level0_start, scu_dma_level1_start, scu_dma_level2_start, scu_dma_level_start

SCU_DMA_STRIDE_0_BYTES

Transfer stride by 0 bytes.

Describe it here!

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_2_BYTES

Transfer stride by 2 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_4_BYTES

Transfer stride by 4 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_8_BYTES

Transfer stride by 8 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_16_BYTES

Transfer stride by 16 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_32_BYTES

Transfer stride by 32 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_64_BYTES

See

scu_dma_level_cfg::stride

SCU_DMA_STRIDE_128_BYTES

Transfer stride by 128 bytes.

See

scu_dma_level_cfg::stride

SCU_DMA_UPDATE_NONE

Keep the source and destination address fixed.

See

scu_dma_level_cfg::update

SCU_DMA_UPDATE_RUP

Increment the source, but keep the destination address fixed.

See

scu_dma_level_cfg::update

SCU_DMA_UPDATE_WUP

Increment both source and destination addresses.

See

scu_dma_level_cfg::update

SCU_DMA_BUS_A

Not yet documented.

SCU_DMA_BUS_B

Not yet documented.

SCU_DMA_BUS_DSP

Not yet documented.

SCU_DMA_INDIRECT_TBL_END

When SCU-DMA transfer is indirect-mode, the value is bitwise OR’d with the last entry’s scu_dma_xfer::len member.

See

scu_dma_xfer

Warning

Not setting this bit on the last entry will lock up the hardware.

Helpers

SCU_DMA_MODE_XFER_INITIALIZER(_len, _dst, _src)

Not yet documented.

SCU_DMA_MODE_XFER_END_INITIALIZER(_len, _dst, _src)

Not yet documented.

Structures

struct scu_dma_xfer

Defines a SCU-DMA transfer entry.

Public Members

uint32_t len

Transfer length.

Note

Keep in mind of the following restrictions:

  • Level 0 is able to transfer up to 1MiB.

  • Level 1 is able to transfer up to 4KiB.

  • Level 2 is able to transfer up to 4KiB.

uint32_t dst

Absolute destination address.

Address must be uncached.

uint32_t src

Absolute source address.

Address must be uncached.

struct scu_dma_level_cfg

Describes an instance of a SCU-DMA configuration.

Here is where you can describe how a direct transfer would work.

Here is where you can describe how an indirect transfer would work.

Here is where you would explain the issues with indirect transfer mode.

See

scu_dma_config_buffer, scu_dma_config_set

Public Members

uint8_t mode

Transfer mode.

See

SCU_DMA_MODE_DIRECT, SCU_DMA_MODE_INDIRECT

union scu_dma_level_cfg::[anonymous] xfer

Set either a single (direct) transfer or indirect transfer table.

uint8_t stride

Transfer stride.

See

SCU_DMA_STRIDE_0_BYTES, SCU_DMA_STRIDE_2_BYTES, SCU_DMA_STRIDE_4_BYTES, SCU_DMA_STRIDE_8_BYTES, SCU_DMA_STRIDE_16_BYTES, SCU_DMA_STRIDE_32_BYTES, SCU_DMA_STRIDE_64_BYTES, SCU_DMA_STRIDE_128_BYTES

uint32_t update

Source and destination update mode.

See

SCU_DMA_UPDATE_NONE, SCU_DMA_UPDATE_RUP, SCU_DMA_UPDATE_WUP

struct scu_dma_reg_buffer

Used when buffering a SCU-DMA transfer with scu_dma_config_buffer.

See

scu_dma_config_buffer

Public Members

uint32_t buffer[5]

Not yet documented.

Inline functions

static uint32_t scu_dma_dsp_busy(void)

Not yet documented.

static void scu_dma_dsp_wait(void)

Not yet documented.

static uint8_t scu_dma_bus_access_busy(void)

Not yet documented.

static void scu_dma_bus_access_wait(const uint8_t bus_mask)

Not yet documented.

static uint32_t scu_dma_level0_busy(void)

Not yet documented.

static uint32_t scu_dma_level1_busy(void)

Not yet documented.

static uint32_t scu_dma_level2_busy(void)

Not yet documented.

static uint32_t scu_dma_level_busy(const uint8_t level)

Not yet documented.

static void scu_dma_level0_wait(void)

Not yet documented.

static void scu_dma_level1_wait(void)

Not yet documented.

static void scu_dma_level2_wait(void)

Not yet documented.

static void scu_dma_level_wait(const uint8_t level)

Not yet documented.

static void scu_dma_level0_fast_start(void)

Not yet documented.

static void scu_dma_level1_fast_start(void)

Not yet documented.

static void scu_dma_level2_fast_start(void)

Not yet documented.

static void scu_dma_level0_start(void)

Not yet documented.

static void scu_dma_level1_start(void)

Not yet documented.

static void scu_dma_level2_start(void)

Not yet documented.

Warning

To prevent operation errors, do not activate DMA level 2 during DMA level 1 operation.

static void scu_dma_level_fast_start(const uint8_t level)

Not yet documented.

static void scu_dma_level_start(const uint8_t level)

Not yet documented.

static void scu_dma_level0_stop(void)

Not yet documented.

static void scu_dma_level1_stop(void)

Not yet documented.

static void scu_dma_level2_stop(void)

Not yet documented.

static void scu_dma_level_stop(const uint8_t level)

Not yet documented.

static void scu_dma_stop(void)

Not yet documented.

static void scu_dma_illegal_set(void (*ihr)(void))

Not yet documented.

static void scu_dma_level0_end_set(void (*ihr)(void))

Not yet documented.

static void scu_dma_level1_end_set(void (*ihr)(void))

Not yet documented.

static void scu_dma_level2_end_set(void (*ihr)(void))

Not yet documented.

static void scu_dma_level_end_set(const uint8_t level, void (*ihr)(void))

Not yet documented.

Functions

void scu_dma_init(void)

Not yet documented.

void scu_dma_config_buffer(struct scu_dma_reg_buffer *, const struct scu_dma_level_cfg *)

Not yet documented.

void scu_dma_config_set(uint8_t, uint8_t, const struct scu_dma_reg_buffer *, void (*)(void))

Not yet documented.

int8_t scu_dma_level_unused_get(void)

Determines which level is unused.

Return

The first unused level number in ascending order.