DMADRV
[EM_Drivers]

DMADRV Serial Peripheral Interface module, see DMADRV Direct Memory Access page for detailed documentation. More...

Collaboration diagram for DMADRV:

Defines

#define ECODE_EMDRV_DMADRV_OK   ( ECODE_OK )
 Success return value.
#define ECODE_EMDRV_DMADRV_PARAM_ERROR   ( ECODE_EMDRV_DMADRV_BASE | 0x00000001 )
 Illegal input parameter.
#define ECODE_EMDRV_DMADRV_NOT_INITIALIZED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000002 )
 DMA is not initialized.
#define ECODE_EMDRV_DMADRV_ALREADY_INITIALIZED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000003 )
 DMA has already been initialized.
#define ECODE_EMDRV_DMADRV_CHANNELS_EXHAUSTED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000004 )
 No DMA channels available.
#define ECODE_EMDRV_DMADRV_IN_USE   ( ECODE_EMDRV_DMADRV_BASE | 0x00000005 )
 DMA is in use.
#define ECODE_EMDRV_DMADRV_ALREADY_FREED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000006 )
 DMA channel was free.
#define ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000007 )
 The channel is not reserved.
#define DMADRV_MAX_XFER_COUNT   ((int)((_DMA_CTRL_N_MINUS_1_MASK >> _DMA_CTRL_N_MINUS_1_SHIFT) + 1))
 Maximum length of one DMA transfer.
#define DMADRV_MAX_XFER_COUNT   ((int)((_LDMA_CH_CTRL_XFERCNT_MASK >> _LDMA_CH_CTRL_XFERCNT_SHIFT) + 1))
 Maximum length of one DMA transfer.
#define EMDRV_DMADRV_DMA_CH_COUNT   4
 DMADRV DMA interrupt priority configuration option.
#define EMDRV_DMADRV_USE_NATIVE_API
 DMADRV native API configuration option.

Typedefs

typedef bool(* DMADRV_Callback_t )(unsigned int channel, unsigned int sequenceNo, void *userParam)
 DMADRV transfer completion callback function.

Enumerations

