EDMA3 Driver Channel Setup
[EDMA3 Driver Interface Definition]


Defines

#define EDMA3_DRV_DMA_CHANNEL_ANY   1002u
#define EDMA3_DRV_QDMA_CHANNEL_ANY   1003u
#define EDMA3_DRV_TCC_ANY   1004u
#define EDMA3_DRV_LINK_CHANNEL   1005u
#define EDMA3_DRV_QDMA_CHANNEL_0   (EDMA3_MAX_DMA_CH + EDMA3_MAX_PARAM_SETS)
 QDMA Channel defines They should be used while requesting a specific QDMA channel.
#define EDMA3_DRV_QDMA_CHANNEL_1   (EDMA3_DRV_QDMA_CHANNEL_0+1u)
#define EDMA3_DRV_QDMA_CHANNEL_2   (EDMA3_DRV_QDMA_CHANNEL_0+2u)
#define EDMA3_DRV_QDMA_CHANNEL_3   (EDMA3_DRV_QDMA_CHANNEL_0+3u)
#define EDMA3_DRV_QDMA_CHANNEL_4   (EDMA3_DRV_QDMA_CHANNEL_0+4u)
#define EDMA3_DRV_QDMA_CHANNEL_5   (EDMA3_DRV_QDMA_CHANNEL_0+5u)
#define EDMA3_DRV_QDMA_CHANNEL_6   (EDMA3_DRV_QDMA_CHANNEL_0+6u)
#define EDMA3_DRV_QDMA_CHANNEL_7   (EDMA3_DRV_QDMA_CHANNEL_0+7u)

Enumerations

