libteak
|
DMA helpers. More...
Functions | |
void | dmaInit (void) |
Initializes the DMA system. | |
s16 | dmaTransferArm9ToDsp (u16 dma_channel, u32 src, void *dst, u16 len) |
Transfer data from the ARM9 memory map to the DSP data memory. | |
s16 | dmaTransferArm9ToDspAsync (u16 dma_channel, u32 src, void *dst, u16 len) |
Starts a transfer of data from the ARM9 memory map to the DSP data memory. | |
s16 | dmaTransferDspToArm9 (u16 dma_channel, const void *src, u32 dst, u16 len) |
Transfer data from DSP data memory to the ARM9 memory map. | |
s16 | dmaTransferDspToArm9Async (u16 dma_channel, const void *src, u32 dst, u16 len) |
Starts a transfer of data from DSP data memory to the ARM9 memory map. | |
static u16 | dmaTransferIsRunning (u16 dma_channel) |
Checks whether a DMA channel is active or not. | |
static void | dmaTransferWaitDone (u16 dma_channel) |
Waits until a DMA channel is no longer active because the copy has finished. | |
DMA helpers.
The DMA registers don't seem to be understood well enough, the functions may be unstable.
s16 dmaTransferArm9ToDsp | ( | u16 | dma_channel, |
u32 | src, | ||
void * | dst, | ||
u16 | len | ||
) |
Transfer data from the ARM9 memory map to the DSP data memory.
This function uses AHBM channel 1.
DMA channel 0 is required to transfer data with the FIFO functions, so it can't be used by this function.
This function can't copy data crossing a 1KB boundary on the ARM9 side because of limitations of the AHBM bus.
dma_channel | The DMA channel to use (1 to 7, 0 isn't allowed). |
src | Source address in the ARM9 memory map. |
dst | Destination address in the DSP data memory. |
len | Length of the copy in DSP words. |
s16 dmaTransferArm9ToDspAsync | ( | u16 | dma_channel, |
u32 | src, | ||
void * | dst, | ||
u16 | len | ||
) |
Starts a transfer of data from the ARM9 memory map to the DSP data memory.
This function uses AHBM channel 1.
DMA channel 0 is required to transfer data with the FIFO functions, so it can't be used by this function.
This function can't copy data crossing a 1KB boundary on the ARM9 side because of limitations of the AHBM bus.
Use dmaTransferIsRunning() to verify if the transfer has finished or not, or dmaTransferWaitDone() to wait until it's done.
dma_channel | The DMA channel to use (1 to 7, 0 isn't allowed). |
src | Source address in the ARM9 memory map. |
dst | Destination address in the DSP data memory. |
len | Length of the copy in DSP words. |
s16 dmaTransferDspToArm9 | ( | u16 | dma_channel, |
const void * | src, | ||
u32 | dst, | ||
u16 | len | ||
) |
Transfer data from DSP data memory to the ARM9 memory map.
This function uses AHBM channel 2.
DMA channel 0 is required to transfer data with the FIFO functions, so it can't be used by this function.
This function can't copy data crossing a 1KB boundary on the ARM9 side because of limitations of the AHBM bus.
dma_channel | The DMA channel to use (1 to 7, 0 isn't allowed). |
src | Source address in the DSP data memory. |
dst | Destination address in the ARM9 memory map. |
len | Length of the copy in DSP words. |
s16 dmaTransferDspToArm9Async | ( | u16 | dma_channel, |
const void * | src, | ||
u32 | dst, | ||
u16 | len | ||
) |
Starts a transfer of data from DSP data memory to the ARM9 memory map.
This function uses AHBM channel 2.
DMA channel 0 is required to transfer data with the FIFO functions, so it can't be used by this function.
This function can't copy data crossing a 1KB boundary on the ARM9 side because of limitations of the AHBM bus.
Use dmaTransferIsRunning() to verify if the transfer has finished or not, or dmaTransferWaitDone() to wait until it's done.
dma_channel | The DMA channel to use (1 to 7, 0 isn't allowed). |
src | Source address in the DSP data memory. |
dst | Destination address in the ARM9 memory map. |
len | Length of the copy in DSP words. |
|
inlinestatic |
Checks whether a DMA channel is active or not.
dma_channel | The DMA channel to check (1 to 7, 0 isn't allowed). |
|
inlinestatic |
Waits until a DMA channel is no longer active because the copy has finished.
dma_channel | The DMA channel to check (1 to 7, 0 isn't allowed). |