enum  DMADRV_Peripheralsignal_t {
  dmadrvPeripheralSignal_NONE = 0,
  dmadrvPeripheralSignal_ADC0_SCAN = ((8 << 16) + 1),
  dmadrvPeripheralSignal_ADC0_SINGLE = ((8 << 16) + 0),
  dmadrvPeripheralSignal_AES_DATARD = ((49 << 16) + 2),
  dmadrvPeripheralSignal_AES_DATAWR = ((49 << 16) + 0),
  dmadrvPeripheralSignal_AES_KEYWR = ((49 << 16) + 3),
  dmadrvPeripheralSignal_AES_XORDATAWR = ((49 << 16) + 1),
  dmadrvPeripheralSignal_DAC0_CH0 = ((10 << 16) + 0),
  dmadrvPeripheralSignal_DAC0_CH1 = ((10 << 16) + 1),
  dmadrvPeripheralSignal_EBI_DDEMPTY = ((51 << 16) + 3),
  dmadrvPeripheralSignal_EBI_PXL0EMPTY = ((51 << 16) + 0),
  dmadrvPeripheralSignal_EBI_PXL1EMPTY = ((51 << 16) + 1),
  dmadrvPeripheralSignal_EBI_PXLFULL = ((51 << 16) + 2),
  dmadrvPeripheralSignal_I2C0_RXDATAV = ((20 << 16) + 0),
  dmadrvPeripheralSignal_I2C0_TXBL = ((20 << 16) + 1),
  dmadrvPeripheralSignal_I2C1_RXDATAV = ((21 << 16) + 0),
  dmadrvPeripheralSignal_I2C1_TXBL = ((21 << 16) + 1),
  dmadrvPeripheralSignal_LESENSE_BUFDATAV = ((50 << 16) + 0),
  dmadrvPeripheralSignal_LEUART0_RXDATAV = ((16 << 16) + 0),
  dmadrvPeripheralSignal_LEUART0_TXBL = ((16 << 16) + 1),
  dmadrvPeripheralSignal_LEUART0_TXEMPTY = ((16 << 16) + 2),
  dmadrvPeripheralSignal_LEUART1_RXDATAV = ((17 << 16) + 0),
  dmadrvPeripheralSignal_LEUART1_TXBL = ((17 << 16) + 1),
  dmadrvPeripheralSignal_LEUART1_TXEMPTY = ((17 << 16) + 2),
  dmadrvPeripheralSignal_MSC_WDATA = ((48 << 16) + 0),
  dmadrvPeripheralSignal_TIMER0_CC0 = ((24 << 16) + 1),
  dmadrvPeripheralSignal_TIMER0_CC1 = ((24 << 16) + 2),
  dmadrvPeripheralSignal_TIMER0_CC2 = ((24 << 16) + 3),
  dmadrvPeripheralSignal_TIMER0_UFOF = ((24 << 16) + 0),
  dmadrvPeripheralSignal_TIMER1_CC0 = ((25 << 16) + 1),
  dmadrvPeripheralSignal_TIMER1_CC1 = ((25 << 16) + 2),
  dmadrvPeripheralSignal_TIMER1_CC2 = ((25 << 16) + 3),
  dmadrvPeripheralSignal_TIMER1_UFOF = ((25 << 16) + 0),
  dmadrvPeripheralSignal_TIMER2_CC0 = ((26 << 16) + 1),
  dmadrvPeripheralSignal_TIMER2_CC1 = ((26 << 16) + 2),
  dmadrvPeripheralSignal_TIMER2_CC2 = ((26 << 16) + 3),
  dmadrvPeripheralSignal_TIMER2_UFOF = ((26 << 16) + 0),
  dmadrvPeripheralSignal_TIMER3_CC0 = ((27 << 16) + 1),
  dmadrvPeripheralSignal_TIMER3_CC1 = ((27 << 16) + 2),
  dmadrvPeripheralSignal_TIMER3_CC2 = ((27 << 16) + 3),
  dmadrvPeripheralSignal_TIMER3_UFOF = ((27 << 16) + 0),
  dmadrvPeripheralSignal_UART0_RXDATAV = ((44 << 16) + 0),
  dmadrvPeripheralSignal_UART0_TXBL = ((44 << 16) + 1),
  dmadrvPeripheralSignal_UART0_TXEMPTY = ((44 << 16) + 2),
  dmadrvPeripheralSignal_UART1_RXDATAV = ((45 << 16) + 0),
  dmadrvPeripheralSignal_UART1_TXBL = ((45 << 16) + 1),
  dmadrvPeripheralSignal_UART1_TXEMPTY = ((45 << 16) + 2),
  dmadrvPeripheralSignal_USART0_RXDATAV = ((12 << 16) + 0),
  dmadrvPeripheralSignal_USART0_TXBL = ((12 << 16) + 1),
  dmadrvPeripheralSignal_USART0_TXEMPTY = ((12 << 16) + 2),
  dmadrvPeripheralSignal_USART1_RXDATAV = ((13 << 16) + 0),
  dmadrvPeripheralSignal_USART1_RXDATAVRIGHT = ((13 << 16) + 3),
  dmadrvPeripheralSignal_USART1_TXBL = ((13 << 16) + 1),
  dmadrvPeripheralSignal_USART1_TXBLRIGHT = ((13 << 16) + 4),
  dmadrvPeripheralSignal_USART1_TXEMPTY = ((13 << 16) + 2),
  dmadrvPeripheralSignal_USART2_RXDATAV = ((14 << 16) + 0),
  dmadrvPeripheralSignal_USART2_RXDATAVRIGHT = ((14 << 16) + 3),
  dmadrvPeripheralSignal_USART2_TXBL = ((14 << 16) + 1),
  dmadrvPeripheralSignal_USART2_TXBLRIGHT = ((14 << 16) + 4),
  dmadrvPeripheralSignal_USART2_TXEMPTY = ((14 << 16) + 2)
}
 

Peripherals that can trigger UDMA transfers.

More...
enum  DMADRV_Datasize_t {
  dmadrvDataSize1 = dmaDataSize1,
  dmadrvDataSize2 = dmaDataSize2,
  dmadrvDataSize4 = dmaDataSize4
}
 

Data size of one UDMA transfer item.

More...
enum  DMADRV_PeripheralSignal_t { dmadrvPeripheralSignal_NONE = 0 }
 

Peripherals that can trigger LDMA transfers.

