Main Page   Modules   Data Structures   File List   Globals  

msh_dma.h File Reference

DMA functions. More...


Data Structures

struct  _dma_t

Defines

#define dma(channel, dst, src, length, attr)   DMA(channel, dst, src, length, attr)
#define set_dma_src(channel, src)   SET_DMA_SRC(channel, src)
#define set_dma_dst(channel, dst)   SET_DMA_DST(channel, dst)
#define set_dma_cnt_l(channel, cnt_l)   SET_DMA_CNT_L(channel, cnt_l)
#define set_dma_cnt_h(channel, cnt_h)   SET_DMA_CNT_H(channel, cnt_h)
#define set_dma_irq(channel, irq)   SET_DMA_IRQ(channel, irq)
#define get_dma_irq(channel)   GET_DMA_IRQ(channel)
#define dmemcpy(channel, dst, src, size)   DMEMCPY(channel, dst, src, size)


Detailed Description


Define Documentation

#define DMA channel,
dst,
src,
length,
attr   
 

Value:

{GET_DMA_DST(channel) = (u32)(dst); \
    GET_DMA_SRC(channel) = (u32)(src); \
    GET_DMA_CNT_L(channel) = (length); \
    GET_DMA_CNT_H(channel) = (attr);}

#define SET_DMA_IRQ channel,
irq   
 

Value:

{GET_DMA_CNT_H(channel) &= _DMA_IRQ_MASK; \
    GET_DMA_CNT_H(channel) |= (irq) << _DMA_IRQ_POS;}

#define DMEMCPY channel,
dst,
src,
size   
 

Value:

{if ((channel) <= 3) { \
        DMACPY16(channel, dst, src, (size) >> 1) \
    } else { \
        memcpy(dst, src, size); \
    }}

#define DMASET16 channel,
dst,
val,
size   
 

Value:

{_dmaset16_value = (val); \
    DMA(channel, dst, &_dmaset16_value, size, DMA_SRC_UNMOD | DMA_SIZE_16 | DMA_ENABLE | DMA_START_NOW);}

#define DMASET32 channel,
dst,
val,
size   
 

Value:

{_dmaset32_value = (val); \
    DMA(channel, dst, &_dmaset32_value, size, DMA_SRC_UNMOD | DMA_SIZE_32 | DMA_ENABLE | DMA_START_NOW);}

#define dma channel,
dst,
src,
length,
attr       DMA(channel, dst, src, length, attr)
 

Parameters:
channel  u8 [0..3] DMA Channel
dst  void* Destination Address
src  void* Source Address
length  u16 Number of 16/32 bit values to copy
attr  u16 [DMA] DMA Control Attributes
Add multiple DMA attributes using the bitwise OR operator.

DMA Attribute defines:
 */
#define DMA_DST_INC
#define DMA_DST_DEC
#define DMA_DST_UNMOD
#define DMA_DST_INCRL

#define DMA_SRC_INC
#define DMA_SRC_DEC
#define DMA_SRC_UNMOD

#define DMA_REPEAT

#define DMA_SIZE_16
#define DMA_SIZE_32

#define DMA_START_NOW
#define DMA_START_VBL
#define DMA_START_HBL
#define DMA_START_FIFO

#define DMA_IRQ

#define DMA_ENABLE

#define set_dma_src channel,
src       SET_DMA_SRC(channel, src)
 

Parameters:
channel  u8 [0..3] DMA Channel
src  void* Source Address

#define set_dma_dst channel,
dst       SET_DMA_DST(channel, dst)
 

Parameters:
channel  u8 [0..3] DMA Channel
dst  void* Destination Address

#define set_dma_cnt_l channel,
cnt_l       SET_DMA_CNT_L(channel, cnt_l)
 

Parameters:
channel  u8 [0..3] DMA Channel
cnt_l  u16 Number of 16/32 bit values to copy

#define set_dma_cnt_h channel,
cnt_h       SET_DMA_CNT_H(channel, cnt_h)
 

Parameters:
channel  u8 [0..3] DMA Channel
cnt_h  u16 [DMA] DMA Control Attributes
Add multiple DMA attributes using the bitwise OR operator.

DMA Attribute defines:
 */
#define DMA_DST_INC
#define DMA_DST_DEC
#define DMA_DST_UNMOD
#define DMA_DST_INCRL

#define DMA_SRC_INC
#define DMA_SRC_DEC
#define DMA_SRC_UNMOD

#define DMA_REPEAT

#define DMA_SIZE_16
#define DMA_SIZE_32

#define DMA_START_NOW
#define DMA_START_VBL
#define DMA_START_HBL
#define DMA_START_FIFO

#define DMA_IRQ

#define DMA_ENABLE

#define set_dma_irq channel,
irq       SET_DMA_IRQ(channel, irq)
 

Parameters:
channel  u8 [0..3] DMA Channel
irq  bool [TRUE or FALSE] Enable/Disable IRQ

#define get_dma_irq channel       GET_DMA_IRQ(channel)
 

Parameters:
channel  u8 [0..3] DMA Channel
Returns:
bool [TRUE or FALSE] Enable/Disable IRQ

#define dmemcpy channel,
dst,
src,
size       DMEMCPY(channel, dst, src, size)
 

Parameters:
channel  u8 [CPY] Copy type
dst  void* Destination Address
src  void* Source Address
size  u32 Number of bytes to copy
Copies data using a DMA channel or using memcpy() if the channel is set to CPY_MEMCPY. size must be a multiple of 2 if using DMA.

dmemcpy() type defines:
These are Mushroom specific, not GBA values.
 */
#define CPY_DMA0
#define CPY_DMA1
#define CPY_DMA2
#define CPY_DMA3
#define CPY_MEMCPY


Generated on Wed May 19 21:45:08 2004 for Mushroom GBALib by doxygen 1.2.18