enum  EDMA3_DRV_HW_CHANNEL_EVENT {
  EDMA3_DRV_HW_CHANNEL_EVENT_0 = 0,
  EDMA3_DRV_HW_CHANNEL_EVENT_1,
  EDMA3_DRV_HW_CHANNEL_EVENT_2,
  EDMA3_DRV_HW_CHANNEL_EVENT_3,
  EDMA3_DRV_HW_CHANNEL_EVENT_4,
  EDMA3_DRV_HW_CHANNEL_EVENT_5,
  EDMA3_DRV_HW_CHANNEL_EVENT_6,
  EDMA3_DRV_HW_CHANNEL_EVENT_7,
  EDMA3_DRV_HW_CHANNEL_EVENT_8,
  EDMA3_DRV_HW_CHANNEL_EVENT_9,
  EDMA3_DRV_HW_CHANNEL_EVENT_10,
  EDMA3_DRV_HW_CHANNEL_EVENT_11,
  EDMA3_DRV_HW_CHANNEL_EVENT_12,
  EDMA3_DRV_HW_CHANNEL_EVENT_13,
  EDMA3_DRV_HW_CHANNEL_EVENT_14,
  EDMA3_DRV_HW_CHANNEL_EVENT_15,
  EDMA3_DRV_HW_CHANNEL_EVENT_16,
  EDMA3_DRV_HW_CHANNEL_EVENT_17,
  EDMA3_DRV_HW_CHANNEL_EVENT_18,
  EDMA3_DRV_HW_CHANNEL_EVENT_19,
  EDMA3_DRV_HW_CHANNEL_EVENT_20,
  EDMA3_DRV_HW_CHANNEL_EVENT_21,
  EDMA3_DRV_HW_CHANNEL_EVENT_22,
  EDMA3_DRV_HW_CHANNEL_EVENT_23,
  EDMA3_DRV_HW_CHANNEL_EVENT_24,
  EDMA3_DRV_HW_CHANNEL_EVENT_25,
  EDMA3_DRV_HW_CHANNEL_EVENT_26,
  EDMA3_DRV_HW_CHANNEL_EVENT_27,
  EDMA3_DRV_HW_CHANNEL_EVENT_28,
  EDMA3_DRV_HW_CHANNEL_EVENT_29,
  EDMA3_DRV_HW_CHANNEL_EVENT_30,
  EDMA3_DRV_HW_CHANNEL_EVENT_31,
  EDMA3_DRV_HW_CHANNEL_EVENT_32,
  EDMA3_DRV_HW_CHANNEL_EVENT_33,
  EDMA3_DRV_HW_CHANNEL_EVENT_34,
  EDMA3_DRV_HW_CHANNEL_EVENT_35,
  EDMA3_DRV_HW_CHANNEL_EVENT_36,
  EDMA3_DRV_HW_CHANNEL_EVENT_37,
  EDMA3_DRV_HW_CHANNEL_EVENT_38,
  EDMA3_DRV_HW_CHANNEL_EVENT_39,
  EDMA3_DRV_HW_CHANNEL_EVENT_40,
  EDMA3_DRV_HW_CHANNEL_EVENT_41,
  EDMA3_DRV_HW_CHANNEL_EVENT_42,
  EDMA3_DRV_HW_CHANNEL_EVENT_43,
  EDMA3_DRV_HW_CHANNEL_EVENT_44,
  EDMA3_DRV_HW_CHANNEL_EVENT_45,
  EDMA3_DRV_HW_CHANNEL_EVENT_46,
  EDMA3_DRV_HW_CHANNEL_EVENT_47,
  EDMA3_DRV_HW_CHANNEL_EVENT_48,
  EDMA3_DRV_HW_CHANNEL_EVENT_49,
  EDMA3_DRV_HW_CHANNEL_EVENT_50,
  EDMA3_DRV_HW_CHANNEL_EVENT_51,
  EDMA3_DRV_HW_CHANNEL_EVENT_52,
  EDMA3_DRV_HW_CHANNEL_EVENT_53,
  EDMA3_DRV_HW_CHANNEL_EVENT_54,
  EDMA3_DRV_HW_CHANNEL_EVENT_55,
  EDMA3_DRV_HW_CHANNEL_EVENT_56,
  EDMA3_DRV_HW_CHANNEL_EVENT_57,
  EDMA3_DRV_HW_CHANNEL_EVENT_58,
  EDMA3_DRV_HW_CHANNEL_EVENT_59,
  EDMA3_DRV_HW_CHANNEL_EVENT_60,
  EDMA3_DRV_HW_CHANNEL_EVENT_61,
  EDMA3_DRV_HW_CHANNEL_EVENT_62,
  EDMA3_DRV_HW_CHANNEL_EVENT_63
}
 DMA Channels assigned to different Hardware Events. They should be used while requesting a specific DMA channel. One possible usage is to maintain a SoC specific file, which will contain the mapping of these hardware events to the respective peripherals for better understanding and lesser probability of errors. Also, if any event associated with a particular peripheral gets changed, only that SoC specific file needs to be changed. More...

Functions

EDMA3_DRV_Result EDMA3_DRV_requestChannel (EDMA3_DRV_Handle hEdma, unsigned int *pLCh, unsigned int *pTcc, EDMA3_RM_EventQueue evtQueue, EDMA3_RM_TccCallback tccCb, void *cbData)
 Request a DMA/QDMA/Link channel.
EDMA3_DRV_Result EDMA3_DRV_freeChannel (EDMA3_DRV_Handle hEdma, unsigned int channelId)
 Free the specified channel (DMA/QDMA/Link) and its associated resources (PaRAM Set, TCC etc) and removes various mappings.
EDMA3_DRV_Result EDMA3_DRV_clearErrorBits (EDMA3_DRV_Handle hEdma, unsigned int channelId)
 Clears Event Register and Error Register for a specific DMA channel and brings back EDMA3 to its initial state.
EDMA3_DRV_Result EDMA3_DRV_linkChannel (EDMA3_DRV_Handle hEdma, unsigned int lCh1, unsigned int lCh2)
 Link two logical channels.
EDMA3_DRV_Result EDMA3_DRV_unlinkChannel (EDMA3_DRV_Handle hEdma, unsigned int lCh)
 Unlink the channel from the earlier linked logical channel.

Detailed Description

Channel related Interface of the EDMA3 Driver

Define Documentation

#define EDMA3_DRV_DMA_CHANNEL_ANY   1002u

Used to specify any available DMA Channel while requesting one. Used in the API EDMA3_DRV_requestChannel(). DMA channel from the pool of (owned && non_reserved && available_right_now) DMA channels will be chosen and returned.

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_LINK_CHANNEL   1005u