More...
enum  DMADRV_DataSize_t {
  dmadrvDataSize1 = dmaDataSize1,
  dmadrvDataSize2 = dmaDataSize2,
  dmadrvDataSize4 = dmaDataSize4
}
 

Data size of one LDMA transfer item.

More...

Functions

Ecode_t DMADRV_AllocateChannel (unsigned int *channelId, void *capabilities)
 Allocate (reserve) a DMA channel.
Ecode_t DMADRV_DeInit (void)
 Deinitialize DMADRV.
Ecode_t DMADRV_FreeChannel (unsigned int channelId)
 Free an allocate (reserved) DMA channel.
Ecode_t DMADRV_Init (void)
 Initialize DMADRV.
Ecode_t DMADRV_MemoryPeripheral (unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
 Start a memory to peripheral DMA transfer.
Ecode_t DMADRV_PeripheralMemory (unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src, bool dstInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
 Start a peripheral to memory DMA transfer.
Ecode_t DMADRV_MemoryPeripheralPingPong (unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src0, void *src1, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
 Start a memory to peripheral ping-pong DMA transfer.
Ecode_t DMADRV_PeripheralMemoryPingPong (unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst0, void *dst1, void *src, bool dstInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
 Start a peripheral to memory ping-pong DMA transfer.
Ecode_t DMADRV_LdmaStartTransfer (int channelId, LDMA_TransferCfg_t *transfer, LDMA_Descriptor_t *descriptor, DMADRV_Callback_t callback, void *cbUserParam)
 Start a LDMA transfer.
Ecode_t DMADRV_StopTransfer (unsigned int channelId)
 Stop an ongoing DMA transfer.
Ecode_t DMADRV_TransferActive (unsigned int channelId, bool *active)
 Check if a transfer is running.
Ecode_t DMADRV_TransferCompletePending (unsigned int channelId, bool *pending)
 Check if a transfer complete is pending.
Ecode_t DMADRV_TransferDone (unsigned int channelId, bool *done)
 Check if a transfer has completed.
Ecode_t DMADRV_TransferRemainingCount (unsigned int channelId, int *remaining)
 Get number of items remaining in a transfer.

Detailed Description

DMADRV Serial Peripheral Interface module, see DMADRV Direct Memory Access page for detailed documentation.


Define Documentation

#define DMADRV_MAX_XFER_COUNT   ((int)((_LDMA_CH_CTRL_XFERCNT_MASK >> _LDMA_CH_CTRL_XFERCNT_SHIFT) + 1))

Maximum length of one DMA transfer.

Definition at line 309 of file dmadrv.h.

#define DMADRV_MAX_XFER_COUNT   ((int)((_DMA_CTRL_N_MINUS_1_MASK >> _DMA_CTRL_N_MINUS_1_SHIFT) + 1))

Maximum length of one DMA transfer.

Definition at line 309 of file dmadrv.h.

#define ECODE_EMDRV_DMADRV_ALREADY_FREED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000006 )

DMA channel was free.

Definition at line 59 of file dmadrv.h.

Referenced by DMADRV_FreeChannel().

#define ECODE_EMDRV_DMADRV_ALREADY_INITIALIZED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000003 )

DMA has already been initialized.

Definition at line 56 of file dmadrv.h.

Referenced by DMADRV_Init().

#define ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000007 )
#define ECODE_EMDRV_DMADRV_CHANNELS_EXHAUSTED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000004 )

No DMA channels available.

Definition at line 57 of file dmadrv.h.

Referenced by DMADRV_AllocateChannel().

#define ECODE_EMDRV_DMADRV_IN_USE   ( ECODE_EMDRV_DMADRV_BASE | 0x00000005 )

DMA is in use.

Definition at line 58 of file dmadrv.h.

Referenced by DMADRV_DeInit().

#define ECODE_EMDRV_DMADRV_NOT_INITIALIZED   ( ECODE_EMDRV_DMADRV_BASE | 0x00000002 )
#define ECODE_EMDRV_DMADRV_OK   ( ECODE_OK )
#define ECODE_EMDRV_DMADRV_PARAM_ERROR   ( ECODE_EMDRV_DMADRV_BASE | 0x00000001 )
#define EMDRV_DMADRV_DMA_CH_COUNT   4

DMADRV DMA interrupt priority configuration option.

Set DMA interrupt priority. Range is 0..7, 0 is highest priority. DMADRV channel count configuration option. Number of DMA channels to support. A lower DMA channel count will reduce ram memory footprint.

Definition at line 37 of file dmadrv_config.h.

Referenced by DMADRV_AllocateChannel(), DMADRV_DeInit(), DMADRV_FreeChannel(), DMADRV_Init(), DMADRV_LdmaStartTransfer(), DMADRV_StopTransfer(), DMADRV_TransferActive(), DMADRV_TransferCompletePending(), DMADRV_TransferDone(), and DMADRV_TransferRemainingCount().

#define EMDRV_DMADRV_USE_NATIVE_API

DMADRV native API configuration option.

Use the native emlib api of the DMA controller, but still use DMADRV housekeeping functions as AllocateChannel/FreeChannel etc.

Definition at line 43 of file dmadrv_config.h.


Typedef Documentation

typedef bool(* DMADRV_Callback_t)(unsigned int channel, unsigned int sequenceNo, void *userParam)

DMADRV transfer completion callback function.

The callback function is called when a transfer has completed.

Parameters:
[in] channel The DMA channel number.
[in] sequenceNo The number of times the callback had been called. Useful on long chains of linked transfers or on endless ping-pong type transfers.
[in] userParam Optional user parameter supplied on DMA invocation.
Returns:
When doing ping-pong transfers, return true to continue or false to stop transfers.

Definition at line 83 of file dmadrv.h.


Enumeration Type Documentation

Data size of one LDMA transfer item.

Enumerator:
dmadrvDataSize1 

Byte.

dmadrvDataSize2 

Halfword.

dmadrvDataSize4 

Word.

Definition at line 448 of file dmadrv.h.

Data size of one UDMA transfer item.

Enumerator:
dmadrvDataSize1 

Byte.

dmadrvDataSize2 

Halfword.

dmadrvDataSize4 

Word.

Definition at line 293 of file dmadrv.h.

Peripherals that can trigger LDMA transfers.

Enumerator:
dmadrvPeripheralSignal_NONE 

No peripheral selected for DMA triggering.

Definition at line 316 of file dmadrv.h.

Peripherals that can trigger UDMA transfers.

Enumerator:
dmadrvPeripheralSignal_NONE 

No peripheral selected for DMA triggering.

dmadrvPeripheralSignal_ADC0_SCAN 

Trig on ADC0_SCAN.

dmadrvPeripheralSignal_ADC0_SINGLE 

Trig on ADC0_SINGLE.

dmadrvPeripheralSignal_AES_DATARD 

Trig on AES_DATARD.

dmadrvPeripheralSignal_AES_DATAWR 

Trig on AES_DATAWR.

dmadrvPeripheralSignal_AES_KEYWR 

Trig on AES_KEYWR.

dmadrvPeripheralSignal_AES_XORDATAWR 

Trig on AES_XORDATAWR.

dmadrvPeripheralSignal_DAC0_CH0 

Trig on DAC0_CH0.

dmadrvPeripheralSignal_DAC0_CH1 

Trig on DAC0_CH1.

dmadrvPeripheralSignal_EBI_DDEMPTY 

Trig on EBI_DDEMPTY.

dmadrvPeripheralSignal_EBI_PXL0EMPTY 

Trig on EBI_PXL0EMPTY.

dmadrvPeripheralSignal_EBI_PXL1EMPTY 

Trig on EBI_PXL1EMPTY.

dmadrvPeripheralSignal_EBI_PXLFULL 

Trig on EBI_PXLFULL.

dmadrvPeripheralSignal_I2C0_RXDATAV 

Trig on I2C0_RXDATAV.

dmadrvPeripheralSignal_I2C0_TXBL 

Trig on I2C0_TXBL.

dmadrvPeripheralSignal_I2C1_RXDATAV 

Trig on I2C1_RXDATAV.

dmadrvPeripheralSignal_I2C1_TXBL 

Trig on I2C1_TXBL.

dmadrvPeripheralSignal_LESENSE_BUFDATAV 

Trig on LESENSE_BUFDATAV.

dmadrvPeripheralSignal_LEUART0_RXDATAV 

Trig on LEUART0_RXDATAV.

dmadrvPeripheralSignal_LEUART0_TXBL 

Trig on LEUART0_TXBL.

dmadrvPeripheralSignal_LEUART0_TXEMPTY 

Trig on LEUART0_TXEMPTY.

dmadrvPeripheralSignal_LEUART1_RXDATAV 

Trig on LEUART1_RXDATAV.

dmadrvPeripheralSignal_LEUART1_TXBL 

Trig on LEUART1_TXBL.

dmadrvPeripheralSignal_LEUART1_TXEMPTY 

Trig on LEUART1_TXEMPTY.

dmadrvPeripheralSignal_MSC_WDATA 

Trig on MSC_WDATA.

dmadrvPeripheralSignal_TIMER0_CC0 

Trig on TIMER0_CC0.

dmadrvPeripheralSignal_TIMER0_CC1 

Trig on TIMER0_CC1.

dmadrvPeripheralSignal_TIMER0_CC2 

Trig on TIMER0_CC2.

dmadrvPeripheralSignal_TIMER0_UFOF 

Trig on TIMER0_UFOF.

dmadrvPeripheralSignal_TIMER1_CC0 

Trig on TIMER1_CC0.

dmadrvPeripheralSignal_TIMER1_CC1 

Trig on TIMER1_CC1.

dmadrvPeripheralSignal_TIMER1_CC2 

Trig on TIMER1_CC2.

dmadrvPeripheralSignal_TIMER1_UFOF 

Trig on TIMER1_UFOF.

dmadrvPeripheralSignal_TIMER2_CC0 

Trig on TIMER2_CC0.

dmadrvPeripheralSignal_TIMER2_CC1 

Trig on TIMER2_CC1.

dmadrvPeripheralSignal_TIMER2_CC2 

Trig on TIMER2_CC2.

dmadrvPeripheralSignal_TIMER2_UFOF 

Trig on TIMER2_UFOF.

dmadrvPeripheralSignal_TIMER3_CC0 

Trig on TIMER3_CC0.

dmadrvPeripheralSignal_TIMER3_CC1 

Trig on TIMER3_CC1.

dmadrvPeripheralSignal_TIMER3_CC2 

Trig on TIMER3_CC2.

dmadrvPeripheralSignal_TIMER3_UFOF 

Trig on TIMER3_UFOF.

dmadrvPeripheralSignal_UART0_RXDATAV 

Trig on UART0_RXDATAV.

dmadrvPeripheralSignal_UART0_TXBL 

Trig on UART0_TXBL.

dmadrvPeripheralSignal_UART0_TXEMPTY 

Trig on UART0_TXEMPTY.

dmadrvPeripheralSignal_UART1_RXDATAV 

Trig on UART1_RXDATAV.

dmadrvPeripheralSignal_UART1_TXBL 

Trig on UART1_TXBL.

dmadrvPeripheralSignal_UART1_TXEMPTY 

Trig on UART1_TXEMPTY.

dmadrvPeripheralSignal_USART0_RXDATAV 

Trig on USART0_RXDATAV.

dmadrvPeripheralSignal_USART0_TXBL 

Trig on USART0_TXBL.

dmadrvPeripheralSignal_USART0_TXEMPTY 

Trig on USART0_TXEMPTY.

dmadrvPeripheralSignal_USART1_RXDATAV 

Trig on USART1_RXDATAV.

dmadrvPeripheralSignal_USART1_RXDATAVRIGHT 

Trig on USART1_RXDATAVRIGHT.

dmadrvPeripheralSignal_USART1_TXBL 

Trig on USART1_TXBL.

dmadrvPeripheralSignal_USART1_TXBLRIGHT 

Trig on USART1_TXBLRIGHT.

dmadrvPeripheralSignal_USART1_TXEMPTY 

Trig on USART1_TXEMPTY.

dmadrvPeripheralSignal_USART2_RXDATAV 

Trig on USART2_RXDATAV.

dmadrvPeripheralSignal_USART2_RXDATAVRIGHT 

Trig on USART2_RXDATAVRIGHT.

dmadrvPeripheralSignal_USART2_TXBL 

Trig on USART2_TXBL.

dmadrvPeripheralSignal_USART2_TXBLRIGHT 

Trig on USART2_TXBLRIGHT.

dmadrvPeripheralSignal_USART2_TXEMPTY 

Trig on USART2_TXEMPTY.

Definition at line 97 of file dmadrv.h.


Function Documentation

Ecode_t DMADRV_AllocateChannel ( unsigned int *  channelId,
void *  capabilities 
)

Allocate (reserve) a DMA channel.

Parameters:
[out] channelId The channel Id assigned by DMADRV.
[in] capabilities Not used.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 131 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CHANNELS_EXHAUSTED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_Init(), and UARTDRV_Init().

Here is the caller graph for this function:

Ecode_t DMADRV_DeInit ( void   ) 

Deinitialize DMADRV.

If no DMA channels are currently allocated, it will disable DMA hardware and mask associated interrupts.

Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 176 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_IN_USE, ECODE_EMDRV_DMADRV_OK, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_DeInit(), and UARTDRV_DeInit().

Here is the caller graph for this function:

Ecode_t DMADRV_FreeChannel ( unsigned int  channelId  ) 

Free an allocate (reserved) DMA channel.

Parameters:
[in] channelId The channel Id to free.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 223 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_ALREADY_FREED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_DeInit(), and UARTDRV_DeInit().

Here is the caller graph for this function:

Ecode_t DMADRV_Init ( void   ) 

Initialize DMADRV.

The DMA hw is initialized.

Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 258 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_ALREADY_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_Init(), and UARTDRV_Init().

Here is the caller graph for this function:

Ecode_t DMADRV_LdmaStartTransfer ( int  channelId,
LDMA_TransferCfg_t *  transfer,
LDMA_Descriptor_t *  descriptor,
DMADRV_Callback_t  callback,
void *  cbUserParam 
)

Start a LDMA transfer.

This function can only be used on LDMA when EMDRV_DMADRV_USE_NATIVE_API is defined. It is a wrapper around similar emlib ldma function.

Parameters:
[in] channelId The channel Id to use.
[in] transfer DMA transfer configuration data structure.
[in] descriptor DMA transfer descriptor, can be an array of descriptors linked together.
[in] callback Optional callback function for signalling completion. May be NULL if not needed.
[in] cbUserParam Optional user parameter to feed to the callback function. May be NULL if not needed.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 330 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Ecode_t DMADRV_MemoryPeripheral ( unsigned int  channelId,
DMADRV_PeripheralSignal_t  peripheralSignal,
void *  dst,
void *  src,
bool  srcInc,
int  len,
DMADRV_DataSize_t  size,
DMADRV_Callback_t  callback,
void *  cbUserParam 
)

Start a memory to peripheral DMA transfer.

Parameters:
[in] channelId Not used
[in] peripheralSignal Selects which peripheral/peripheralsignal to use.
[in] dst Destination (peripheral register) memory address.
[in] src Source memory address.
[in] srcInc Set to true to enable source address increment (increment is according to size parameter).
[in] len Number if items (of size size) to transfer.
[in] size Item size, byte, halfword or word.
[in] callback Function to call on dma completion, use NULL if not needed.
[in] cbUserParam Optional user parameter to feed to the callback function. Use NULL if not needed.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 401 of file dmadrv.c.

Ecode_t DMADRV_MemoryPeripheralPingPong ( unsigned int  channelId,
DMADRV_PeripheralSignal_t  peripheralSignal,
void *  dst,
void *  src0,
void *  src1,
bool  srcInc,
int  len,
DMADRV_DataSize_t  size,
DMADRV_Callback_t  callback,
void *  cbUserParam 
)

Start a memory to peripheral ping-pong DMA transfer.

Parameters:
[in] channelId Not used
[in] peripheralSignal Selects which peripheral/peripheralsignal to use.
[in] dst Destination (peripheral register) memory address.
[in] src0 Source memory address of first (ping) buffer.
[in] src1 Source memory address of second (pong) buffer.
[in] srcInc Set to true to enable source address increment (increment is according to size parameter).
[in] len Number if items (of size size) to transfer.
[in] size Item size, byte, halfword or word.
[in] callback Function to call on dma completion, use NULL if not needed.
[in] cbUserParam Optional user parameter to feed to the callback function. Use NULL if not needed.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 468 of file dmadrv.c.

Ecode_t DMADRV_PeripheralMemory ( unsigned int  channelId,
DMADRV_PeripheralSignal_t  peripheralSignal,
void *  dst,
void *  src,
bool  dstInc,
int  len,
DMADRV_DataSize_t  size,
DMADRV_Callback_t  callback,
void *  cbUserParam 
)

Start a peripheral to memory DMA transfer.

Parameters:
[in] channelId Not used
[in] peripheralSignal Selects which peripheral/peripheralsignal to use.
[in] dst Destination memory address.
[in] src Source memory (peripheral register) address.
[in] dstInc Set to true to enable destination address increment (increment is according to size parameter).
[in] len Number if items (of size size) to transfer.
[in] size Item size, byte, halfword or word.
[in] callback Function to call on dma completion, use NULL if not needed.
[in] cbUserParam Optional user parameter to feed to the callback function. Use NULL if not needed.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 534 of file dmadrv.c.

Ecode_t DMADRV_PeripheralMemoryPingPong ( unsigned int  channelId,
DMADRV_PeripheralSignal_t  peripheralSignal,
void *  dst0,
void *  dst1,
void *  src,
bool  dstInc,
int  len,
DMADRV_DataSize_t  size,
DMADRV_Callback_t  callback,
void *  cbUserParam 
)

Start a peripheral to memory ping-pong DMA transfer.

Parameters:
[in] channelId Not used
[in] peripheralSignal Selects which peripheral/peripheralsignal to use.
[in] dst0 Destination memory address of first (ping) buffer.
[in] dst1 Destination memory address of second (pong) buffer.
[in] src Source memory (peripheral register) address.
[in] dstInc Set to true to enable destination address increment (increment is according to size parameter).
[in] len Number if items (of size size) to transfer.
[in] size Item size, byte, halfword or word.
[in] callback Function to call on dma completion, use NULL if not needed.
[in] cbUserParam Optional user parameter to feed to the callback function. Use NULL if not needed.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 601 of file dmadrv.c.

Ecode_t DMADRV_StopTransfer ( unsigned int  channelId  ) 

Stop an ongoing DMA transfer.

Parameters:
[in] channelId The channel Id of the transfer to stop.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 640 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_AbortTransfer(), SPIDRV_DeInit(), UARTDRV_Abort(), and UARTDRV_DeInit().

Here is the caller graph for this function:

Ecode_t DMADRV_TransferActive ( unsigned int  channelId,
bool *  active 
)

Check if a transfer is running.

Parameters:
[in] channelId The channel Id of the transfer to check.
[out] active True if transfer is running, false otherwise.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 680 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Ecode_t DMADRV_TransferCompletePending ( unsigned int  channelId,
bool *  pending 
)

Check if a transfer complete is pending.

Will check channel interrupt flag. This assumes that the DMA is configured to giva a completion interrupt.

Parameters:
[in] channelId The channel Id of the transfer to check.
[out] pending True if a transfer complete is pending, false otherwise.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 732 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Ecode_t DMADRV_TransferDone ( unsigned int  channelId,
bool *  done 
)

Check if a transfer has completed.

Note:
This function is meant to be used in a polled environment. Will only work reliable for transfers NOT using completion interrupt. On UDMA it will only work on basic transfers on primary channel.
Parameters:
[in] channelId The channel Id of the transfer to check.
[out] done True if a transfer has completed, false otherwise.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 785 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Ecode_t DMADRV_TransferRemainingCount ( unsigned int  channelId,
int *  remaining 
)

Get number of items remaining in a transfer.

Note:
This function is does not take into account that a DMA transfers with a chain of linked transfers might be ongoing. It will only check the count for the current transfer. On UDMA it will only work on the primary channel.
Parameters:
[in] channelId The channel Id of the transfer to check.
[out] remaining Number of items remaining in the transfer.
Returns:
ECODE_EMDRV_DMADRV_OK on success. On failure an appropriate DMADRV Ecode_t is returned.

Definition at line 851 of file dmadrv.c.

References ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED, ECODE_EMDRV_DMADRV_NOT_INITIALIZED, ECODE_EMDRV_DMADRV_OK, ECODE_EMDRV_DMADRV_PARAM_ERROR, and EMDRV_DMADRV_DMA_CH_COUNT.

Referenced by SPIDRV_AbortTransfer(), SPIDRV_GetTransferStatus(), UARTDRV_Abort(), UARTDRV_GetReceiveStatus(), and UARTDRV_GetTransmitStatus().

Here is the caller graph for this function: