rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
General Purpose DMA

Enumerations

enum  rflpc_dma_channel_t {
  RFLPC_DMAC0,
  RFLPC_DMAC1,
  RFLPC_DMAC2,
  RFLPC_DMAC3,
  RFLPC_DMAC4,
  RFLPC_DMAC5,
  RFLPC_DMAC6,
  RFLPC_DMAC7
}
 Enum to identify DMA channels.
 

Functions

void rflpc_dma_init (void)
 Inits the DMA Peripheral. More...
 
int rflpc_dma_channel_ready (rflpc_dma_channel_t channel)
 Tells if a DMA channel is ready to be used. More...
 
int rflpc_dma_start (rflpc_dma_channel_t channel, void *dest, const void *src, uint32_t size)
 Starts a DMA copy. More...
 

Detailed Description

Function Documentation

int rflpc_dma_channel_ready ( rflpc_dma_channel_t  channel)

Tells if a DMA channel is ready to be used.

Returns
true if the DMA channel is ready (not already doing something)
void rflpc_dma_init ( void  )

Inits the DMA Peripheral.

Note
The DMA is enabled in little endian mode by default
int rflpc_dma_start ( rflpc_dma_channel_t  channel,
void *  dest,
const void *  src,
uint32_t  size 
)

Starts a DMA copy.

The DMA channel must be ready before starting a DMA copy

Parameters
channelThe channel to use.
destdestination pointer
srcsource data
sizenumber of bytes to transfert (limited to 0xFFF bytes)
Returns
true if the copy has been started, false otherwise
Warning
In the current implementation, size is limited by 0xFFF because only one DMA request is generated.
Todo:
Handle size > 0xFFF