Used to specify any available PaRAM Set while requesting one. Used in the API EDMA3_DRV_requestChannel(), for Link channels. PaRAM Set from the pool of (owned && non_reserved && available_right_now) PaRAM Sets will be chosen and returned.

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_QDMA_CHANNEL_0   (EDMA3_MAX_DMA_CH + EDMA3_MAX_PARAM_SETS)

QDMA Channel defines They should be used while requesting a specific QDMA channel.

QDMA Channel 0

Referenced by EDMA3_DRV_setPaRAMField().

#define EDMA3_DRV_QDMA_CHANNEL_1   (EDMA3_DRV_QDMA_CHANNEL_0+1u)

QDMA Channel 1

#define EDMA3_DRV_QDMA_CHANNEL_2   (EDMA3_DRV_QDMA_CHANNEL_0+2u)

QDMA Channel 2

#define EDMA3_DRV_QDMA_CHANNEL_3   (EDMA3_DRV_QDMA_CHANNEL_0+3u)

QDMA Channel 3

#define EDMA3_DRV_QDMA_CHANNEL_4   (EDMA3_DRV_QDMA_CHANNEL_0+4u)

QDMA Channel 4

#define EDMA3_DRV_QDMA_CHANNEL_5   (EDMA3_DRV_QDMA_CHANNEL_0+5u)

QDMA Channel 5

#define EDMA3_DRV_QDMA_CHANNEL_6   (EDMA3_DRV_QDMA_CHANNEL_0+6u)

QDMA Channel 6

#define EDMA3_DRV_QDMA_CHANNEL_7   (EDMA3_DRV_QDMA_CHANNEL_0+7u)

QDMA Channel 7

Referenced by EDMA3_DRV_setPaRAMField().

#define EDMA3_DRV_QDMA_CHANNEL_ANY   1003u

Used to specify any available QDMA Channel while requesting one. Used in the API EDMA3_DRV_requestChannel(). QDMA channel from the pool of (owned && non_reserved && available_right_now) QDMA channels will be chosen and returned.

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_TCC_ANY   1004u

Used to specify any available TCC while requesting one. Used in the API EDMA3_DRV_requestChannel(), for both DMA and QDMA channels. TCC from the pool of (owned && non_reserved && available_right_now) TCCs will be chosen and returned.

Referenced by EDMA3_DRV_requestChannel().


Enumeration Type Documentation

DMA Channels assigned to different Hardware Events. They should be used while requesting a specific DMA channel. One possible usage is to maintain a SoC specific file, which will contain the mapping of these hardware events to the respective peripherals for better understanding and lesser probability of errors. Also, if any event associated with a particular peripheral gets changed, only that SoC specific file needs to be changed.

for eg, the sample SoC specific file "soc.h" can have these defines:

define EDMA3_DRV_HW_CHANNEL_MCBSP_TX EDMA3_DRV_HW_CHANNEL_EVENT_2 define EDMA3_DRV_HW_CHANNEL_MCBSP_RX EDMA3_DRV_HW_CHANNEL_EVENT_3

These defines will be used by the MCBSP driver. The same event EDMA3_DRV_HW_CHANNEL_EVENT_2/3 could be mapped to some other peripheral also.

Enumerator:
EDMA3_DRV_HW_CHANNEL_EVENT_0  Channel assigned to EDMA3 Event 0
EDMA3_DRV_HW_CHANNEL_EVENT_1  Channel assigned to EDMA3 Event 1
EDMA3_DRV_HW_CHANNEL_EVENT_2  Channel assigned to EDMA3 Event 2
EDMA3_DRV_HW_CHANNEL_EVENT_3  Channel assigned to EDMA3 Event 3
EDMA3_DRV_HW_CHANNEL_EVENT_4  Channel assigned to EDMA3 Event 4
EDMA3_DRV_HW_CHANNEL_EVENT_5  Channel assigned to EDMA3 Event 5
EDMA3_DRV_HW_CHANNEL_EVENT_6  Channel assigned to EDMA3 Event 6
EDMA3_DRV_HW_CHANNEL_EVENT_7  Channel assigned to EDMA3 Event 7
EDMA3_DRV_HW_CHANNEL_EVENT_8  Channel assigned to EDMA3 Event 8
EDMA3_DRV_HW_CHANNEL_EVENT_9  Channel assigned to EDMA3 Event 9
EDMA3_DRV_HW_CHANNEL_EVENT_10  Channel assigned to EDMA3 Event 10
EDMA3_DRV_HW_CHANNEL_EVENT_11  Channel assigned to EDMA3 Event 11
EDMA3_DRV_HW_CHANNEL_EVENT_12  Channel assigned to EDMA3 Event 12
EDMA3_DRV_HW_CHANNEL_EVENT_13  Channel assigned to EDMA3 Event 13
EDMA3_DRV_HW_CHANNEL_EVENT_14  Channel assigned to EDMA3 Event 14
EDMA3_DRV_HW_CHANNEL_EVENT_15  Channel assigned to EDMA3 Event 15
EDMA3_DRV_HW_CHANNEL_EVENT_16  Channel assigned to EDMA3 Event 16
EDMA3_DRV_HW_CHANNEL_EVENT_17  Channel assigned to EDMA3 Event 17
EDMA3_DRV_HW_CHANNEL_EVENT_18  Channel assigned to EDMA3 Event 18
EDMA3_DRV_HW_CHANNEL_EVENT_19  Channel assigned to EDMA3 Event 19
EDMA3_DRV_HW_CHANNEL_EVENT_20  Channel assigned to EDMA3 Event 20
EDMA3_DRV_HW_CHANNEL_EVENT_21  Channel assigned to EDMA3 Event 21
EDMA3_DRV_HW_CHANNEL_EVENT_22  Channel assigned to EDMA3 Event 22
EDMA3_DRV_HW_CHANNEL_EVENT_23  Channel assigned to EDMA3 Event 23
EDMA3_DRV_HW_CHANNEL_EVENT_24  Channel assigned to EDMA3 Event 24
EDMA3_DRV_HW_CHANNEL_EVENT_25  Channel assigned to EDMA3 Event 25
EDMA3_DRV_HW_CHANNEL_EVENT_26  Channel assigned to EDMA3 Event 26
EDMA3_DRV_HW_CHANNEL_EVENT_27  Channel assigned to EDMA3 Event 27
EDMA3_DRV_HW_CHANNEL_EVENT_28  Channel assigned to EDMA3 Event 28
EDMA3_DRV_HW_CHANNEL_EVENT_29  Channel assigned to EDMA3 Event 29
EDMA3_DRV_HW_CHANNEL_EVENT_30  Channel assigned to EDMA3 Event 30
EDMA3_DRV_HW_CHANNEL_EVENT_31  Channel assigned to EDMA3 Event 31
EDMA3_DRV_HW_CHANNEL_EVENT_32  Channel assigned to EDMA3 Event 32
EDMA3_DRV_HW_CHANNEL_EVENT_33  Channel assigned to EDMA3 Event 33
EDMA3_DRV_HW_CHANNEL_EVENT_34  Channel assigned to EDMA3 Event 34
EDMA3_DRV_HW_CHANNEL_EVENT_35  Channel assigned to EDMA3 Event 35
EDMA3_DRV_HW_CHANNEL_EVENT_36  Channel assigned to EDMA3 Event 36
EDMA3_DRV_HW_CHANNEL_EVENT_37  Channel assigned to EDMA3 Event 37
EDMA3_DRV_HW_CHANNEL_EVENT_38  Channel assigned to EDMA3 Event 38
EDMA3_DRV_HW_CHANNEL_EVENT_39  Channel assigned to EDMA3 Event 39
EDMA3_DRV_HW_CHANNEL_EVENT_40  Channel assigned to EDMA3 Event 40
EDMA3_DRV_HW_CHANNEL_EVENT_41  Channel assigned to EDMA3 Event 41
EDMA3_DRV_HW_CHANNEL_EVENT_42  Channel assigned to EDMA3 Event 42
EDMA3_DRV_HW_CHANNEL_EVENT_43  Channel assigned to EDMA3 Event 43
EDMA3_DRV_HW_CHANNEL_EVENT_44  Channel assigned to EDMA3 Event 44
EDMA3_DRV_HW_CHANNEL_EVENT_45  Channel assigned to EDMA3 Event 45
EDMA3_DRV_HW_CHANNEL_EVENT_46  Channel assigned to EDMA3 Event 46
EDMA3_DRV_HW_CHANNEL_EVENT_47  Channel assigned to EDMA3 Event 47
EDMA3_DRV_HW_CHANNEL_EVENT_48  Channel assigned to EDMA3 Event 48
EDMA3_DRV_HW_CHANNEL_EVENT_49  Channel assigned to EDMA3 Event 49
EDMA3_DRV_HW_CHANNEL_EVENT_50  Channel assigned to EDMA3 Event 50
EDMA3_DRV_HW_CHANNEL_EVENT_51  Channel assigned to EDMA3 Event 51
EDMA3_DRV_HW_CHANNEL_EVENT_52  Channel assigned to EDMA3 Event 52
EDMA3_DRV_HW_CHANNEL_EVENT_53  Channel assigned to EDMA3 Event 53
EDMA3_DRV_HW_CHANNEL_EVENT_54  Channel assigned to EDMA3 Event 54
EDMA3_DRV_HW_CHANNEL_EVENT_55  Channel assigned to EDMA3 Event 55
EDMA3_DRV_HW_CHANNEL_EVENT_56  Channel assigned to EDMA3 Event 56
EDMA3_DRV_HW_CHANNEL_EVENT_57  Channel assigned to EDMA3 Event 57
EDMA3_DRV_HW_CHANNEL_EVENT_58  Channel assigned to EDMA3 Event 58
EDMA3_DRV_HW_CHANNEL_EVENT_59  Channel assigned to EDMA3 Event 59
EDMA3_DRV_HW_CHANNEL_EVENT_60  Channel assigned to EDMA3 Event 60
EDMA3_DRV_HW_CHANNEL_EVENT_61  Channel assigned to EDMA3 Event 61
EDMA3_DRV_HW_CHANNEL_EVENT_62  Channel assigned to EDMA3 Event 62
EDMA3_DRV_HW_CHANNEL_EVENT_63  Channel assigned to EDMA3 Event 63


Function Documentation

EDMA3_DRV_Result EDMA3_DRV_clearErrorBits ( EDMA3_DRV_Handle  hEdma,
unsigned int  channelId 
)

Clears Event Register and Error Register for a specific DMA channel and brings back EDMA3 to its initial state.

This API clears the Event register, Event Miss register Event Enable register for a specific DMA channel. It also clears the CC Error register.

Parameters:
hEdma [IN] Handle to the EDMA Driver Instance.
channelId [IN] DMA Channel needs to be cleaned.
Returns:
EDMA3_DRV_SOK or EDMA3_DRV Error code
Note:
This function is re-entrant for unique channelId values. It is non- re-entrant for same channelId value.

References EDMA3_DRV_DMA_CH_MAX_VAL, EDMA3_DRV_E_INVALID_PARAM, EDMA3_DRV_Object::gblCfgParams, EDMA3_DRV_GblConfigParams::globalRegs, EDMA3_DRV_GblConfigParams::numEvtQueue, EDMA3_DRV_Instance::pDrvObjectHandle, and EDMA3_DRV_Instance::shadowRegs.

EDMA3_DRV_Result EDMA3_DRV_freeChannel ( EDMA3_DRV_Handle  hEdma,
unsigned int  channelId 
)

Free the specified channel (DMA/QDMA/Link) and its associated resources (PaRAM Set, TCC etc) and removes various mappings.

This API internally uses EDMA3_RM_freeResource () to free the desired resources.

For Link channels, this API only frees the associated PaRAM Set.

For DMA/QDMA channels, it does the following operations: a) Disable any ongoing transfer on the channel, b) Unregister the TCC Callback function and disable the interrupts, c) Remove the channel to Event Queue mapping, d) For DMA channels, clear the DCHMAP register, if available e) For QDMA channels, clear the QCHMAP register, f) Frees the DMA/QDMA channel in the end.

