8#ifndef __LIBDRAGON_DMA_H
9#define __LIBDRAGON_DMA_H
39#define PI_DRAM_ADDR ((volatile uint32_t*)0xA4600000)
40#define PI_CART_ADDR ((volatile uint32_t*)0xA4600004)
41#define PI_RD_LEN ((volatile uint32_t*)0xA4600008)
42#define PI_WR_LEN ((volatile uint32_t*)0xA460000C)
43#define PI_STATUS ((volatile uint32_t*)0xA4600010)
63void dma_write_raw_async(
const void *ram_address,
unsigned long pi_address,
unsigned long len);
83void dma_write(
const void * ram_address,
unsigned long pi_address,
unsigned long len);
106void dma_read_raw_async(
void *ram_address,
unsigned long pi_address,
unsigned long len);
135void dma_read_async(
void *ram_pointer,
unsigned long pi_address,
unsigned long len);
155void dma_read(
void * ram_address,
unsigned long pi_address,
unsigned long len);
177uint32_t
io_read(uint32_t pi_address);
196void io_write(uint32_t pi_address, uint32_t data);
226__attribute__((deprecated(
"use dma_wait instead")))
void dma_read_async(void *ram_pointer, unsigned long pi_address, unsigned long len)
Start reading data from a peripheral through PI DMA.
Definition dma.c:150
void dma_write(const void *ram_address, unsigned long pi_address, unsigned long len)
Write to a peripheral.
Definition dma.c:225
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:86
uint32_t io_read(uint32_t pi_address)
Read a 32 bit integer from a peripheral using the CPU.
Definition dma.c:232
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:218
bool io_accessible(uint32_t pi_address)
Check whether the specified PI address can be accessed doing I/O from CPU.
Definition dma.c:36
void dma_wait(void)
Wait until an async DMA or I/O transfer is finished.
Definition dma.c:212
volatile int dma_busy(void)
Return whether the DMA controller is currently busy.
Definition dma.c:63
void io_write(uint32_t pi_address, uint32_t data)
Write a 32 bit integer to a peripheral using the CPU.
Definition dma.c:243
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:68