6#ifndef __LIBDRAGON_DMA_H
7#define __LIBDRAGON_DMA_H
37#define PI_DRAM_ADDR ((volatile uint32_t*)0xA4600000)
38#define PI_CART_ADDR ((volatile uint32_t*)0xA4600004)
39#define PI_RD_LEN ((volatile uint32_t*)0xA4600008)
40#define PI_WR_LEN ((volatile uint32_t*)0xA460000C)
41#define PI_STATUS ((volatile uint32_t*)0xA4600010)
61void dma_write_raw_async(
const void *ram_address,
unsigned long pi_address,
unsigned long len);
81void dma_write(
const void * ram_address,
unsigned long pi_address,
unsigned long len);
104void dma_read_raw_async(
void *ram_address,
unsigned long pi_address,
unsigned long len);
133void dma_read_async(
void *ram_address,
unsigned long pi_address,
unsigned long len);
153void dma_read(
void * ram_address,
unsigned long pi_address,
unsigned long len);
175uint32_t
io_read(uint32_t pi_address);
194void io_write(uint32_t pi_address, uint32_t data);
224__attribute__((deprecated(
"use dma_wait instead")))
void dma_write(const void *ram_address, unsigned long pi_address, unsigned long len)
Write to a peripheral.
Definition dma.c:223
void dma_write_raw_async(const void *ram_address, unsigned long pi_address, unsigned long len)
Start writing data to a peripheral through PI DMA (low-level)
Definition dma.c:84
uint32_t io_read(uint32_t pi_address)
Read a 32 bit integer from a peripheral using the CPU.
Definition dma.c:230
void dma_read(void *ram_address, unsigned long pi_address, unsigned long len)
Read data from a peripheral through PI DMA, waiting for completion.
Definition dma.c:216
bool io_accessible(uint32_t pi_address)
Check whether the specified PI address can be accessed doing I/O from CPU.
Definition dma.c:34
void dma_read_async(void *ram_address, unsigned long pi_address, unsigned long len)
Start reading data from a peripheral through PI DMA.
Definition dma.c:148
void dma_wait(void)
Wait until an async DMA or I/O transfer is finished.
Definition dma.c:210
volatile int dma_busy(void)
Return whether the DMA controller is currently busy.
Definition dma.c:61
void io_write(uint32_t pi_address, uint32_t data)
Write a 32 bit integer to a peripheral using the CPU.
Definition dma.c:241
void dma_read_raw_async(void *ram_address, unsigned long pi_address, unsigned long len)
Start reading data from a peripheral through PI DMA (low-level)
Definition dma.c:66