Parameters:
hEdma [IN] Handle to the EDMA Driver Instance.
channelId [IN] Logical Channel number to be freed.
Returns:
EDMA3_DRV_SOK or EDMA3_DRV Error code
Note:
This function disables the global interrupts while modifying the global CC registers and while modifying global data structures, to prevent simultaneous access to the global pool of resources. It internally calls EDMA3_RM_freeResource () for resource de-allocation. It is re-entrant.

References EDMA3_DRV_CHANNEL_TYPE_DMA, EDMA3_DRV_CHANNEL_TYPE_LINK, EDMA3_DRV_CHANNEL_TYPE_NONE, EDMA3_DRV_CHANNEL_TYPE_QDMA, EDMA3_DRV_DMA_CH_MAX_VAL, EDMA3_DRV_E_INVALID_PARAM, EDMA3_DRV_LINK_CH_MAX_VAL, EDMA3_DRV_LINK_CH_MIN_VAL, EDMA3_DRV_LOG_CH_MAX_VAL, EDMA3_DRV_QDMA_CH_MAX_VAL, EDMA3_DRV_QDMA_CH_MIN_VAL, EDMA3_DRV_Object::gblCfgParams, EDMA3_DRV_GblConfigParams::numPaRAMSets, EDMA3_DRV_GblConfigParams::numTccs, EDMA3_DRV_ChBoundResources::paRAMId, EDMA3_DRV_Instance::pDrvObjectHandle, EDMA3_DRV_Object::phyCtrllerInstId, EDMA3_DRV_Instance::resMgrInstance, and EDMA3_DRV_ChBoundResources::tcc.

Referenced by EDMA3_DRV_requestChannel().

EDMA3_DRV_Result EDMA3_DRV_linkChannel ( EDMA3_DRV_Handle  hEdma,
unsigned int  lCh1,
unsigned int  lCh2 
)

Link two logical channels.

This API is used to link two previously allocated logical (DMA/QDMA/Link) channels.

It sets the Link field of the PaRAM set associated with first logical channel (lCh1) to point it to the PaRAM set associated with second logical channel (lCh2).

It also sets the TCC field of PaRAM set associated with second logical channel to the same as that of the first logical channel.

After linking the channels, user should not update any PaRAM Set of the channel.

Parameters:
hEdma [IN] Handle to the EDMA Driver Instance.
lCh1 [IN] Logical Channel to which particular channel will be linked.
lCh2 [IN] Logical Channel which needs to be linked to the first channel. After the transfer based on the PaRAM set of lCh1 is over, the PaRAM set of lCh2 will be copied to the PaRAM set of lCh1 and transfer will resume. For DMA channels, another sync event is required to initiate the transfer on the Link channel.
Returns:
EDMA3_DRV_SOK or EDMA3_DRV Error Code
Note:
This function is re-entrant for unique lCh1 & lCh2 values. It is non-re-entrant for same lCh1 & lCh2 values.

References EDMA3_DRV_E_INVALID_PARAM, EDMA3_DRV_LOG_CH_MAX_VAL, EDMA3_DRV_OPT_TCC_CLR_MASK, EDMA3_DRV_OPT_TCC_GET_MASK, EDMA3_DRV_OPT_TCC_SET_MASK, EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD, EDMA3_DRV_Object::gblCfgParams, EDMA3_DRV_GblConfigParams::globalRegs, EDMA3_DRV_GblConfigParams::numPaRAMSets, EDMA3_DRV_ChBoundResources::paRAMId, EDMA3_DRV_Instance::pDrvObjectHandle, and EDMA3_DRV_Object::phyCtrllerInstId.

EDMA3_DRV_Result EDMA3_DRV_requestChannel ( EDMA3_DRV_Handle  hEdma,
unsigned int *  pLCh,
unsigned int *  pTcc,
EDMA3_RM_EventQueue  evtQueue,
EDMA3_RM_TccCallback  tccCb,
void *  cbData 
)

Request a DMA/QDMA/Link channel.

Each channel (DMA/QDMA/Link) must be requested before initiating a DMA transfer on that channel.

This API is used to allocate a logical channel (DMA/QDMA/Link) along with the associated resources. For DMA and QDMA channels, TCC and PaRAM Set are also allocated along with the requested channel. For Link channel, ONLY a PaRAM Set is allocated.

User can request a specific logical channel by passing the channel id in 'pLCh'. Note that the channel id is the same as the actual resource id in case of DMA channels. To allocate specific QDMA channels, user SHOULD use the defines EDMA3_DRV_QDMA_CHANNEL_X mentioned above.

User can also request ANY available logical channel also by specifying the below mentioned values in '*pLCh': a) EDMA3_DRV_DMA_CHANNEL_ANY: For DMA channels b) EDMA3_DRV_QDMA_CHANNEL_ANY: For QDMA channels, and c) EDMA3_DRV_LINK_CHANNEL: For Link channels. Normally user should use this value to request link channels (PaRAM Sets used for linking purpose only), unless he wants to use some specific link channels (PaRAM Sets) which is also allowed.

This API internally uses EDMA3_RM_allocResource () to allocate the desired resources (DMA/QDMA channel, PaRAM Set and TCC).

This API also registers a specific callback function against the allocated TCC.

For DMA/QDMA channels, after allocating all the EDMA3 resources, this API sets the TCC field of the OPT PaRAM Word with the allocated TCC. It also sets the event queue for the channel allocated. The event queue needs to be specified by the user.

For DMA channel, it also sets the DCHMAP register, if required.

For QDMA channel, it sets the QCHMAP register and CCNT as trigger word and enables the QDMA channel by writing to the QEESR register.

Parameters:
hEdma [IN] Handle to the previously opened Driver Instance.
pLCh [IN/OUT] Requested logical channel id. Examples:
  • EDMA3_DRV_HW_CHANNEL_EVENT_0
  • To request a DMA Master Channel mapped to EDMA Event 0.
  • EDMA3_DRV_DMA_CHANNEL_ANY
  • For requesting any DMA Master channel with no event mapping.

  • EDMA3_DRV_QDMA_CHANNEL_ANY
  • For requesting any QDMA Master channel

  • EDMA3_DRV_QDMA_CHANNEL_0
  • For requesting the QDMA Channel 0.

  • EDMA3_DRV_LINK_CHANNEL
  • For requesting a DMA Slave Channel,
  • to be linked to some other Master
  • channel.

In case user passes a specific channel Id, pLCh value is left unchanged. In case user requests ANY available resource, the allocated channel id is returned in pLCh.

Note:
To request a PaRAM Set for the purpose of linking to another channel, call the function with
*pLCh = EDMA3_DRV_LINK_CHANNEL;

This function will update *pLCh with the allocated Link channel handle. This handle could be DIFFERENT from the actual PaRAM Set allocated by the Resource Manager internally. So user SHOULD NOT assume the handle as the PaRAM Set Id.

Parameters:
pTcc [IN/OUT] The channel number on which the completion/error interrupt is generated. Not used if user requested for a Link channel. Examples:
  • EDMA3_DRV_HW_CHANNEL_EVENT_0
  • To request TCC associated with
  • DMA Master Channel mapped to EDMA
  • event 0.
  • EDMA3_DRV_TCC_ANY
  • For requesting any TCC with no
  • channel mapping. In case user passes a specific TCC value, pTcc value is left unchanged. In case user requests ANY available TCC, the allocated one is returned in pTcc

Parameters:
evtQueue [IN] Event Queue Number to which the channel will be mapped (valid only for the Master Channel (DMA/QDMA) request)
tccCb [IN] TCC callback - caters to channel- specific events like "Event Miss Error" or "Transfer Complete"
cbData [IN] Data which will be passed directly to the tccCb callback function
Returns:
EDMA3_DRV_SOK or EDMA3_DRV Error code
Note:
This function internally uses EDMA3 Resource Manager, which acquires a RM Instance specific semaphore to prevent simultaneous access to the global pool of resources. It also disables the global interrupts while modifying the global CC registers. It is re-entrant, but SHOULD NOT be called from the user callback function (ISR context).

Fill the resource id, whose associated TCC needs to be registered. For QDMA channels, pass the actual QDMA channel no instead of (*pLCh).

