📄 edma3_drv.h
字号:
/** Channel assigned to EDMA3 Event 34 */
EDMA3_DRV_HW_CHANNEL_EVENT_34,
/** Channel assigned to EDMA3 Event 35 */
EDMA3_DRV_HW_CHANNEL_EVENT_35,
/** Channel assigned to EDMA3 Event 36 */
EDMA3_DRV_HW_CHANNEL_EVENT_36,
/** Channel assigned to EDMA3 Event 37 */
EDMA3_DRV_HW_CHANNEL_EVENT_37,
/** Channel assigned to EDMA3 Event 38 */
EDMA3_DRV_HW_CHANNEL_EVENT_38,
/** Channel assigned to EDMA3 Event 39 */
EDMA3_DRV_HW_CHANNEL_EVENT_39,
/** Channel assigned to EDMA3 Event 40 */
EDMA3_DRV_HW_CHANNEL_EVENT_40,
/** Channel assigned to EDMA3 Event 41 */
EDMA3_DRV_HW_CHANNEL_EVENT_41,
/** Channel assigned to EDMA3 Event 42 */
EDMA3_DRV_HW_CHANNEL_EVENT_42,
/** Channel assigned to EDMA3 Event 43 */
EDMA3_DRV_HW_CHANNEL_EVENT_43,
/** Channel assigned to EDMA3 Event 44 */
EDMA3_DRV_HW_CHANNEL_EVENT_44,
/** Channel assigned to EDMA3 Event 45 */
EDMA3_DRV_HW_CHANNEL_EVENT_45,
/** Channel assigned to EDMA3 Event 46 */
EDMA3_DRV_HW_CHANNEL_EVENT_46,
/** Channel assigned to EDMA3 Event 47 */
EDMA3_DRV_HW_CHANNEL_EVENT_47,
/** Channel assigned to EDMA3 Event 48 */
EDMA3_DRV_HW_CHANNEL_EVENT_48,
/** Channel assigned to EDMA3 Event 49 */
EDMA3_DRV_HW_CHANNEL_EVENT_49,
/** Channel assigned to EDMA3 Event 50 */
EDMA3_DRV_HW_CHANNEL_EVENT_50,
/** Channel assigned to EDMA3 Event 51 */
EDMA3_DRV_HW_CHANNEL_EVENT_51,
/** Channel assigned to EDMA3 Event 52 */
EDMA3_DRV_HW_CHANNEL_EVENT_52,
/** Channel assigned to EDMA3 Event 53 */
EDMA3_DRV_HW_CHANNEL_EVENT_53,
/** Channel assigned to EDMA3 Event 54 */
EDMA3_DRV_HW_CHANNEL_EVENT_54,
/** Channel assigned to EDMA3 Event 55 */
EDMA3_DRV_HW_CHANNEL_EVENT_55,
/** Channel assigned to EDMA3 Event 56 */
EDMA3_DRV_HW_CHANNEL_EVENT_56,
/** Channel assigned to EDMA3 Event 57 */
EDMA3_DRV_HW_CHANNEL_EVENT_57,
/** Channel assigned to EDMA3 Event 58 */
EDMA3_DRV_HW_CHANNEL_EVENT_58,
/** Channel assigned to EDMA3 Event 59 */
EDMA3_DRV_HW_CHANNEL_EVENT_59,
/** Channel assigned to EDMA3 Event 60 */
EDMA3_DRV_HW_CHANNEL_EVENT_60,
/** Channel assigned to EDMA3 Event 61 */
EDMA3_DRV_HW_CHANNEL_EVENT_61,
/** Channel assigned to EDMA3 Event 62 */
EDMA3_DRV_HW_CHANNEL_EVENT_62,
/** Channel assigned to EDMA3 Event 63 */
EDMA3_DRV_HW_CHANNEL_EVENT_63
} EDMA3_DRV_HW_CHANNEL_EVENT;
/**
* \brief QDMA Channel defines
* They should be used while requesting a specific QDMA channel.
*/
/** QDMA Channel 0 */
#define EDMA3_DRV_QDMA_CHANNEL_0 (EDMA3_MAX_DMA_CH + EDMA3_MAX_PARAM_SETS)
/** QDMA Channel 1 */
#define EDMA3_DRV_QDMA_CHANNEL_1 (EDMA3_DRV_QDMA_CHANNEL_0+1u)
/** QDMA Channel 2 */
#define EDMA3_DRV_QDMA_CHANNEL_2 (EDMA3_DRV_QDMA_CHANNEL_0+2u)
/** QDMA Channel 3 */
#define EDMA3_DRV_QDMA_CHANNEL_3 (EDMA3_DRV_QDMA_CHANNEL_0+3u)
/** QDMA Channel 4 */
#define EDMA3_DRV_QDMA_CHANNEL_4 (EDMA3_DRV_QDMA_CHANNEL_0+4u)
/** QDMA Channel 5 */
#define EDMA3_DRV_QDMA_CHANNEL_5 (EDMA3_DRV_QDMA_CHANNEL_0+5u)
/** QDMA Channel 6 */
#define EDMA3_DRV_QDMA_CHANNEL_6 (EDMA3_DRV_QDMA_CHANNEL_0+6u)
/** QDMA Channel 7 */
#define EDMA3_DRV_QDMA_CHANNEL_7 (EDMA3_DRV_QDMA_CHANNEL_0+7u)
/**
* \brief 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.
*
* \param hEdma [IN] Handle to the previously opened Driver
* Instance.
* \param 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.
*
* \param 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
*
* \param evtQueue [IN] Event Queue Number to which the channel
* will be mapped (valid only for the
* Master Channel (DMA/QDMA) request)
*
* \param tccCb [IN] TCC callback - caters to channel-
* specific events like "Event Miss Error"
* or "Transfer Complete"
*
* \param cbData [IN] Data which will be passed directly to
* the tccCb callback function
*
* \return 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).
*/
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);
/**
* \brief 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.
*
* \param hEdma [IN] Handle to the EDMA Driver Instance.
* \param channelId [IN] Logical Channel number to be freed.
*
* \return 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.
*/
EDMA3_DRV_Result EDMA3_DRV_freeChannel (EDMA3_DRV_Handle hEdma,
unsigned int channelId);
/**
* \brief 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.
*
* \param hEdma [IN] Handle to the EDMA Driver Instance.
* \param channelId [IN] DMA Channel needs to be cleaned.
*
* \return 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.
*/
EDMA3_DRV_Result EDMA3_DRV_clearErrorBits (EDMA3_DRV_Handle hEdma,
unsigned int channelId);
/**
* \brief 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.
*
* \param hEdma [IN] Handle to the EDMA Driver Instance.
* \param lCh1 [IN] Logical Channel to which particular channel
* will be linked.
* \param lCh2 [IN] Logical Channel which needs to be linked to
* the first channel.
* After the transfer based on the PaRAM set
* of lCh1 i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -