orcus
Enumerations | Functions
dma.h File Reference

DMA. More...

#include <stdint.h>

Enumerations

enum  BurstMode { }
 DMA burst mode (RAM->RAM only). More...
 
enum  Peripheral
 MMSP2 peripherals available for DMA transfers.
 

Functions

void dmaConfigureChannelIO (int channel, BurstMode burstMode, int8_t srcIncrement, int8_t destIncrement, Peripheral peripheral)
 Configure a DMA channel for memory-to-peripheral transfer. More...
 
void dmaConfigureChannelMem (int channel, BurstMode burstMode, int8_t srcIncrement, int8_t destIncrement)
 Configure a DMA channel for memory-to-memory transfer. More...
 
bool dmaHasFinished (int channel)
 Check if a DMA channel has finished transferring data. More...
 
bool dmaIsTransferring (int channel)
 Check if a DMA channel is transferring data. More...
 
void dmaStart (int channel, uint16_t length, uint32_t src, uint32_t dest)
 Initiate a DMA transfer. More...
 
void dmaStop (int channel)
 Stop a DMA transfer. More...
 

Enumeration Type Documentation

◆ BurstMode

enum BurstMode
Enumerator
WORDS_4 

Copy one word at a time.

Function Documentation

◆ dmaConfigureChannelIO()

void dmaConfigureChannelIO ( int  channel,
BurstMode  burstMode,
int8_t  srcIncrement,
int8_t  destIncrement,
Peripheral  peripheral 
)

Configure a DMA channel for memory-to-peripheral transfer.

Parameters
channelDMA channel to configure (0 - 15)
burstModeNumber of words to copy at a time
srcIncrementNumber of words to increment source address after each transfer (negative values and zero are permitted)
destIncrementNumber of words to increment destination address after each transfer (negative values and zero are permitted)
peripheralMMSP2 peripheral to write to

◆ dmaConfigureChannelMem()

void dmaConfigureChannelMem ( int  channel,
BurstMode  burstMode,
int8_t  srcIncrement,
int8_t  destIncrement 
)

Configure a DMA channel for memory-to-memory transfer.

Parameters
channelDMA channel to configure (0 - 15)
burstModeNumber of words to copy at a time
srcIncrementNumber of words to increment source address after each transfer (negative values and zero are permitted)
destIncrementNumber of words to increment destination address after each transfer (negative values and zero are permitted)

◆ dmaHasFinished()

bool dmaHasFinished ( int  channel)

Check if a DMA channel has finished transferring data.

Parameters
channelDMA channel to check (0 - 15)

◆ dmaIsTransferring()

bool dmaIsTransferring ( int  channel)

Check if a DMA channel is transferring data.

Parameters
channelDMA channel to check (0 - 15)

◆ dmaStart()

void dmaStart ( int  channel,
uint16_t  length,
uint32_t  src,
uint32_t  dest 
)

Initiate a DMA transfer on a previously configured channel.

Parameters
channelDMA channel to initiate transfer on (0 - 15)
lengthNumber of bytes to transfer (maximum 64K)
srcSource address (aligned to 4 byte word boundary)
dstDestination address (aligned to 4 byte word boundary)
See also
dmaConfigureChanelMem

◆ dmaStop()

void dmaStop ( int  channel)

Stop a DMA transfer.

Parameters
channelDMA channel to stop (0 - 15)