Map the allocated PaRAM Set to the logical DMa/QDMA channel.

First check whether the mapping feature is supported on the underlying platform. In case it is not supported, dont call this API, because this API returns error in case the feature is not there.

References EDMA3_DRV_GblConfigParams::dmaChannelPaRAMMap, EDMA3_DRV_GblConfigParams::dmaChannelTccMap, EDMA3_DRV_GblConfigParams::dmaChPaRAMMapExists, EDMA3_DRV_CH_NO_PARAM_MAP, EDMA3_DRV_CH_NO_TCC_MAP, EDMA3_DRV_CHANNEL_TYPE_DMA, EDMA3_DRV_CHANNEL_TYPE_QDMA, EDMA3_DRV_DMA_CH_MAX_VAL, EDMA3_DRV_DMA_CHANNEL_ANY, EDMA3_DRV_DMAQNUM_CLR_MASK, EDMA3_DRV_DMAQNUM_SET_MASK, EDMA3_DRV_E_CH_PARAM_BIND_FAIL, EDMA3_DRV_E_DMA_CHANNEL_UNAVAIL, EDMA3_DRV_E_INVALID_PARAM, EDMA3_DRV_E_QDMA_CHANNEL_UNAVAIL, EDMA3_DRV_E_TCC_REGISTER_FAIL, EDMA3_DRV_E_TCC_UNAVAIL, EDMA3_DRV_freeChannel(), EDMA3_DRV_LINK_CH_MAX_VAL, EDMA3_DRV_LINK_CH_MIN_VAL, EDMA3_DRV_LINK_CHANNEL, EDMA3_DRV_OPT_TCC_CLR_MASK, EDMA3_DRV_OPT_TCC_SET_MASK, EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD, EDMA3_DRV_QDMA_CH_MAX_VAL, EDMA3_DRV_QDMA_CH_MIN_VAL, EDMA3_DRV_QDMA_CHANNEL_ANY, EDMA3_DRV_QDMAQNUM_CLR_MASK, EDMA3_DRV_QDMAQNUM_SET_MASK, EDMA3_DRV_TCC_ANY, EDMA3_DRV_TRIG_MODE_NONE, EDMA3_DRV_TRIG_MODE_QDMA, EDMA3_DRV_Object::gblCfgParams, EDMA3_DRV_GblConfigParams::globalRegs, EDMA3_DRV_GblConfigParams::numDmaChannels, EDMA3_DRV_GblConfigParams::numEvtQueue, EDMA3_DRV_ChBoundResources::paRAMId, EDMA3_DRV_Instance::pDrvObjectHandle, EDMA3_DRV_Object::phyCtrllerInstId, EDMA3_DRV_Instance::resMgrInstance, EDMA3_DRV_Instance::shadowRegs, EDMA3_DRV_ChBoundResources::tcc, and EDMA3_DRV_ChBoundResources::trigMode.

EDMA3_DRV_Result EDMA3_DRV_unlinkChannel ( EDMA3_DRV_Handle  hEdma,
unsigned int  lCh 
)

Unlink the channel from the earlier linked logical channel.

This function breaks the link between the specified channel and the earlier linked logical channel by clearing the Link Address field.

Parameters:
hEdma [IN] Handle to the EDMA Driver Instance.
lCh [IN] Channel for which linking has to be removed
Returns:
EDMA3_DRV_SOK or EDMA3_DRV Error Code
Note:
This function is re-entrant for unique lCh values. It is non- re-entrant for same lCh value.

References EDMA3_DRV_E_INVALID_PARAM, EDMA3_DRV_LOG_CH_MAX_VAL, EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD, EDMA3_DRV_Object::gblCfgParams, EDMA3_DRV_GblConfigParams::globalRegs, EDMA3_DRV_GblConfigParams::numPaRAMSets, EDMA3_DRV_ChBoundResources::paRAMId, EDMA3_DRV_Instance::pDrvObjectHandle, and EDMA3_DRV_Object::phyCtrllerInstId.


Generated on Tue Jul 7 19:18:47 2009 for EDMA3 Driver by  doxygen 1.5.9